LocalLLMBench

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

By Local AI Math. Updated 30 November 2026.

Short answer. Memory needed = weights + context cache + runtime buffers. The weights are parameters × bits per weight ÷ 8. At Q4_K_M that is roughly 0.6 GB per billion parameters, so a 7B model needs about 4.6 GB for its weights, before the context and the runtime.

The VRAM calculator does this arithmetic for you. This page shows the same steps by hand, with real parameter counts, so you can check any model you are considering.

Step 1: find the parameter count

Every open model's card states its size. The number in the name is often rounded: Qwen2.5 7B, for example, has 7.61 billion parameters according to its card. Use the card's figure. The table of common models lists several, with links to their cards.

Mixture-of-experts models need care. Llama 4 Maverick is listed as 17B active and 400B total. Only some experts work on each token, but all of them have to be loaded, so the memory follows the 400B total.

Step 2: multiply by the bits per weight

A quantization level sets the average storage per parameter. The figure in the name is a floor, not the average: scale factors and higher-precision tensors push the real value up. This site uses these typical values, and the real figure for a given file varies:

LevelBits per weightGB per billion parameters
Q4_K_Mabout 4.850.61
Q5_K_Mabout 5.70.71
Q8_0about 8.51.06
F16162.00

If you already have the file, skip the estimate: its size in GB is close to the weights' memory. Dividing the file size in GB by the parameters in billions and multiplying by 8 gives the exact bits per weight for that file.

Step 3: add the context cache

The key/value cache stores two vectors per layer for every token in the context. With a 16-bit cache:

cache bytes per token = 2 × layers × key/value heads × head size × 2

The head size is the hidden size divided by the number of attention heads. All of these numbers are in the model's config.json. For Qwen2.5 7B the configuration gives 28 layers, 4 key/value heads and a hidden size of 3,584 across 28 heads, so a head size of 128:

2 × 28 × 4 × 128 × 2 = 57,344 bytes per token, about 0.057 GB per 1,000 tokens

For Qwen2.5 72B (80 layers, 8 key/value heads, head size 8,192 ÷ 64 = 128) it is 327,680 bytes per token, about 0.33 GB per 1,000 tokens. The cache grows in a straight line with context length, so long contexts on big models add up fast. Some runtimes, llama.cpp among them, can store the cache at lower precision, which shrinks it.

If you do not know the architecture, the calculator uses a flat 0.25 GB per 1,000 tokens. That is generous for small models and too low for some large ones, as the 72B figure shows. When you pick a Qwen2.5, Llama 3.1 or Mistral model in the calculator, it fills in the exact figure from the published configuration; for Llama 3.1 405B that is about 0.52 GB per 1,000 tokens, roughly twice the flat allowance. The calculator can also halve or quarter the figure for an 8-bit or 4-bit cache.

Step 4: add runtime buffers and keep some memory free

The runtime needs working memory of its own; the calculator allows 1 GB by default. Then subtract what the rest of the machine needs: a little on a graphics card that also drives a display, and much more on a Mac, where macOS and your apps share the same pool. The calculator keeps 0.5 GB free on a card and 25% (at least 4 GB) on a Mac by default. Both are adjustable.

Worked examples

All use Q4_K_M at about 4.85 bits per weight, 1 GB of runtime buffers and GB of 1,000,000,000 bytes. "Fits" leaves at least 10% of usable memory spare; "tight" fits with less.

Qwen2.5 7B on an 8 GB graphics card

Weights: 7.61 × 4.85 ÷ 84.61 GB
Cache: 8,192 tokens × 57,344 bytes0.47 GB
Runtime buffers1.00 GB
Total, against 7.5 GB usable6.08 GB: fits

Raise the context to 32,768 tokens and the cache grows to 1.88 GB, the total to 7.49 GB: still inside 7.5 GB, but tight. The model did not change; the context setting did.

Qwen2.5 32B on a 24 GB graphics card

Weights 32.5 × 4.85 ÷ 8 = 19.70 GB. The configuration gives 64 layers, 8 key/value heads and a head size of 128, so the cache is 262,144 bytes per token, 2.15 GB at 8,192 tokens. With 1 GB of buffers the total is 22.85 GB against 23.5 GB usable: tight. At Q3_K_M, about 3.9 bits per weight, the weights drop to 15.84 GB and the total to 18.99 GB, which fits, at some cost in output quality.

Qwen2.5 72B on a Mac

ContextTotal64 GB Mac (48 usable)128 GB Mac (96 usable)
8,192 tokens47.76 GBtightfits
32,768 tokens55.81 GBdoes not fitfits

Weights are 72.7 × 4.85 ÷ 8 = 44.07 GB; the cache is 2.68 GB at 8,192 tokens and 10.74 GB at 32,768. On the 64 GB Mac, the default reserve of 16 GB for macOS and apps decides the result as much as the model does.

Llama 4 Maverick

400 × 4.85 ÷ 8 = 242.5 GB for the weights alone. No single consumer graphics card comes close. The 17B active parameters affect speed, not the memory needed to hold the model.

Checklist before you download

If the answer is that you need a card with more memory, SiliconPerDollar compares graphics cards by price per GB of VRAM using the prices you enter.

Everything here is an estimate from a formula, not a measurement. Real use depends on the runtime and its settings. For the background on quantization names, offload and Apple silicon, read the guide; to try your own numbers, open the calculator.