ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

The Hidden Math of LLM Prompt Caching: How to Cut Cloud Token Bills by Up to 90%

If your team is deploying LLM applications to production in 2026—whether for agentic coding, multi-turn RAG, or continuous background summarization—your single largest operational expense is almost certainly input token repetition . Most engineering leaders budget for LLMs using static cost formula

dev.toDienstag 16:49 · 24.11.1 Min. Lesezeit
Bild: dev.to

Posted on Nov 24 • Originally published at modelpricing.xyz

If your team is deploying LLM applications to production in 2026—whether for agentic coding, multi-turn RAG, or continuous background summarization—your single largest operational expense is almost certainly input token repetition.

Most engineering leaders budget for LLMs using static cost formulas: $$\text{Total Cost} = (\text{Input Tokens} \times \text{Input Rate}) + (\text{Output Tokens} \times \text{Output Rate})$$

In modern production architectures, this static model is completely broken. Leading foundation model providers (Anthropic, DeepSeek, and Google) now support KV Prompt Caching, which cuts input token costs by up to 90% on cache hits. However, each provider implements caching economics differently, introducing nuances like minimum threshold sizes, cache write surcharges, and varying time-to-live (TTL) limits.

In this deep dive, we break down the exact mathematics of prompt caching across providers and show how to model your break-even workload using the interactive simulator at ModelPricing.xyz.

Anthropic charges an initial write surcharge (+25%) to serialize the KV state into memory for 5 minutes, but gives an 80% discount on all subsequent cache reads:

$$\text{Effective Rate} = \frac{\text{Cache Write Rate} + (N-1) \times \text{Cache Read Rate}}{N}$$

Rule of thumb: If a cached prompt segment is read at least 2 times within the 5-minute TTL window, you achieve positive ROI over uncached calls.

DeepSeek employs an automated prefix-caching architecture at the infrastructure level with zero user-side breakpoint configuration:

Because DeepSeek does not charge a write penalty, any cache hit yields immediate net savings.

Google supports both implicit caching and explicit context caching for large context windows:

To illustrate the dramatic variance in real-world spending, consider a standardized production workload of 10,000,000 tokens (7,000,000 prompt tokens + 3,000,000 output tokens) with a typical 60% prompt cache hit ratio:

(Live multi-variable figures calculated via ModelPricing.xyz Comparison Engine )

Quelle: dev.to (dev.to). Original öffnen