Local LLM VRAM Calculator
Estimate memory by model, quantization and context. F16 KV cache; not yet measured on hardware.
Calculation inputs
F16 KV cache · GiB
Estimated memory · not measured
Llama 3.2 3B Instruct · Q4_K_M · 4,096 tokens
Comparison VRAM tier8 GiB
The first listed tier (8·12·16·24·32·48·64·80 GiB) at or above the estimate. This does not mean a smaller GPU cannot run the model.
- Weights approximation
- 1.88 GiB
- F16 KV cache
- 0.44 GiB
- Reserve
- 1.50 GiB
Calculated estimate · memory used by other apps is separate.
One NVIDIA GPU, full GPU loading and one concurrent request. Successful execution and speed are not guaranteed.
Estimated VRAM by model and quantization
Fixed example: 4,096 tokens, F16 KV and a 1.5 GiB reserve. This table keeps these assumptions independently of the calculator inputs. Values are GiB estimates, not measurements.
| Model | Q4_K_M | Q5_K_M | Q8_0 | FP16 |
|---|---|---|---|---|
| Llama 3.2 3B Instruct | 3.82 | 4.10 | 5.12 | 7.93 |
| Qwen3 4B | 4.50 | Unavailable | 6.13 | 9.56 |
| Qwen3 8B | 6.93 | Unavailable | 10.31 | 17.33 |
| Qwen2.5 7B Instruct | 6.08 | 6.79 | 9.26 | 15.91 |
| Qwen2.5-Coder 7B Instruct | 6.08 | 6.79 | 9.26 | 15.91 |
Unavailable means the exact tag was not found in the checked Ollama library. It does not establish that no other distributor offers it. Missing file sizes are not estimated.
NANOBOOK ANALYSIS · CALCULATED, NOT MEASURED
What changes VRAM: model, quantization or context?
For Qwen3 8B, Q4_K_M at 4K context totals 6.93 GiB in this calculation. Q8_0 raises it to 10.31 GiB; keeping Q4_K_M and extending context to 32K raises it to 10.87 GiB. The causes are different: weight size versus KV cache.
Fixed examples, independent of the inputs above. Single NVIDIA GPU · full GPU loading · one sequence · F16 KV · 1.50 GiB uncalibrated planning allowance. 4K = 4,096 tokens; 32K = 32,768. All totals are estimates, with no model execution or GPU measurement.
- Q4_K_M
- 6.93
- Weights 4.87 + KV 0.56 + allowance 1.50
- Q8_0
- 10.31
- Weights 8.24 + KV 0.56 + allowance 1.50
- FP16
- 17.33
- Weights 15.26 + KV 0.56 + allowance 1.50
Dark segment: GGUF weight proxy. Light segment: KV plus planning allowance.
Smaller weights do not shrink the F16 cache
Switching Q8_0 to Q4_K_M reduces this total by 3.38 GiB (32.8%), entirely through the weight term. The F16 KV cache stays at 0.56 GiB for both.
Qwen3 has no verified Q5_K_M tag in this dataset. Missing file sizes stay unavailable. These memory comparisons do not establish equivalent output quality or speed.
Longer context grows KV, not the weight file
For the same Q4_K_M artifact, 4K → 32K makes KV eight times larger: 0.56 → 4.50 GiB. Total memory rises by 3.94 GiB, from 6.93 to 10.87 GiB. The fixed weights and allowance keep the total from growing eightfold.
| Context | Weights | KV cache | Allowance | Total estimate |
|---|---|---|---|---|
| 2K2,048 tokens | 4.87 | 0.28 | 1.50 | 6.65 GiB |
| 4K4,096 tokens | 4.87 | 0.56 | 1.50 | 6.93 GiB |
| 8K8,192 tokens | 4.87 | 1.13 | 1.50 | 7.49 GiB |
| 16K16,384 tokens | 4.87 | 2.25 | 1.50 | 8.62 GiB |
| 32K32,768 tokens | 4.87 | 4.50 | 1.50 | 10.87 GiB |
A smaller model can have the same KV cache
Qwen3 4B and Qwen3 8B both use 36 layers, 8 KV heads and head dimension 128. Their F16 KV estimates are identical: 0.56 GiB at 4K and 4.50 GiB at 32K. Their Q4_K_M 4K totals differ (4.50 versus 6.93 GiB) because their weight files differ.
Parameter counts alone do not determine KV memory. This compares memory structure, not model capabilities.
Compare all five models at 4K and 32K
| Model | 4K KV | 32K KV | 4K total | 32K total |
|---|---|---|---|---|
| Llama 3.2 3B Instruct | 0.44 | 3.50 | 3.82 | 6.88 |
| Qwen3 4B | 0.56 | 4.50 | 4.50 | 8.44 |
| Qwen3 8B | 0.56 | 4.50 | 6.93 | 10.87 |
| Qwen2.5 7B Instruct | 0.22 | 1.75 | 6.08 | 7.61 |
| Qwen2.5-Coder 7B Instruct | 0.22 | 1.75 | 6.08 | 7.61 |
All five use structures within the calculator’s supported full-attention scope. Different architectures outside this set need different formulas. Similar memory estimates do not imply equivalent quality.
Method and limits of these calculations
We reuse the calculator’s exact artifact bytes and model structure. Total = GGUF bytes + F16 KV bytes + allowance bytes; 1 GiB = 1,073,741,824 bytes. F16 KV bytes = 2 × layers × KV heads × head dimension × context tokens × 2. The first factor of two stores K and V. All comparisons use the same one-sequence assumption.
Changing context only changes the KV term in this model. Actual runtime buffers can also change with context, batching, backend and Flash Attention. The constant 1.50 GiB allowance is uncalibrated and does not capture those variations. GGUF disk bytes are a proxy for weights, not a measurement of GPU allocation.
We exclude CPU offload, multiple GPUs, concurrent sequences, training, multimodal inputs, sliding-window/hybrid attention, MLA and other applications. Lower-precision KV is not modeled. Weight Q8_0 does not mean Q8_0 KV: the cache remains F16.
Calculated totals are not measured peak VRAM, a proven GPU fit, a hardware recommendation or a performance/quality result. Values are calculated in bytes; displayed GiB are rounded only at the end. CSV totals retain nine GiB decimals. Unavailable exact Ollama tags have blank numeric results, never zero.
Analysis checked . The calculator’s model snapshot is dated 2026-11-04; its artifact manifests and structure sources were rechecked for this analysis. Sources: Qwen3 8B config, Qwen3 4B config, Q4_K_M manifest, Q8_0 manifest, Ollama context and F16 KV settings. Other model sources are listed below.
Download 100 combinations (CSV) ↓90 calculated combinations; 10 unavailable exact-tag combinations. Five models × four weight formats × five contexts. Includes weight/KV/allowance bytes, source URLs and artifact digests.
Hardware measurements 0 records
Program and model downloads are on hold, so hardware measurements have not been taken. Empty cells are not filled with estimates.
- Prepared environment · GPU
- NVIDIA GeForce RTX 4070 Ti · 12,282 MiB
- CPU / RAM
- AMD Ryzen 9 7900X / 62.88 GiB
- OS / driver
- Windows 11 Pro 10.0.26200 / NVIDIA 617.42
- Ollama / measurement date
- Version unverified / not measured
- Planned conditions
- num_ctx 4,096·8,192 / F16 KV / one concurrent request / record whether Flash Attention is actually enabled
View planned Q4_K_M·Q8_0 × 4K·8K measurements
| Model / precision | num_ctx | VRAM increase | Largest context tested | CPU loading | Prediction error |
|---|---|---|---|---|---|
| Llama 3.2 3B InstructQ4_K_M | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Llama 3.2 3B InstructQ4_K_M | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Llama 3.2 3B InstructQ8_0 | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Llama 3.2 3B InstructQ8_0 | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 4BQ4_K_M | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 4BQ4_K_M | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 4BQ8_0 | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 4BQ8_0 | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 8BQ4_K_M | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 8BQ4_K_M | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 8BQ8_0 | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen3 8BQ8_0 | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5 7B InstructQ4_K_M | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5 7B InstructQ4_K_M | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5 7B InstructQ8_0 | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5 7B InstructQ8_0 | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5-Coder 7B InstructQ4_K_M | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5-Coder 7B InstructQ4_K_M | 8,192 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5-Coder 7B InstructQ8_0 | 4,096 | Not measured | Not measured | Not measured | Not measured |
| Qwen2.5-Coder 7B InstructQ8_0 | 8,192 | Not measured | Not measured | Not measured | Not measured |
First record baseline VRAM with all models unloaded. With the same model artifact and settings, record actual input/output tokens and subtract the baseline from the highest nvidia-smi sample during loading, prompt processing and generation. Record sampling interval, repetitions, Ollama version, Flash Attention and GPU/CPU placement logs. Results describe the tested hardware and range, not an absolute peak across all environments.
How is required VRAM calculated?
This version covers standard Dense/GQA text models fully loaded onto one NVIDIA GPU. It approximates weight memory with the GGUF file size, then adds KV cache and the selected runtime reserve. File metadata, alignment and runtime buffers mean disk size and GPU allocation need not match exactly. The reserve is a planning assumption, not a measured constant.
F16 KV cache = 2 × layers × KV heads × head dimension × context tokens × 2 bytes
The first 2 accounts for K and V storage. Context includes both input and output tokens. Doubling context doubles KV cache under this formula. GQA shares KV heads across query heads, so use KV heads, not total attention heads. Where head_dim is explicitly specified, as in Qwen3, use that value rather than deriving it from hidden_size.
Weight quantization and cache precision are separate. This tool fixes KV cache at F16. Quantizing the cache can reduce memory, but block scales, alignment and quality effects prevent an exact estimate from nominal bits alone. Q4_K_M weights also include scale data and tensors at different precisions, so their file size is not simply parameter count multiplied by 4 bits.
Sliding-window models such as Gemma 3 may use less cache than full-context storage, depending on layer layout and runtime allocation. However, llama.cpp also has a full-size SWA cache option, so savings cannot be assumed. MLA, linear attention, hybrid architectures, multiple GPUs, images and audio are outside this formula's scope.
For MoE originals such as DeepSeek-V3 and R1, active parameters per token do not determine the memory needed to load all weights. Consider total weights and placement. llama.cpp can keep some expert weights on the CPU. DeepSeek-R1-Distill models, by contrast, are standard Dense models. Offloading and throughput are separate questions; this estimate does not predict execution speed.
Sources & verification scope
Sources checked on 2026-11-04. Five variants were selected from text model families in Ollama's popularity-sorted library whose public artifacts and structures could be checked. This is not a ranking of the current top five models. Qwen structure comes from official config.json files; Llama 3.2 structure comes from GGUF metadata published by Ollama. Meta's original config could not be read directly because login was required.
- Ollama: context and GPU loading ↗
- Ollama: KV cache, Flash Attention and parallel requests ↗
- llama.cpp: loading, cache and SWA options ↗
- llama.cpp: quantization formats and mixed tensors ↗
- DeepSeek-R1: original and Dense Distill models ↗
- Official Ollama library · sorted by popularity ↗
Model structures and artifact sources
Llama 3.2 3B Instruct
28 layers · 8 KV heads · head dimension 128
Model card ↗ · Structure source ↗
- Q4_K_M · 2,019,377,376 bytes ↗sha256:dde5aa3fc5ffc17176b5e8bdc82f587b24b2678c6c66101bf7da77af9f7ccdff
- Q5_K_M · 2,322,153,696 bytes ↗sha256:05fc42664a9311c427413f9bf2077bd5ee7d59d6a5a034d54fc738f93976d065
- Q8_0 · 3,421,898,976 bytes ↗sha256:ed5cd7dbde6e2b5fb2d9926857ecf0f73ae3509ac1efd119ee54584d7a724688
- FP16 · 6,433,687,776 bytes ↗sha256:e2f46f5b501c2982b2c495a4694cb4e620aabfa2c37ebb23a90ffc8cce93854b
Qwen3 4B
36 layers · 8 KV heads · head dimension 128
Model card ↗ · Structure source ↗
- Q4_K_M · 2,620,774,592 bytes ↗sha256:163553aea1b1de62de7c5eb2ef5afb756b4b3133308d9ae7e42e951d8d696ef5
- Q5_K_M · Unavailable ↗
- Q8_0 · 4,368,878,272 bytes ↗sha256:fb684cd1056921c526f12a9efbad10c4627e151ecc1e28314fae1c2cce0c2c15
- FP16 · 8,051,284,672 bytes ↗sha256:35aaf83f8d88ab8d6eb8b95d254f98ff94ded91078ca229b56aadd97d8543aae
Qwen3 8B
36 layers · 8 KV heads · head dimension 128
Model card ↗ · Structure source ↗
- Q4_K_M · 5,225,374,496 bytes ↗sha256:a3de86cd1c132c822487ededd47a324c50491393e6565cd14bafa40d0b8e686f
- Q5_K_M · Unavailable ↗
- Q8_0 · 8,851,075,872 bytes ↗sha256:d87f4a5a2f1a6051d9fac010c12f76f3ba2137b137d413ba8f4d3a3d06b3a25b
- FP16 · 16,388,043,552 bytes ↗sha256:8a571487237a265daf6eda5a266db146b79b6765bd81e6b284a0aa524578a521
Qwen2.5 7B Instruct
28 layers · 4 KV heads · head dimension 128
Model card ↗ · Structure source ↗
- Q4_K_M · 4,683,073,952 bytes ↗sha256:2bada8a7450677000f678be90653b85d364de7db25eb5ea54136ada5f3933730
- Q5_K_M · 5,444,831,648 bytes ↗sha256:55b396c9f9301cce13e5e0d9a9b3fc541e09db28d533fc9524460caaaf991887
- Q8_0 · 8,098,525,600 bytes ↗sha256:3603045b543e1c0dfb27f126a3642e7f805e480b84c4781e3d848ace971cba7a
- FP16 · 15,237,853,600 bytes ↗sha256:678e1e0883636c4234928f23fd208337f790456121124a1986cbf1b806baeadb
Qwen2.5-Coder 7B Instruct
28 layers · 4 KV heads · head dimension 128
Model card ↗ · Structure source ↗
- Q4_K_M · 4,683,074,048 bytes ↗sha256:60e05f2100071479f596b964f89f510f057ce397ea22f2833a0cfe029bfc2463
- Q5_K_M · 5,444,831,744 bytes ↗sha256:52476f59a3cf8b77b96872a0ba56b62c528591af0068c79dde8d23394e88a315
- Q8_0 · 8,098,525,696 bytes ↗sha256:24b532e5276503b147d0eea0e47cb1d2bcce7c9034edd657b624261862ca54a1
- FP16 · 15,237,853,696 bytes ↗sha256:d8e374f171cbf20a79619dc6e0926124c7690497609bc94bdad18ef6a86cdee0
Calculated estimates, official artifact data and measurements are distinguished. Untested hardware and models are never presented as measured. Not measured means no execution record; unavailable means no verified distribution tag; unsupported means the architecture is outside the calculation scope.
Revision history
2026-11-05 · Added model, weight-quantization and context sensitivity analysis with a 100-combination CSV. Calculated estimates only; no model execution. Existing dataset and calculator formula unchanged.
2026-11-04 · Opened to search indexing while retaining estimate and unmeasured labels. No sitemap is provided.
2026-11-04 · Shortened the introduction and simplified mobile inputs and results. Calculation logic, data and the then-current search restrictions were retained.
· Switched to a Korean VRAM calculator with official file sizes and model structures. Measurements and search launch were on hold at that stage.