LocalLLMBench

VRAM calculator for local LLMs

Enter a model's size, its GGUF quantization and your context length to see whether it fits your graphics card or your Mac's unified memory. Every figure here is an estimate from a formula, not a measurement.

Your model and your memory

billion parameters

Parameter counts as stated on each model card. Parameter counts checked 29 November 2026 (Llama 4 Scout: 30 November 2026); layer and head counts checked 29 November 2026 (Qwen2.5, Mistral 7B) and 30 November 2026 (Llama 3.1). Sources

bits

A typical value for this level. The exact figure differs from model to model, so change it if you know yours (file size in GB × 8 ÷ billions of parameters).

tokens
Your memory
GB
Cards
Macs
Overhead allowances

These are allowances you can tune, not properties of your model. Raise them to be cautious.

GB per 1,000 tokens

A lower-precision cache, offered by some runtimes such as llama.cpp, roughly halves or quarters the context cost and frees room for a longer context, at a possible small loss in output quality.

GB
GB
Work out the context cost from the model's architecture

The key/value cache stores two vectors per layer for every token. If you know these four numbers from the model card or the runtime's load log, this gives a closer figure than the default.

0.13 GB per 1,000 tokens with a 16-bit cache.

Result

Estimate for 7B at Q4_K_M, 8,192 tokens

Fits

Needs about 7.3 GB of the 11.5 GB you can use. 4.2 GB to spare.

Memory bar: 7.3 GB needed of 12 GB, 0.5 GB kept free.
  • Weights 4.2 GB
  • Context 2.0 GB
  • Runtime 1.0 GB
  • Kept free 0.5 GB
Total estimate7.3 GB
Usable memory11.5 GB
Headroom4.2 GB
  • Largest level that fits at this size and context: Q8_0 (tight).
  • Longest context that fits at this level: about 24,832 tokens.
  • Largest model that fits at this level and context: about 13.9B parameters.
How this is calculated

weights = parameters × bits per weight ÷ 8
7 billion × 4.85 ÷ 8 = 4.2 GB

context = context length ÷ 1,000 × context cost × cache bits ÷ 16
8,192 ÷ 1,000 × 0.25 × 16 ÷ 16 = 2.0 GB

total = weights + context + runtime buffers
4.2 + 2.0 + 1.0 = 7.3 GB

usable = memory − kept free
12 − 0.5 = 11.5 GB

Fits: the total is at most 90% of usable memory. Tight: it is above 90% but still within usable memory. Does not fit: it is above usable memory. GB here means 1,000,000,000 bytes. This is an estimate from a formula, not a measurement of any model or card.

Fit matrix for your memory

Estimated total in GB for each size and level, at 8,192 tokens of context on 11.5 GB of usable memory. Pick a cell to load it into the calculator.

B
  • fits
  • tight
  • does not fit
SizeGB totalsQ3_K_MQ4_K_MQ5_K_MQ6_KQ8_0F16
3B 
8B 
14B 
32B 
70B 
20Bcustom 

Each cell is the same formula as the calculator, using your context length and allowances. Estimates, not measurements.

My benchmarks

Speed depends on your exact hardware, runtime and settings, so the only numbers worth trusting are the ones you measure. Record your runs here. They are saved in this browser and are not uploaded.

Add a run

No runs saved yet.

Notes Actions
2026-01-15 Desktop, 12 GB graphics card example-7b-instruct Q4_K_M 8,192 30 400 Made-up values that show the format Example

The row above is an example with made-up values, shown only to explain the columns. It disappears when you add your first run.

Guide: memory, quantization and measuring speed

Worked examples with real model sizes: How much VRAM do I need to run a local LLM?

Why VRAM limits the model you can run

A language model is a large set of numbers called weights. To produce one token, the runtime reads essentially all of them. For that to be fast, the weights have to sit in memory the GPU can reach directly, which on a desktop PC is the graphics card's VRAM. A model whose weights do not fit there either fails to load or is split between the GPU and ordinary system RAM, and the part outside the GPU slows everything down.

