Specific file. Explicit assumptions.

GGUF VRAM
calculator.

A GGUF filename is not a memory budget. Read the actual tensor types, choose GPU layers and context, and keep calculated payload separate from runtime overhead and measured results.

No file selected

Read locally in your browser. No file upload, model-weight download, or account needed. Reads at most 25 MiB of metadata.

0 keeps weights on CPU; 25 places all 24 repeating layers plus output on GPU. Input embeddings stay on CPU in the pinned llama.cpp placement model.

The extra budget is a planning allowance you choose, not measured runtime workspace. Single GPU, one sequence, standard dense full attention only.

Tensor accounting · GGUF v3

Qwen2.5 0.5B Instruct · Q4_K_M

GPU weights + KV payload

0.459 GiB

This is a payload subtotal, not a measured peak or loading guarantee.

GPU weight tensors
0.365 GiB
GPU KV cache
0.094 GiB
CPU weight tensors
0.087 GiB
CPU KV cache
0.000 GiB
Repeating layers on GPU
24 / 24
Aligned context slots
8,192
GGUF file / all tensor payload
0.458 GiB / 0.452 GiB
Your capacity budget1.128 GiB

(Payload + 0.50 GiB extra budget) ÷ 0.85. This is a planning scenario, separate from the measurement below.

Matching measured configuration

Apple M5 · 16 GiB unified memory · llama.cpp b12532, measured 2026-11-19. Single sequence, Flash Attention on, batch 512 / microbatch 128.

Model-load resource peak
374.42 MiB
512-token prefill peak
548.97 MiB
64-token generation peak
548.97 MiB

Observed Metal resource allocations, not CUDA VRAM. Target sampling 10 ms plus stage-end readings; largest observed interval 23.67 ms. No 95% success claim.

Exact official GGUF file and revision

What is calculated

Count tensors, not nominal bits.

The tool sums each tensor's shape and actual quantization-block bytes. A Q4_K_M file can mix Q4_K, Q6_K and higher-precision tensors. Tokenizer metadata, tensor directory and file padding are not GPU weights. File size and tensor payload are shown separately.

Layer placement follows the pinned llama.cpp b12532 contract: input embeddings remain on CPU, repeating layers and the output layer are assigned separately. A request of 12 GPU layers in the verified Qwen examples means 11 repeating layers plus output. This is not tensor parallelism.

K and V use the selected block format, on each layer's device when offload is enabled. Context slots round up to 256. Q8_0 uses 34 bytes per 32 elements; Q4_0 uses 18, including scales. These formats are not FP8.

Read the general ModelFit methodology
Real experiment · November 19, 2026

22 measured configurations, with a narrow scope.

ModelFit's reproducible local experiment used an Apple M5 with 16 GiB unified memory and the official llama.cpp b12532 library, commit 08c252e22. Both official Qwen2.5 0.5B and 1.5B Instruct Q4_K_M files were verified against their full published SHA-256 hashes.

The 22 formal runs covered CPU control, partial/full GPU offload, 2K/8K context, FP16/Q8_0/Q4_0 cache, repeated runs, and two 7,680-token prefill runs. Every formal run loaded successfully and generated 64 tokens. Most runs used 512 prompt tokens. One sequence, batch 512, microbatch 128, four CPU threads, Flash Attention and KV offload were fixed.

We sampled the process's Metal resource allocation and resident memory separately. An initial interval-only sampler missed fast load-stage endpoints; those 15 preliminary runs were retained separately and excluded from the formal results. The revised sampler added stage-end readings. Its target interval was 10 ms; the largest observed gap was 23.67 ms.

For full GPU offload at 8K with FP16 cache, observed generation resource peaks were 548.97 MiB for 0.5B and 1,239.20 MiB for 1.5B. The longer prefill runs had the same observed resource peaks in these preallocated configurations. This does not establish a universal error bound or a loading-success probability.

Download all 22 measured configurations (CSV) · Read the experiment protocol and hashes

Scope before certainty

Payload is not peak VRAM.

Weights plus KV alone underestimated the observed Metal generation resources by roughly 76–82 MiB in these small-model runs. Graph/compute buffers, temporary resources, backend repacking and allocation alignment are separate. The editable extra budget and headroom are your planning choices, not a fitted guarantee.

Apple unified-memory resources are not NVIDIA CUDA VRAM. Do not add Metal allocations to resident memory: they can share physical pages. Sampling can miss shorter transients. A measured example does not validate a different checkpoint, runtime version, GPU, context, concurrency or cache setting.

This version supports single-file, little-endian GGUF v3 standard dense Llama/Qwen2 tensor layouts, with explicit block types. Runtime measurements cover only the two Qwen2 examples. Split files, tied/implicit output weights, unknown tensor types, MoE, sliding/hybrid attention, recurrent/MLA architectures, multimodal sidecars, adapters, speculative decoding and multiple GPUs are not estimated. Unsupported files return an explanation instead of a guessed total.

Primary sources and responsibility

Make every claim traceable.

Method and publication responsibility: ModelFit. Measurements were collected November 19, 2026; this tool's implementation and sources were checked November 23, 2026. No independent expert review or hardware-vendor endorsement is claimed. The experiment used local hardware, not a rented Flatkey GPU. Some site links lead to Flatkey compute discovery; this experiment does not benchmark or endorse that service.

For formats and runtime compatibility, read GGUF vs Safetensors. For broader planning use the full worksheet, weight calculator or KV calculator. Return to all calculators.