Learn · KV cache

KV cache

Practical guides on LLM inference and KV caching.

KV cache

PagedAttention Explained: How Paged Attention Stores the KV Cache in Blocks

Learn how PagedAttention stores the KV cache in fixed-size blocks, how block tables and copy-on-write cut waste, and why it makes KV cache reuse practical.

11 min read

KV cache

Prompt Caching: How It Works, From API Providers to Your Own GPUs

What prompt caching is, how KV cache prefix reuse works, how OpenAI, Anthropic, Gemini, and Bedrock handle it, and how to run it on your own GPUs.

17 min read

KV cache

What Is LMCache?

What LMCache is, how it stores and reuses KV cache across CPU memory, disk and remote storage with vLLM, and what changes when you run it in production.

11 min read

KV cache

Semantic Caching: How It Works, and Where It Stops

Learn how semantic caching reuses answers by meaning, where its similarity threshold breaks down, and why it stacks with a KV cache instead of replacing it.

13 min read

KV cache

How to Calculate KV Cache Size: A Step-by-Step Sizing Method

Size KV cache memory from your model's config.json: the full formula, worked on Qwen3, Mistral, and gpt-oss, plus the mistakes that make the answer wrong by 2x.

10 min read

KV cache

KV Cache Quantization: FP8, FP4, and What They Cost You

How FP8 and FP4 KV cache quantization trade memory for accuracy, with the flags, calibration paths, and backend limits compared across vLLM, SGLang, and TensorR

9 min read

KV cache

KV Cache and Attention: The Mechanics Explained

Naive autoregressive decoding recomputes work for earlier tokens at every step. Learn how a KV cache removes that redundancy and what it costs in memory.

3 min read

KV cache

KV Cache Memory: Which Lever to Pull, and When

Eviction, fragmentation, offload tiers and reuse are the four ways to control KV cache memory. Here is what each one actually costs and which workload it fits.

12 min read

KV cache

LLM-Based Chunking: What It Is & How It Works

LLM-based chunking uses a language model to split text at semantic boundaries. See how it works and when it beats fixed-size chunking.

4 min read