Parameter counts of common open models

The calculator needs the parameter count, which the model's own card on its publisher's page states. These are the values the picker uses, as written on each card. New versions appear often, so check the card of the exact model you download.

Parameter counts checked 29 November 2026 (Llama 4 Scout: 30 November 2026); layer and head counts checked 29 November 2026 (Qwen2.5, Mistral 7B) and 30 November 2026 (Llama 3.1).
ModelParametersSource
Qwen2.5 0.5B0.49Bmodel card
Qwen2.5 3B3.09Bmodel card
Qwen2.5 7B7.61Bmodel card
Qwen2.5 14B14.7Bmodel card
Qwen2.5 32B32.5Bmodel card
Qwen2.5 72B72.7Bmodel card
Llama 3.1 8B8Bmodel card Nominal size: the card states "8B", not an exact count
Llama 3.1 70B70Bmodel card Nominal size: the card states "70B", not an exact count
Llama 3.1 405B405Bmodel card Nominal size: the card states "405B", not an exact count
Llama 4 Scout109Bmodel card 109B total, 17B active per token
Llama 4 Maverick400Bmodel card 400B total, 17B active per token
Mistral 7B v0.17Bmodel card

The picker also sets the context cost from each model's layer and head counts: for Qwen2.5 and Mistral 7B from the model's config.json, for Llama 3.1 from Meta's llama-models reference list (the Hugging Face configuration needs a sign-in). Llama 4's configuration is not openly published, so for Scout and Maverick the calculator keeps your flat allowance; their attention design may also need less cache than the simple formula gives.

Parameter counts checked 29 November 2026 (Llama 4 Scout: 30 November 2026); layer and head counts checked 29 November 2026 (Qwen2.5, Mistral 7B) and 30 November 2026 (Llama 3.1).

For mixture-of-experts models such as Llama 4, use the total. Only some experts work on each token, but all of them have to be in memory or offloaded.

What quantization is

Models are usually trained and published with 16-bit or 32-bit floating point weights. Quantization stores each weight with fewer bits. The file gets smaller and needs less memory, and the model's output drifts a little from the original. The drift is usually small at 8 bits and grows as the bit count falls.

The size follows directly from the bit count:

weights in bytes = parameters × bits per weight ÷ 8

A model with 7 billion parameters at 16 bits per weight takes 14 GB. At about 5 bits per weight the same model takes about 4.4 GB.

What the GGUF level names mean

GGUF is the file format used by llama.cpp and by the many tools built on it. Its quantization levels have names such as Q4_K_M, and the parts of the name carry meaning:

  • Q and a number: the nominal bits used for most weights. Q4 is about 4 bits, Q8 about 8.
  • K: the k-quant family, which mixes precisions and gives more bits to the parts of the model that are more sensitive.
  • S, M, L: small, medium and large variants of a k-quant level. Larger variants keep more tensors at higher precision.
  • _0 and _1: older, simpler schemes that treat all weights the same way.
  • F16 and F32: unquantized 16-bit and 32-bit floats.
  • IQ: a newer family aimed at better quality at low bit counts.

The effective bits per weight is always somewhat higher than the number in the name, because scale factors are stored alongside the weights and some tensors stay at higher precision. It also differs between models. To find the real value for a file you have, multiply its size in GB by 8 and divide by the parameter count in billions.

What context length costs in memory

While generating, the runtime keeps a key/value cache: for every token in the context, at every layer, it stores two vectors so it does not have to recompute them. The cache therefore grows in a straight line with context length:

cache in bytes = 2 × layers × context length × key/value width × bytes per value

The key/value width equals the hidden size in older designs and is a fraction of it in models that share key/value heads between attention heads. Because it depends on the architecture, this site treats context cost as an adjustable allowance per 1,000 tokens, and offers a small helper if you know the four architecture numbers. Some runtimes, llama.cpp among them, reserve the cache for the whole configured context when the model loads, so a large context setting can cost memory even if your prompts are short.

