KV Cache Calculator
This calculator estimates how much GPU memory you need to serve a large language model. It accounts for model weights, the KV cache (the part most people under-budget), activation/runtime overhead, and the nominal memory capacity of common current and announced accelerators. GPU presets compare memory only; they do not validate framework, precision, interconnect, or sharding support, and Preview capacities can change.
It’s intended to pair with the KV Cache blog post
. All math runs in your browser — nothing is sent to a server. Paste a Hugging Face model id (e.g. Qwen/Qwen2.5-7B-Instruct) to auto-fill the architecture from the model’s config.json — only metadata is fetched, never weights — or pick a curated preset, then tweak any field in Advanced options to override.
Mixed-precision models are handled generally, not per-model: any repo’s quantization_config is classified by its quant_method (the same field the Transformers library dispatches on), covering openai/gpt-oss-120b-style MXFP4 experts, compressed-tensors checkpoints like unsloth/Kimi-K3 (MXFP4) and moonshotai/Kimi-K2.5 (INT4 + group scales, declared only inside text_config), DeepSeek-style FP8, and a cautious generic fallback for methods the tool doesn’t fully model. Weights are split into quantized and full-precision shares (group-scale overhead included), shown both as resident VRAM and checkpoint size on disk — these differ when a runtime dequantizes on load, and the Quantized format (in-memory) option lets you model exactly that (native MXFP4, MXFP8, or dequantized BF16).
Composite architectures are sized per layer group: layer_types drives sliding-vs-full attention counts (gpt-oss caches 128-token windows on half its layers and full context on the rest), and MLA + linear-attention hybrids like Kimi-K3 bill growing KV only for the full-attention layers while adding the O(1) per-sequence recurrent state (KDA/DeltaNet/Mamba, derived from config geometry) for the rest. For exact numbers, hit Deep inspect next to the Load button after loading a repo — it reads each shard’s safetensors header over HTTP Range requests (slower, one small request per shard) for per-tensor dtypes and true payload bytes, still never weights.
| Model weights (resident in VRAM) | |
|---|---|
| Checkpoint size on disk | |
| KV cache (per token) | |
| KV cache (total) | |
| Activations + runtime overhead | |
| Total VRAM required | |
| Available VRAM | |
| Headroom |