Find LLM cost waste in any codebase. Open source.
erabot is a command-line tool that scans your code for LLM API call sites,
audits them against pricing + downgrade heuristics, and writes an
agent-instructions.md your coding agent can apply in one command.
pip install erabot
# Scan a file or directory locally — no network
erabot scan ./src
# Run the full audit (uploads to api.erabot.ai, returns agent-instructions.md)
export ERABOT_API_KEY="erabot_..." # free at https://erabot.ai
erabot audit ./src
# Apply via Claude Code
erabot applyTree-sitter based static analysis. Detects LLM SDK call sites with the model, provider, streaming flag, tools, and token usage hints. Across:
| Languages | Providers / Frameworks |
|---|---|
| Python | OpenAI, Anthropic, Google Gemini, LangChain, LlamaIndex, LiteLLM |
| TypeScript | OpenAI, Anthropic, Google, Vercel AI SDK |
| JavaScript | OpenAI, Anthropic, Google |
F1=1.00 across 105 OSS repos in our eval corpus on detection accuracy.
| Component | Status | Where |
|---|---|---|
| Tree-sitter scanner | Open (MIT) | packages/scanner/ |
erabot CLI |
Open (MIT) | packages/cli/ |
| Audit engine (Gemini + RAG) | Closed | api.erabot.ai |
| Pricing tables + downgrade map | Closed | api.erabot.ai |
| Dashboard, billing, team features | Closed | erabot.ai |
| Helicone / Langfuse runtime importers | Closed | api.erabot.ai |
The split is intentional: the scanner is commodity infrastructure (tree-sitter patterns) and benefits from open contribution. The audit prompts + RAG knowledge base are the IP, and they stay in the cloud service so we can fund ongoing development without subscriptions for hobbyists.
pip install erabotOr install the scanner alone (no CLI, no API key):
pip install erabot-scannerLocal-only, no network. Prints a table by default; pass --format json for
machine-readable output:
erabot scan ./src
erabot scan ./app.py --format json | jqUploads detected call sites to api.erabot.ai, runs the full Gemini-backed
audit, and writes agent-instructions.md to the current directory:
export ERABOT_API_KEY="erabot_..." # https://erabot.ai/signup
erabot audit ./src
# → ✓ Wrote 8,432 bytes to agent-instructions.mdWraps claude-code apply agent-instructions.md:
erabot applyRequires the claude-code CLI in your PATH. See
docs.claude.com/claude-code.
from erabot_scanner import scan_files
findings = scan_files([
{"path": "app.py", "content": open("app.py").read()},
])
for f in findings:
print(f["file_path"], f["line"], f.get("provider"), f.get("model"))See CONTRIBUTING.md. Check the "good first issue" label for starter tasks.
MIT.
Built by @rohan3008 and contributors. Questions: github.com/rohan3008/erabot-cli/issues.