erabot
Find the cost risks in your AI agent's code — the runaway loops and missing caps that token counters miss. Locally, in seconds.
Most "LLM cost" tools count tokens. erabot also reads your agent's orchestration — the LangGraph loops and branches where cost actually runs away — and flags the ones with no cap set. Plus the usual: every LLM call site (OpenAI, Anthropic, Gemini, LangChain, LlamaIndex…) and its estimated monthly cost. Runs entirely on your machine — no upload, no signup, no account.
pipx install git+https://github.com/rohan3008/erabot # installs from source today
erabot estimate .
# PyPI release coming — then: pipx install erabot (or: pip install erabot)
Requires Python ≥ 3.10 and a recent pip (pip install --upgrade pip).
148 LLM call sites across 92 files
Estimated $2,140/mo at 10,000 calls/mo per site (assumed — pass --calls-per-month for your real volume)
⚑ 81% of estimated spend runs on flagship models (prime downgrade candidates)
Call site Model Est. $/mo
planner.py:88 gpt-4o ⚑ $412.00
summarize.py:12 gpt-4o ⚑ $301.00
classify.py:44 gpt-4o ⚑ $188.00
...
⚑ 2 orchestration risk(s) in your agent graph (unbounded loops / missing caps).
researcher.py:40 a conditional loop with no recursion_limit — relies on the
default cap (10007), so a runaway loop can cost up to that.
Free local scan — nothing left your machine. For findings + apply-ready fixes,
run the full audit at https://erabot.ai
Why the loop risks matter
A LangGraph loop with no explicit recursion_limit falls back to the framework default (10007 iterations). One badly-conditioned agent can quietly burn thousands of LLM calls before it stops. Generic token counters can't see this — it's a property of the graph, not the prompt. erabot flags:
- uncapped loops — a conditional / tool loop that relies on the default cap
- missing iteration caps — a looping graph invoked with no
recursion_limit - dead branches — nodes declared but never reachable
Agent-loop cost (any framework)
Separately — and not limited to LangGraph — erabot detects when a call site sits inside an agent loop (a while/for loop, or a bounded range(max_turns)) and multiplies its cost by the inferred turns per task. A call that looks cheap once may run 4–8× per task. Where the code pins the cap (max_turns=6) erabot reads it; otherwise it uses a conservative band and says so. This works across raw SDK loops, CrewAI, and others — the estimate flags ⚑ This looks agentic when it fires.
These flags are measured, not vibes
Run on 5 real LangGraph repos (langgraph, open_deep_research, and 3 others — 97 graph-defining files): the loop flags fire only where a loop actually exists with no explicit cap — 100% precision on that corpus, and 0 false flags on graphs that already set a recursion_limit.
And the call-site detection itself was measured on 9 real AI codebases (including held-out repos it wasn't tuned on): ~97% precision, with 100% recall on unambiguous SDK calls. Full method, numbers, and known false positives: docs/precision-eval.md.
Get a real cost number, not a guess
Static analysis can't see how often each call fires, so the default assumes a volume. Set your real traffic:
erabot estimate . --calls-per-month 285000 # your actual monthly call volume
erabot estimate . --json # machine-readable output for CI
Where your prompts are literals in the code, erabot reads the real token counts. Where the prompt is built at runtime, the estimate is a lower bound — connect Helicone / Langfuse / OpenTelemetry for measured spend.
Honest limits
- The
$/mofigure is modeled on an assumed call volume until you pass--calls-per-month; treat it as a shape, not a bill. - Orchestration flags are candidates — a cap may be set elsewhere than erabot can see statically. They tell you where to look, not that you're definitely wrong.
- The graph risk flags (uncapped loops / dead branches) currently cover LangGraph only; other graph frameworks are on the roadmap. (Agent-loop cost detection, above, is framework-agnostic.)
What's free vs. what's not
| Free (this tool) | Full audit — erabot.ai |
|---|---|
Detect LLM call sites + estimate $/mo, model mix, flagship share |
Diagnosed findings + root cause |
| Flag agent-loop cost risks (uncapped loops, missing caps) | Prove which calls are safe to downgrade / which loops are safe to cap |
| 100% local, no signup | Shadow-verified % savings, enterprise dashboard, CI cost-gate |
Detection is open source (MIT). The engine that proves a fix is safe — before you ship it — is the paid product.
What it detects
Python, TypeScript, and JavaScript for call sites (direct SDK calls, LangChain chains, LlamaIndex query engines, common wrapper patterns), and LangGraph graph construction for the loop-risk flags — all via tree-sitter AST analysis.
MIT licensed. erabot never sends your code anywhere.
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 erabot-0.1.0.tar.gz.
File metadata
- Download URL: erabot-0.1.0.tar.gz
- Upload date:
- Size: 55.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b6e57540e2af545b952c36889dda021abeb06a6f9f763eeb988c7a4e42b9501
|
|
| MD5 |
77a92f68f75e38b5b2c141f3e6f436b5
|
|
| BLAKE2b-256 |
29352e022b03050269c0a0b9656fe422a3a75358495ca1b74b4818734ca9ab00
|
File details
Details for the file erabot-0.1.0-py3-none-any.whl.
File metadata
- Download URL: erabot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f24bf69218d683f92594b8bb68b404c1c5e218eb52da73c74096047e99d138
|
|
| MD5 |
54e15dfcb20b54cbf4de9fe0488e36c4
|
|
| BLAKE2b-256 |
80c3bbcb8e24ce3d881ed9f640f01527467346e35534c7a8ee8485fd6f96da8e
|