What is it?
LLM bills grow with the amount of text processed and the size of the model used. Most savings come from not sending unnecessary text, not using a premium model where a cheap one suffices, and reusing work that has already been done.
Also known as: reduce LLM costs, token cost optimization, LLM pricing, cheaper LLM calls, model routing, FrugalGPT, batch API, cost per token.
Technical definition
Techniques: prompt compaction and retrieval of only relevant context, output length limits, structured outputs to avoid verbose prose, model cascades/routers (FrugalGPT, Chen et al., 2023), Prompt Caching, batch/offline endpoints where offered, response caching for repeated queries, Thinking Budgets and Reasoning Effort for reasoning models, retries with backoff and caps, distillation (Knowledge Distillation) and quantised self-hosting (Quantization of AI Models). Evaluate quality at each step (How to Evaluate AI Systems and Outputs). Prices and discounts vary by provider and change; always compute with current price lists.
Entity type: technique · Freshness class: volatile.
When should I use it?
Apply once usage is meaningful or costs are unpredictable.
Implementation patterns
- Cost per successful task as the KPI.
- Cascade: cheap model → escalate on low confidence.
- Trim context via retrieval and summarisation.
- Cache deterministic repeated queries.
- Set per-user and per-request budgets.
Technologies and frameworks
Commonly associated: model routers/gateways, provider batch APIs, caching layers, vLLM. Names are examples of what exists, not recommendations, and projects change quickly.
Practical guide
- Instrument tokens and cost per feature.
- Find the top spenders.
- Apply cheapest fix first (trim prompts, cache).
- Test model downgrades on evals.
- Set alerts and budgets.
Common failure modes
- Optimising cost without quality checks.
- Retry storms multiplying spend.
- Ignoring output and reasoning tokens.
- Forecasting with average rather than tail usage.
Troubleshooting
- Bills spike — Inspect traces for retries, long contexts and runaway agents; add budgets.
- Quality drops after switching models — Evaluate on your set before rollout; route only safe cases.
Contrasted with
- Local AI vs Cloud AI: Privacy, Cost, Capability — Self-hosting changes the cost structure from per-token to fixed.
Questions this page answers
- How do I reduce LLM API costs?
- How do I estimate the cost of an LLM app?
- What is model routing?
- Is self-hosting cheaper than using an API?
- How can I cut token usage?
Typical goals: lower AI app spend; forecast LLM costs.
Sources and verification
Status: not independently verified. This entry was authored on 2026-10-06 from general technical knowledge, without live checking of the sources below. Treat every source as a lead to confirm (identifier, title, authorship, current version) before publication or citation.
Freshness class: volatile — Products, versions, protocols, benchmarks, leaderboards, regulations and dates. Verify against the primary source before relying on specifics; re-review every 3 months.
Time-sensitive claims to verify before relying on them:
- All prices, discounts and feature availability.
Canonical sources (unverified leads):
- Chen et al., FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance (2023) — arXiv:2305.05176
- Provider pricing pages (check current) — locator to be identified