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

VRAM calculation inputs
Reserve & assumptions

The default 1.5 GiB is a planning allowance, not calibrated by measurements. Buffer and runtime requirements vary; adjust it as needed.

Context is the token space shared by input and output. KV cache uses F16 · 2 bytes per element, independently of weight quantization.

GGUF size approximates weight memory and may differ from actual GPU allocation. Multiple GPUs, CPU offloading, Apple unified memory, training, images and audio are excluded.

Estimated memory · not measured

Llama 3.2 3B Instruct · Q4_K_M · 4,096 tokens

3.82GiB

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.

Calculated · hardware measurements pendingSources checked Operator: kim hyunVerification method

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.

Estimated VRAM at 4K context using official GGUF sizes
ModelQ4_K_MQ5_K_MQ8_0FP16
Llama 3.2 3B Instruct3.824.105.127.93
Qwen3 4B4.50Unavailable6.139.56
Qwen3 8B6.93Unavailable10.3117.33
Qwen2.5 7B Instruct6.086.799.2615.91
Qwen2.5-Coder 7B Instruct6.086.799.2615.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.

Weight quantization changes the weight termQwen3 8B · 4K context · GiB
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.

Qwen3 8B · Q4_K_M · F16 KV · calculated GiB
ContextWeightsKV cacheAllowanceTotal estimate
2K2,048 tokens4.870.281.506.65 GiB
4K4,096 tokens4.870.561.506.93 GiB
8K8,192 tokens4.871.131.507.49 GiB
16K16,384 tokens4.872.251.508.62 GiB
32K32,768 tokens4.874.501.5010.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
Q4_K_M · F16 KV · 1.50 GiB allowance · calculated GiB
Model4K KV32K KV4K total32K total
Llama 3.2 3B Instruct0.443.503.826.88
Qwen3 4B0.564.504.508.44
Qwen3 8B0.564.506.9310.87
Qwen2.5 7B Instruct0.221.756.087.61
Qwen2.5-Coder 7B Instruct0.221.756.087.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
Unmeasured combinations and fields to record
Model / precisionnum_ctxVRAM increaseLargest context testedCPU loadingPrediction error
Llama 3.2 3B InstructQ4_K_M4,096Not measuredNot measuredNot measuredNot measured
Llama 3.2 3B InstructQ4_K_M8,192Not measuredNot measuredNot measuredNot measured
Llama 3.2 3B InstructQ8_04,096Not measuredNot measuredNot measuredNot measured
Llama 3.2 3B InstructQ8_08,192Not measuredNot measuredNot measuredNot measured
Qwen3 4BQ4_K_M4,096Not measuredNot measuredNot measuredNot measured
Qwen3 4BQ4_K_M8,192Not measuredNot measuredNot measuredNot measured
Qwen3 4BQ8_04,096Not measuredNot measuredNot measuredNot measured
Qwen3 4BQ8_08,192Not measuredNot measuredNot measuredNot measured
Qwen3 8BQ4_K_M4,096Not measuredNot measuredNot measuredNot measured
Qwen3 8BQ4_K_M8,192Not measuredNot measuredNot measuredNot measured
Qwen3 8BQ8_04,096Not measuredNot measuredNot measuredNot measured
Qwen3 8BQ8_08,192Not measuredNot measuredNot measuredNot measured
Qwen2.5 7B InstructQ4_K_M4,096Not measuredNot measuredNot measuredNot measured
Qwen2.5 7B InstructQ4_K_M8,192Not measuredNot measuredNot measuredNot measured
Qwen2.5 7B InstructQ8_04,096Not measuredNot measuredNot measuredNot measured
Qwen2.5 7B InstructQ8_08,192Not measuredNot measuredNot measuredNot measured
Qwen2.5-Coder 7B InstructQ4_K_M4,096Not measuredNot measuredNot measuredNot measured
Qwen2.5-Coder 7B InstructQ4_K_M8,192Not measuredNot measuredNot measuredNot measured
Qwen2.5-Coder 7B InstructQ8_04,096Not measuredNot measuredNot measuredNot measured
Qwen2.5-Coder 7B InstructQ8_08,192Not measuredNot measuredNot measuredNot 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.

Model structures and artifact sources

Llama 3.2 3B Instruct

28 layers · 8 KV heads · head dimension 128

Model card ↗ · Structure source ↗

Qwen3 4B

36 layers · 8 KV heads · head dimension 128

Model card ↗ · Structure source ↗

Qwen3 8B

36 layers · 8 KV heads · head dimension 128

Model card ↗ · Structure source ↗

Qwen2.5 7B Instruct

28 layers · 4 KV heads · head dimension 128

Model card ↗ · Structure source ↗

Qwen2.5-Coder 7B Instruct

28 layers · 4 KV heads · head dimension 128

Model card ↗ · Structure source ↗

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.