Calculate the required GPU VRAM for large language models based on model parameters, quantization bits, and context length.
Total GPU VRAM combines model weights (plus ~5% quantization metadata overhead), KV-cache memory scaled by context length, and ~0.5 GB CUDA/runtime overhead:
Total VRAM (GB) = (Parameters_B × Bits ÷ 8 × 1.05) + (Parameters_B × Context ÷ 4096 × 0.25) + 0.5
Model Parameters: 8B, Quantization: Q4 (4-bit), Context Length: 8192 → 5.20 GB VRAM (fits an 8 GB GPU)
Model Parameters: 32B, Quantization: Q4 (4-bit), Context Length: 8192 → 18.90 GB VRAM (fits a 24 GB RTX 3090/4090)
Model Parameters: 70B, Quantization: Q4 (4-bit), Context Length: 8192 → 40.75 GB VRAM (fits dual 24 GB GPUs or 48 GB workstation card)