> ## Content Index
> Fetch the complete content index at: https://www.anup.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# TIL: Six ways to cut LLM costs
- URL: https://www.anup.io/til-six-ways-to-cut-llm-costs/
- Published: 2026-11-04T15:30:47.000Z
- Updated: 2026-11-04T15:31:58.000Z
- Author: Anup Jadhav
- Tags: #til, #section-til, LLM, Agentic Architecture

1. **Prompt caching.** Put stable instructions, examples and tool schemas before changing inputs. An identical prefix can reuse earlier computation; the model still generates a fresh answer. Measure cache hits and account for cache-write costs. [Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/prompt-caching?ref=anup.io)
2. **Model routing.** Send each task to the cheapest model that passes your evals. Use a larger model where it earns its cost. Include the router and fallback calls when measuring savings.
3. **Batch API.** Move work that can wait, such as overnight extraction or offline evals, to an asynchronous batch API. Providers such as Anthropic discount these requests. You are trading response time for price. [Claude Platform Docs](https://platform.claude.com/docs/en/build-with-claude/batch-processing?ref=anup.io)
4. **Semantic caching.** Reuse a stored answer when a new query has equivalent meaning and relevant context. A valid hit skips generation. Similar wording alone is insufficient: enforce access boundaries and invalidate stale answers. [Docs](https://redis.io/docs/latest/develop/use-cases/semantic-cache/?ref=anup.io)
5. **Trim context.** Remove irrelevant retrieved chunks and bulky old tool results. Preserve task constraints, decisions and current state. Run evals after trimming, and watch for lost prompt-cache hits when you change the prefix.
6. **Smaller models.** Choose a smaller model that meets the quality bar, or train one through distillation. Quantisation is different: it reduces numerical precision, not parameter count. For self-hosting, benchmark memory, throughput and quality on your actual hardware. [Hugging Face](https://huggingface.co/docs/transformers/main/tasks/knowledge%5Fdistillation%5Ffor%5Fimage%5Fclassification?ref=anup.io)

**Measure cost per accepted result.** Count inference, routing, cache infrastructure, retries and human checking. Keep quality and latency visible alongside the bill.