KV
PromptCache ROI
// FINOPS & GPU ARCHITECTURE

Understanding LLM Prompt Caching Economics & KV Cache Architecture

In traditional Large Language Model (LLM) serving, every user query triggers a resource-intensive "prefill phase". The serving engine (such as vLLM, SGLang, TensorRT-LLM, or proprietary provider runtimes) must perform matrix multiplications across every attention layer to compute the Key and Value (KV) activation tensors for every token in the prompt. For long-context applications—such as Retrieval-Augmented Generation (RAG), autonomous coding agents, and complex JSON schema definitions—the prefill phase dominates both GPU utilization and API bills.

How Prompt Caching Works Under the Hood

Prompt caching allows the inference cluster to store the computed KV cache tensors in high-speed GPU High Bandwidth Memory (HBM) or host DRAM across consecutive requests. When an incoming request shares an identical prefix with a cached prompt, the serving engine skips the compute-heavy prefill phase entirely and begins autoregressive token generation immediately.

Frontier Provider Pricing Models Explained

1. Anthropic Claude (5-Min 1.25x & 1-Hr 2.0x Explicit Cache TTL)

Anthropic implements deliberate checkpoint caching (`cache_control`). On the standard 5-minute TTL, writing to the cache costs 1.25x the base input price ($3.75/MTok on Sonnet, $1.00/MTok on Haiku), while extended 1-hour TTL writes cost 2.0x ($6.00/MTok on Sonnet). Subsequent requests hitting the cache receive a massive 90% discount ($0.30/MTok on Sonnet, $0.08/MTok on Haiku). Minimum cacheable prefix length is 1,024 tokens on Claude Sonnet and 2,048 tokens on Claude 3.5 Haiku.

2. OpenAI GPT-4.1 & GPT-4o (Automatic Prefix Caching)

OpenAI applies automatic prefix caching in 128-token increments once a prompt exceeds 1,024 tokens, with $0 cache write surcharge. On GPT-4.1, cached prefix tokens receive a 75% discount ($0.50/MTok vs $2.00/MTok base). On GPT-4o and GPT-4o-mini, cached tokens receive a flat 50% discount ($1.25/MTok and $0.075/MTok).

3. DeepSeek-V3 & R1 (Native Multi-Head Latent Attention)

Thanks to its Multi-head Latent Attention (MLA) architecture, DeepSeek compresses KV cache tensors by up to 93%, enabling automatic on-disk and DRAM prefix caching in 64-token blocks with zero write surcharge. Standard DeepSeek-V3 charges $0.07/MTok on cache hits vs $0.27/MTok on misses (74.1% off), while DeepSeek-R1 charges $0.14/MTok on hits vs $0.55/MTok on misses (74.5% off).

4. Google Gemini 2.0 Flash (Explicit Hourly Storage vs. Implicit Caching)

Google Gemini 2.0 Flash ($0.10/MTok base input, $0.40/MTok output) offers a 75% cache read discount ($0.025/MTok). When using Explicit Context Caching (minimum 4,096 tokens) to guarantee TTL persistence, Google bills an hourly storage fee of $1.00 per Million Tokens per Hour. When using Implicit Caching, storage fees are $0.

The Generalized Break-Even Hit Rate Formula

When evaluating providers with cache write surcharges (such as Anthropic's 1.25x or 2.0x write multiplier) or hourly context storage fees (such as Gemini's $1.00/MTok/hr), FinOps teams calculate the minimum required cache hit rate Hbreak-even as:

Hbreak-even = [ (Pwrite - Pbase) + (Coststorage / Volumestatic_MTok) ] / (Pwrite - Pread)

For Claude 3.7 / 3.5 Sonnet on a 5-minute TTL ($0 storage fee), (3.75 - 3.00) / (3.75 - 0.30) = 0.75 / 3.45 ā‰ˆ 21.7%. Any workflow with a cache hit rate above 21.7% yields compounding cost savings.