Skip to content

Releases: MukundaKatta/AgentBudgetPy

v0.1.0 — initial release

07 May 17:16

Choose a tag to compare

Python port of @mukundakatta/agentbudget. Same API surface, snake_case names. Token + dollar budget caps for AI agents — raises BudgetExceededError when an LLM call would push past the ceiling.

Install

pip install agentbudget-py

What's in v0.1.0

  • Budget(max_input_tokens=, max_output_tokens=, max_total_tokens=, max_cost_usd=, pricing=, allow_unknown_pricing=)
  • record_usage({model, input_tokens, output_tokens}) — tally + raise on over
  • wrap(fn, extract_usage=) — auto-record from Anthropic / OpenAI shapes
  • would_exceed / assert_can_spend — pre-flight checks (no mutation)
  • remaining() / reset() — introspection
  • DEFAULT_PRICING starter table (Claude + GPT, early-2026 rates)
  • allow_unknown_pricing flag for preview models with no rate sheet yet
  • BudgetExceededError carries cap, limit, attempted, overshoot, model
  • 23/23 tests on Python 3.10+, zero runtime deps

Sibling libraries

Part of the @MukundaKatta agent reliability stack:

JS sibling: @mukundakatta/agentbudget.