Local LLM GPU VRAM, KV-Cache & Quantization Sizing
Calculate exact model weights, GQA KV-cache growth, CUDA overhead, hardware fit, and memory-bandwidth tok/s across NVIDIA GPUs and Apple Silicon.
Total VRAM required
0 GB
Weights + KV + Overhead
KV-Cache footprint
0 GB
0 KB / token
Smallest fitting hardware
—
~0 tok/s decode
VRAM composition vs hardware capacity (GiB)
| Hardware profile | Class | Usable VRAM | Utilization | Est. decode | Fit status |
|---|
Mathematical model and engineering assumptions
Weight & KV-Cache memory equations
KV_GiB = (2 * L * H_kv * D_head * B_kv * Ctx * B_seq) / 1024^3
Total_GiB = Weights_GiB + KV_GiB + (0.8 + 0.06 * Weights_GiB + 0.04 * B_seq)
Where L is layer count, H_kv is Grouped-Query Attention KV head count, D_head is head dimension (128), B_kv is KV byte width, and B_seq is concurrent sequences.
Memory-bandwidth decode throughput
Real-world vLLM and llama.cpp kernels sustain ~65%–78% of theoretical HBM/unified memory bandwidth during decode. Multi-GPU tensor parallelism scales bandwidth with an 0.82 interconnect efficiency factor.
Engineering FAQ
Why does KV-Cache grow so fast with 32K–128K context and concurrency?
Every active sequence allocates Key and Value tensors across every transformer layer for every token in context. Even with Grouped-Query Attention (GQA), running 16 concurrent 64K sequences on a 70B model can consume over 40 GiB in KV cache alone unless FP8 KV quantization is enabled.
How does MoE (Mixture-of-Experts) affect VRAM vs decode speed?
MoE models like Llama 4 Scout 109B or DeepSeek V4.1 Flash 552B must hold all parameters in VRAM, so memory capacity is governed by total parameters. However, token generation only reads the active parameters (17B or 32B) per forward pass, yielding significantly higher decode tok/s on memory-bandwidth-bound GPUs.
Why is Apple Silicon usable VRAM lower than total unified memory?
macOS reserves approximately 25% of unified RAM for the OS kernel and window server by default (configurable via iogpu.wired_limit_mb). A 64GB M4 Max exposes roughly 48GB safely to Metal inference engines like llama.cpp and MLX.
How is the estimated decode tok/s calculated?
Autoregressive decoding at low batch sizes is memory-bandwidth bound. We estimate single-stream throughput using 72% of peak GPU HBM/unified memory bandwidth divided by active model weights plus per-sequence KV-cache reads.
Related infrastructure simulators
LLM API & Prompt Caching Cost Simulator
Compare OpenAI, Anthropic, Gemini, DeepSeek, xAI, and Qwen monthly spend with prompt cache hit rates, reasoning multipliers, and batch discounts.
Self-Hosted GPU vs Managed API Break-Even
Find the exact daily token volume where renting dedicated B200, H200, H100, or L40S instances beats per-token managed APIs.
Cloud Object Storage & Egress Comparator
Quantify the hyperscaler bandwidth cliff across Cloudflare R2, Backblaze B2, AWS S3 + CloudFront, and Google Cloud Storage.