The default model is the expensive one: five products, one bug
The default model in five open-source AI products was the priciest option available. One called its most expensive model DEFAULT_MINI_MODEL. What the audit found, and why defaults rot.
Practical guides on reducing AI costs and optimizing token usage.
The default model in five open-source AI products was the priciest option available. One called its most expensive model DEFAULT_MINI_MODEL. What the audit found, and why defaults rot.
Haiku costs a fraction of Sonnet per token, so the swap looks free. When we tested 31 model swaps on real code, our own quality gate rejected 12 of them. Here is how to tell which kind yours is.
The price gap between a frontier model and its mini sibling is wide enough to change your bill. The question is which of your calls can take the swap. A task-shape checklist, and the call we found running on a model 65x too expensive.
Per-token prices are published, but they do not tell you what your bill will be. We audited 15 open-source AI products and modeled where their LLM spend comes from.
Claude Code bills either through a subscription plan or per token on the API. Which one is cheaper depends on session length, tool surface and cache hit rate, not on how much you code.
Claude Code costs grow faster than your usage because every turn re-reads the whole conversation. Here is the arithmetic, plus what we found auditing six open-source coding agents.
Practical ways to reduce Claude Code token usage: fresh sessions, disconnecting MCP servers, compacting early, right-sizing the model. Then the bill those habits never touch — the LLM calls inside the app you ship.
LLM token compression is advertised at 85–97% savings. Read the fine print and almost every one of those figures is measured on JSON, logs, command output or tool schemas — not source code, where the credible numbers land nearer 20–55%.
Per-token prices keep falling, yet enterprise AI bills keep climbing. That is the Jevons paradox at work — and it is why 'just wait for prices to drop' is not a cost strategy. The only lever that survives a price war is cutting waste in the code.
A map of the LLM cost tooling market as a five-rung ladder — REPORT, ALERT, RECOMMEND, APPLY, VERIFY — and the honest finding underneath it: no single tool combines code-time static detection with a shadow-verified cheaper-model swap. The capability is still fragmented.
Every major provider now discounts the repeated front of your prompt — but the rates, the defaults, and whether you touch code at all differ by provider. Here is what OpenAI, Gemini, and Anthropic actually offer, the one code change that matters, and when caching quietly costs you money instead of saving it.
Every tool you give an agent ships its full JSON schema and docs as input tokens — on every turn, cached or not. One NAACL 2025 paper cut tool documentation by 70-97%. Here is how to spot the bloat in your code and trim it honestly.
The techniques that actually cut your LLM bill, and an honest comparison of the tool categories that help — observability, gateways and routers, eval platforms, FinOps dashboards, and code-level cost analysis — with where each one fits and what it misses.
"Just use a cheaper model" is the most common LLM cost advice and the most dangerous, because almost nobody verifies it properly. Why a green check on ten examples proves nothing — and how to run a non-inferiority check that holds up.
A verified reference table of LLM API list prices — input, output, and cached-input per 1M tokens — for the current models from OpenAI, Anthropic, Google, xAI, DeepSeek, Mistral, Cohere and more, checked against each provider's own pricing page.
Your LLM bill is not a mystery — it is a handful of code patterns that repeat. The six that drive almost every overspend, how to estimate the damage honestly, and how to prove a fix holds quality before you ship it.
Prompt caching is usually the single biggest LLM cost win — but turning it on changes what input_tokens means, and any code reading that number for a budget, context, or truncation decision can break silently. A real incident, and the fix.
The biggest factor in whether a cheaper model works is not the model — it is the harness around it: the prompt, the examples, the retrieval, the decomposition. That reframes cost right-sizing from a model-picking problem into a re-engineering one.
Third in the series. The cost decision in MetaGPT lives in the example config everyone copies: gpt-4-turbo and ada-002, both legacy. For a framework that runs a simulated team, that default multiplies across every agent.
Second in the series. We pointed erabot at a top autonomous research agent expecting a mess and were mostly wrong — its model tiering is right. The one candidate, and why resolving config is the whole game.
OpenAI's experimental Swarm framework extracts names from a sentence with gpt-4-turbo-preview — a legacy model whose input costs ~65× more than gpt-4o-mini. A one-word fix, and the #1 leak we find.
The cheapest advice in AI cost tooling is "use a smaller model." It is also the most dangerous. Before erabot recommends a model swap, it replays your real inputs through both models and lets a judge decide. On our own audits, it rejected 12 of 31 proposed swaps.
Every AI cost tool on the market operates at runtime — it reports the bill after the code ships. A 2026 review of the category admitted the gap out loud: no tool does code-level, pre-deployment analysis. That gap is the whole product.
Stanford research finds re-sent context accounts for 62% of agent inference bills. That waste does not live in your model choice — it lives in your code, and it compounds on every step of every agent run. Here is where it hides and how to find it.
We pointed erabot’s agentic auditor at the chat path of a widely-used open-source enterprise RAG platform. It read 18 files, cleared two false positives, and surfaced two cross-file cost bugs a line-level linter can’t see: a frontier model doing bulk summarization, and a prompt cache silently busted by message ordering.
How we caught our own circular evaluation, rebuilt the ground truth independently, and engineered detection recall from 0.42 to 0.73 with measurements instead of vibes — including a detection pass we built, measured at P=0.14, and deleted.
We replayed real traffic through model downgrades across five task classes. Blanket "use a cheaper model" advice was wrong for three of them, and on two the cheap model was more expensive. Data inside.
LibreChat, Dify, Flowise, MetaGPT, OpenHands, Onyx and more, run through the erabot agentic audit: 29 root-cause findings, 58 machine-generated patches, and a quality gate that rejected 12 of our own agent's suggestions.
We open-sourced the tree-sitter detector and Typer CLI behind erabot.ai under MIT. Install it with pip, run it locally, read the code on GitHub. Here is what we kept open, what stays closed, and why.
Long context windows from Claude and GPT-4 seem like a superpower — until you see the bill. Learn why context length is the biggest hidden cost driver in AI applications.