Skip to main content
← Lab

kvpaging

confirmedGo · CPUInference & servingJuly 7, 2026

the question

What does paged vs contiguous KV cache actually cost in memory?

what came out

Contiguous reservation wastes ~94% (worse the longer the context), so paging fits 18x-72x more concurrent sequences. Paging's own internal fragmentation is only ~block/2 tokens per sequence. Go, exact accounting, pre-registered.

method & receipts

→ read the code and re-run it

github.com/v-code01/kvpaging