▲ 3 r/Agentic_Marketing+1 crossposts

How are you handling token budgets across multiple AI agents in production?

Curious how people here deal with this: when you’ve got several agents working together (a researcher, a writer, a critic, whatever the setup), how do you manage their shared token spend? In my experience most setups just give each agent a flat cap, which means an important agent can run dry mid-task while a less important one right next to it has budget sitting unused.
I ended up building a small open-source library to deal with this on my own projects — Token Budget Contracts (TBC). Each agent gets a priority and a budget; when one runs low, spare tokens automatically flow in from lower-priority or idle agents, never the reverse, and never below a protected reserve. It also stops an agent from spending further once it’s already confident in its result.

from tbcontracts import BudgetManager

manager = BudgetManager()
manager.register_agent("researcher", priority=3, max_tokens=4000)
manager.register_agent("critic", priority=1, max_tokens=2000)

@manager.govern("researcher")
def call_researcher(prompt):
return my_llm_call(prompt)

pip install token-budget-contracts — MIT licensed, 23 tests, no dependencies. Works with any Python-based agent setup (LangGraph, CrewAI, AutoGen, or raw API calls).

Mostly want to know: is this a real pain point for others, or is everyone already solving it some other way (rate limits, observability tools, just eating the cost)? Genuinely curious what people are doing here.

reddit.com
u/Opus_craft — 13 days ago

Built an open-source library for priority-weighted token budgets across multi-agent LangGraph systems

I kept running into the same issue building LangGraph workflows: one node/agent runs out of token budget mid-execution while another node sits on unused budget right next to it. Flat per-agent caps don’t account for which agent actually matters more at a given moment.
So I built Token Budget Contracts (TBC) — give each agent a priority and a token budget, and when one runs low, spare budget automatically flows in from lower-priority or idle agents (never the other way — budget never flows from a more important agent to a less important one, and donors never drop below a protected minimum reserve). It also has confidence-gated spending: once an agent’s already given a confident answer, further calls on it get blocked instead of burning more tokens.

from tbcontracts import BudgetManager

manager = BudgetManager()
manager.register_agent("researcher", priority=3, max_tokens=4000)
manager.register_agent("critic", priority=1, max_tokens=2000)

@manager.govern("researcher")
def call_researcher(prompt):
return my_llm_call(prompt)

pip install token-budget-contracts — MIT licensed, 23 passing tests, zero dependencies. Framework-agnostic right now (just wraps any Python function), no LangGraph-native adapter yet.
GitHub: https://github.com/swaranshu-borgaonkar/token-budget-contracts
Curious if others here have hit this same problem with LangGraph swarms, and whether a LangGraph-native adapter (auto-detecting nodes in a graph) would actually be useful or if I’m solving something people already work around another way. Open to feedback and PRs.

reddit.com
u/Opus_craft — 14 days ago
▲ 0 r/LanguageTechnology+1 crossposts

Looking for arXiv cs endorsement — first-time submitter, paper on multi-agent LLM token optimization (Patent Pending) [D]

Hi r/MachineLearning,

First-time arXiv submitter here looking for a cs category endorsement.

Paper topic: Token Budget Contracts (TBC) for Multi-Agent LLM Orchestration — a declarative protocol where each agent declares a formal resource envelope (max input tokens, max output tokens, confidence floor) enforced by a stateless orchestrator with dynamic priority-weighted budget reallocation.

Companion mechanism: Confidence-Gated Retrieval (CGR) — conditions RAG calls on agent self-assessed confidence, eliminating unnecessary retrieval overhead.

Key result: 97%+ accuracy at 40-60% baseline token cost with structural hallucination reduction.

US Provisional Patent filed tonight (Application #64/081,925).

Happy to share the full paper draft with anyone willing to endorse. The endorsement takes about 2 minutes — just click a link arXiv generates.

Thanks in advance.

reddit.com
u/Opus_craft — 1 month ago
▲ 0 r/reinforcementlearning+2 crossposts

Looking for arXiv cs endorsement — first-time submitter, paper on multi-agent LLM token optimization (Patent Pending) [D]

Hi r/MachineLearning,

First-time arXiv submitter here looking for a cs category endorsement.

Paper topic: Token Budget Contracts (TBC) for Multi-Agent LLM Orchestration — a declarative protocol where each agent declares a formal resource envelope (max input tokens, max output tokens, confidence floor) enforced by a stateless orchestrator with dynamic priority-weighted budget reallocation.

Companion mechanism: Confidence-Gated Retrieval (CGR) — conditions RAG calls on agent self-assessed confidence, eliminating unnecessary retrieval overhead.

Key result: 97%+ accuracy at 40-60% baseline token cost with structural hallucination reduction.

US Provisional Patent filed tonight (Application #64/081,925).

Happy to share the full paper draft with anyone willing to endorse. The endorsement takes about 2 minutes — just click a link arXiv generates.

Thanks in advance.

reddit.com
u/Opus_craft — 1 month ago