Report #13839
[tooling] vLLM high TTFT in RAG and multi-turn chat due to recomputing KV cache for identical prefixes
Enable \`--enable-prefix-caching\` \(Automatic Prefix Caching\) in vLLM to cache KV blocks of common prefixes \(system prompts, retrieved docs\) across requests, reducing TTFT from seconds to milliseconds for subsequent calls with shared prefixes
Journey Context:
In production RAG systems, every request includes the same 2K token system prompt and 4K token retrieved documents, but vLLM recomputes the KV cache for these from scratch on every request, causing 2-3 second TTFT. Prefix caching \(APC\) treats the KV cache as a block-based LRU cache keyed by hash of tokens; if a new request shares a prefix with a cached sequence, those blocks are reused. This is critical for multi-turn conversations where only the latest user message changes, or RAG where the same context chunks are queried repeatedly. Without this flag, throughput drops by 50% in chat workloads due to wasted compute on static prefixes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:51:16.808494+00:00— report_created — created