Skip to content

LongGuard v0.1.3

Choose a tag to compare

@github-actions github-actions released this 05 Sep 15:55
· 4 commits to main since this release

🚀 What's Changed in v0.1.3

🚀 Added

  • Raw Client Integration (OpenAI & Anthropic): Added AgentStep.from_openai_response() and AgentStep.from_anthropic_response() class methods. Enables using LongGuard directly with standard openai and anthropic SDK client loops without requiring LangGraph or LangChain.
  • Dollar Cost Tracking: Built-in pricing engine (PRICING_TABLE, compute_cost, list_supported_models) supporting 40+ major LLM models (OpenAI GPT-4o/o1/o3, Anthropic Claude 3.5/4, Gemini 1.5/2.0/2.5, LLaMA 3.1/3.3, Mistral, Cohere).
  • Budget Hard Cap (max_cost_usd): Configure hard dollar spend limits on agent runs (max_cost_usd) to immediately trip the circuit breaker and prevent runaway API bills.
  • Custom Token Pricing Overrides: Added cost_per_input_token and cost_per_output_token in GuardConfig for private/fine-tuned or unlisted models.
  • Report Persistence (save / load): Persist telemetry to disk via report.save("run.json") and restore full state using GuardReport.load("run.json"). Supports JSON natively and YAML (when pyyaml is installed).
  • Runnable Examples & Docs: Added standalone example in examples/openai_raw_guard.py and documentation in docs/integrations/raw-client.md.

🔄 Changed

  • GuardReport Telemetry: GuardReport.summary() now displays Estimated Cost: $X.XXXX USD (model) when cost tracking is configured.
  • Expanded Test Suite: Added 76 new test cases (255 tests total, 100% passing) covering SDK response parsing, pricing calculations, breaker cost limits, and report serialization.
  • Automated GitHub Releases: Enhanced GitHub Actions workflow to parse release notes directly from CHANGELOG.md and exclude internal build metadata from release assets.

📦 Install / Upgrade

pip install --upgrade longguard
# or
uv add longguard

🔗 Resources

Link
📖 Documentation https://endevsols.github.io/LongGuard/
🐍 PyPI https://pypi.org/project/longguard/
🌐 EnDevSols Long Suite https://endevsols.com/open-source
🐛 Report a Bug https://github.com/ENDEVSOLS/LongGuard/issues

✅ Quality

  • All tests passing (ruff + mypy strict + pytest)
  • Supported: Python 3.10, 3.11, 3.12 · Ubuntu & macOS

Part of the EnDevSols Long Suite — production AI tooling for Python.

Full Changelog: v0.1.1...v0.1.3