GPU offload versus CPU

Runtimes based on llama.cpp let you choose how many of the model's layers go to the GPU. Everything on the GPU is fast. Layers left on the CPU run from system RAM, where speed is held back largely by memory bandwidth. When the calculator says a model does not fit, it also estimates what share of the weights would fit, as a starting point for a partial offload setting.

Unified memory on Apple silicon

Apple silicon Macs have no separate VRAM. The CPU and GPU share one pool of memory, so the GPU can use a large part of the installed RAM. It cannot use all of it: macOS and your open apps live in the same pool, and macOS limits how much the GPU may hold. If a model pushes the system into swapping, generation speed drops sharply. Choose "Unified memory" above and set the amount to keep free to match how you use your Mac.

How to measure tokens per second yourself

  1. Find the timings. Many runtimes print them after a response or behind a verbose option: one rate for reading the prompt (prompt tokens per second) and one for generating (tokens per second).
  2. If yours does not, divide the number of generated tokens by the seconds spent generating.
  3. Keep the test fixed: same prompt, same context setting, same output length, same sampling settings. Ignore the first run after loading.
  4. Run it three or more times and record the middle value.
  5. Write down what else matters: runtime and version, layers on the GPU, power mode, and whether other apps were using the GPU.

Then add the run to your benchmark log so you can compare levels and settings on your own machine.

Common mistakes

  • Setting a very long context "just in case". It reserves memory that could have held a better quantization.
  • Comparing speeds measured with different prompts, contexts or output lengths.
  • Mixing units. Tools often report memory in GiB (1,024³ bytes) while file sizes are quoted in GB (1,000³ bytes). This calculator uses GB throughout.

Glossary

Parameter
One learned number in the model. Sizes such as 7B mean 7 billion parameters.
Bits per weight
The average storage per parameter after quantization.
GGUF
A single-file model format used by llama.cpp and compatible tools.
Context length
The number of tokens the model can attend to at once, prompt and reply together.
Token
The unit of text a model reads and writes, typically a word or a piece of one.
Offload
Placing some or all of the model's layers on the GPU.

Questions and answers

How much VRAM do I need to run a local LLM?

Multiply the parameter count by the bits per weight of the quantization and divide by 8 to get the size of the weights in bytes. Then add memory for the context (the KV cache) and for the runtime itself. A model fits when that total is below the memory your GPU can actually use.

What does Q4_K_M mean in a GGUF file name?

Q4 means the main weights are stored with about 4 bits each. K marks the k-quant family, which mixes precisions across different parts of the model. M is the medium variant; S and L are the small and large ones. The real average is a little above 4 bits per weight because some tensors are kept at higher precision.

Does a longer context length use more memory?

Yes. The runtime keeps keys and values for every token in the context at every layer, so this cache grows in a straight line with the context length. Doubling the context doubles the cache. The weights stay the same size.

What happens if the model does not fit in VRAM?

Depending on the runtime, loading fails, or part of the model is kept in system RAM and run on the CPU. Partial offload works, but generation is slower because every token has to pass through the layers that are not on the GPU.

Can a Mac use all of its unified memory for a model?

No. On Apple silicon the CPU and GPU share one pool of memory, and macOS and your open apps need part of it. macOS also limits how much the GPU may hold. Plan with less than the installed amount and leave a reserve.

Is the size of a GGUF file the same as the memory it needs?

The file size is close to the memory the weights need, because the weights are loaded more or less as stored. The total is higher: the context cache and the runtime's working buffers come on top.

How do I measure tokens per second?

Many runtimes can print timings after a response: one rate for reading the prompt and one for generating. To compute it yourself, divide the number of generated tokens by the seconds spent generating. Use the same prompt, context and output length each time, and ignore the first run, which includes loading the model.