Why it matters

Shared KV saves huge memory in chat services. Same system prompt shared across all users.

Advertisement

The architecture

Detect common prefix.

Reference same blocks.

Copy on write when diverges.

Shared KV cacheDetectcommon prefix hashSharesame blocksDivergecopy on writevLLM prefix caching + SGLang RadixAttention; big savings for common system prompts
Shared KV cache.
Advertisement

How it works end to end

Hash prefix; share blocks.

Copy-on-write on divergence.

vLLM prefix caching, SGLang RadixAttention.