Local LLM VRAM & Quantization Calculator
Pick a model size, GGUF quantization, context length and parallel requests — the calculator splits VRAM into weights, KV cache and overhead, recommends real GPUs (RTX 3060 to Mac M4 Max 128 GB) and builds a ready-to-copy llama-server command for Open WebUI.
23.4 GB
Recommended hardware
≈11.2 GB usableDoesn’t fit
≈23 GB usableDoesn’t fit
≈30.8 GB usableFits
≈45.6 GB usableFits
≈48 GB usableFits
≈96 GB usableFits
Doesn’t fit? Lower -ngl to keep some layers in RAM (slower), choose a smaller quant or context, or switch the KV cache to q8_0. Mac: by default the GPU can use about 75% of unified memory; the rest stays with the system.
llama-server command
llama-server -hf unsloth/Qwen3-32B-GGUF:Q4_K_M \
--ctx-size 16384 --parallel 1 \
--n-gpu-layers 99 \
--jinja --host 127.0.0.1 --port 8080
# Open WebUI → Admin Settings → Connections → OpenAI API:
# http://host.docker.internal:8080/v1
# Linux Docker Engine: --host 0.0.0.0 --api-key <KEY> + extra_hosts host-gatewayVRAM needed by popular models (8K context, 1 request, f16 KV)
| Model size | Q4_K_M | Q8_0 | FP16 |
|---|---|---|---|
| 7B Qwen2.5-7B-Instruct | 5.5 GB | 8.8 GB | 15.4 GB |
| 14B Qwen3-14B | 10.5 GB | 16.7 GB | 29.7 GB |
| 32B Qwen3-32B | 21.4 GB | 35.4 GB | 64 GB |
| 70B Llama-3.3-70B-Instruct | 43.4 GB | 73.4 GB | 135.1 GB |
| 120B MoE gpt-oss-120b | 67.6 GB | 117.2 GB | 219.2 GB |
| 405B Llama-3.1-405B-Instruct | 234.5 GB | 407 GB | 761.4 GB |
| 671B MoE DeepSeek-V3.1 / R1 | 381.1 GB | 666.2 GB | 1,252.1 GB |
Weights = parameters × bits per weight / 8 (effective GGUF bpw). KV cache = 2 × layers × KV heads × head dim × bytes × context × parallel requests (compressed MLA cache for DeepSeek). Overhead is an estimate: ≈0.5 GB runtime + compute buffers. Accuracy ±10%; totals in GiB, as reported by nvidia-smi and llama.cpp.
Frequently asked questions
How does the calculator estimate VRAM?
It adds three parts: weights (parameters × effective GGUF bits per weight / 8), KV cache (2 × layers × KV heads × head dim × bytes per element × context × parallel requests) and runtime plus compute-buffer overhead. Architecture constants come from real model configs — Qwen2.5/Qwen3, Llama 3.x, gpt-oss and DeepSeek-V3.
Which quantization should I choose?
Q4_K_M is the best quality-per-GB trade-off for most work; Q5_K_M and Q6_K stay noticeably closer to the original; Q8_0 is near-lossless; IQ3_XS is for squeezing a model that otherwise would not fit, at a quality cost. FP16 is mainly for reference runs and fine-tuning.
What if the model does not fit?
In order of speed: switch the KV cache to q8_0, shorten the context or parallel requests, use a lower quant, keep MoE expert layers in system RAM with --n-cpu-moe, or lower -ngl so some layers run on the CPU. On a Mac, about 75% of unified memory is available to the GPU by default.
Why does context length matter so much?
The KV cache grows linearly with context and parallel requests: Qwen3-32B needs 256 KiB per token in f16, i.e. 8 GiB for 32K tokens. Quantizing the KV cache to q8_0 roughly halves that part with minimal quality loss.
The AI brief engineers actually read
The day’s most important AI stories — models, tools, prices and agents — in five minutes. Free, unsubscribe in one click.