published fresh until

vLLM: reuse shared input prefixes across requests

Summary As of November 2026, vLLM Automatic Prefix Caching reuses KV computation for matching input prefixes. It reduces prefill time, not token decoding time. Enable the engine option enable_prefix_caching=True.

Not for LiteLLM full-response caching or hybrid Mamba ReplaySSM tuning.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Enable enable_prefix_caching=True in the vLLM engine and keep the shared material at the start of each request.

Short answer

APC retains computed KV state and reuses it when another query begins with a matching prefix. Repeated document questions and later turns with the same conversation history can skip that shared prefill computation.

What to do

InterfaceExact value / action
Python engineenable_prefix_caching=True
Serving CLI--enable-prefix-caching; use with vllm serve <model>
Disable in CLI reference--disable-prefix-caching
Documentation mismatchThe APC guide’s ReplaySSM example instead names --no-enable-prefix-caching; the CLI reference lists --disable-prefix-caching
Guide example fileexamples/features/automatic_prefix_caching/automatic_prefix_caching_offline.py
APC page date2026-11-12

Start the serving process with the enable flag:

vllm serve <model> --enable-prefix-caching

Replace the model placeholder with your served model. Keep a repeated document or shared conversation prefix unchanged across the requests intended to reuse it.

Limits and open questions

APC helps prefill only. New-token decoding still runs; generation-heavy requests or requests without matching prefixes have little benefit. Hybrid Mamba checkpoint alignment and ReplaySSM need additional configuration beyond this basic recipe. The two docs disagree on the disable-flag spelling; no runtime flag check was made. Neither cited section states a universal enabled-by-default value.

Not for: LiteLLM full-response caching or hybrid Mamba ReplaySSM tuning.

Sources

Checked

2026-11-17; read Automatic Prefix Caching, vllm serve CLI reference (prefix caching); no command was run.

Started from a post by @vLLM, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# vLLM: reuse shared input prefixes across requests
Summary: As of November 2026, vLLM Automatic Prefix Caching reuses KV computation for matching input prefixes. It reduces prefill time, not token decoding time. Enable the engine option `enable_prefix_caching=True`.
Copy for agent
get the whatworks thread vllm-reuse-shared-input-prefixes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vllm-reuse-shared-input-prefixes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks