Agent cost control, energy budget management, and token tracking
Project description
agent-energy-budget
Agent cost control, energy budget management, and token tracking
Part of the AumOS open-source agent infrastructure portfolio.
Features
BudgetTrackerperforms pre-call affordability checks and records actual spend to a per-agent JSONL log, supporting daily, weekly, and monthly limits simultaneously- Four degradation strategies when budgets are tight:
TOKEN_REDUCTION(cap output tokens to fit remaining budget),MODEL_DOWNGRADE(switch to the cheapest affordable model),CACHED_FALLBACK(signal to use cached responses), andBLOCK_WITH_ERROR(raiseBudgetExceededError) - Model pricing tables for OpenAI, Anthropic, Google, and custom models with a
CostEstimatorthat projects spend before the call is made - Hierarchical sub-budget allocation — a parent
BudgetTrackercan allocate fractional child budgets for sub-agents in a multi-agent team - Threshold-based alert system fires warning, critical, and exhausted callbacks at configurable utilization percentages
- Middleware wrappers for LangChain, CrewAI, AutoGen, Anthropic SDK, and OpenAI SDK that intercept calls and apply budget checks transparently
- Spend reporting with per-model breakdowns, top-N cost attribution, and ASCII/matplotlib visualizations
Quick Start
Install from PyPI:
pip install agent-energy-budget
Verify the installation:
agent-energy-budget version
Basic usage:
import agent_energy_budget
# See examples/01_quickstart.py for a working example
Documentation
Enterprise Upgrade
For production deployments requiring SLA-backed support and advanced integrations, contact the maintainers or see the commercial extensions documentation.
Contributing
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.
License
Apache 2.0 — see LICENSE for full terms.
Part of AumOS — open-source agent infrastructure.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_energy_budget-0.2.0.tar.gz.
File metadata
- Download URL: agent_energy_budget-0.2.0.tar.gz
- Upload date:
- Size: 170.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c8808e3b0fed84727a019c0037bde0202fd85c08903256dede530a07f8b9588
|
|
| MD5 |
e6d6f03af95e499bf7d95127fcb2c3c5
|
|
| BLAKE2b-256 |
694133582ea554f8eb8c7a9004b99ff8b3b3a084068d064a7b3f773b982a87b9
|
File details
Details for the file agent_energy_budget-0.2.0-py3-none-any.whl.
File metadata
- Download URL: agent_energy_budget-0.2.0-py3-none-any.whl
- Upload date:
- Size: 140.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d8b7406968fab524f7689d5367c511a69bdc49d3a952b013d9dffc1cf96cf58
|
|
| MD5 |
634bd0118df2343da7b395920b7e553b
|
|
| BLAKE2b-256 |
d72bbef0373baec7ad8f17c466e9ad73c1b582201cd62926a8d550248fdcb910
|