KV cache memory math: why context eats VRAM
Weights are only half the story. Context length multiplies a second memory term.
Fixed vs growing terms
GGUF weights are roughly fixed for a quant. KV cache grows with tokens. Doubling context roughly doubles that term when architecture numbers are fixed.
The formula we publish
kv_GB = kv_bytes_per_token × context / 1e9. Total ≈ (weights + kv) × (1 + overhead). Overhead covers runtime buffers; raise it for multi-batch or multimodal stacks.
Operational habit
Write down the max context you tested with FITS headroom. When a new model arrives, repeat the same context — do not assume the old number ports.
General information, not personalized advice.