Local AI

LLM VRAM calculator: how much GPU memory a model needs, with a table by model size

Work out the VRAM an LLM needs in two steps: weights from parameters and quantization, plus context cache. Table for 8B to 405B models and matching hardware.

By Agent Team Plan editorial team · Published 2026-11-25 · Updated 2026-11-25

Research-based buying guidance. We have not hands-on tested the machines mentioned. Product links may earn us a commission where marked.

The short answer

An LLM VRAM calculator only needs two numbers: the model's weights and its context cache. The weights are the parameter count times the bits per weight of your quantization. At the popular 4-bit setting, that is about 0.6GB per billion parameters, so a 70-billion-parameter model needs about 43GB for weights alone. Add the context cache and 10–20% for the runtime, and you have your answer.

The table below does that arithmetic for common model sizes. After it, we show how to calculate it yourself and which kind of machine each size needs.

The formula

The basic rule is simple: memory equals the number of parameters times the bytes per parameter (Mistral AI). For a quantized model, use the measured bits per weight of the format. The llama.cpp project lists these on Llama-3.1-8B (llama.cpp quantize README):

FormatBits per weightGB per billion parameters
FP16 / BF16 (unquantized)162.0
Q8_08.51.06
Q6_K6.560.82
Q5_K_M5.700.71
Q4_K_M4.890.61

So the full calculation is:

Total memory ≈ (parameters × bits per weight ÷ 8) + context cache + 10–20% runtime overhead

The weights are fixed once you choose the model and format. The context cache is the part people forget, and it is the part that grows with use.

How much VRAM each model size needs

Weights only, in GB, from the bits-per-weight values above. Add the context cache and overhead from the next section.

Model sizeFP16Q8_0Q4_K_MSmallest common hardware for Q4_K_M
8B168.54.9Any 8GB GPU
14B28158.612–16GB GPU
32B64342024GB GPU
70B140744348GB+ GPU or 64GB unified memory
120B2401287496GB GPU or 128GB unified memory
235B470250144256GB unified memory
405B810430248512GB unified memory or a GB300 workstation

Mixture-of-experts models are listed by total parameters here, because every expert has to be in memory even if only some are active per token. They run faster than a dense model of the same size, but they need the same memory.

Editorial view: Q4_K_M is the sensible default for local use. Q8_0 roughly doubles the memory for a quality gain most business tasks will not notice. Go below 4 bits only when it is the difference between a model fitting or not.

Do not forget the context cache

Every token in the conversation keeps a key-value (KV) cache in memory. Its size depends on the model's architecture, the context length and how many requests run at once: cache per token × context tokens × number of parallel requests (Sebastian Raschka's memory calculator).

A worked example from that calculator: Qwen3 8B uses about 144 KiB of cache per token. At a 32,768-token context, that is about 4.5 GiB of cache, nearly as much as the 4-bit weights of the same model.

This matters for agent teams. If three agents call the same local model in parallel, each with a long context, the cache multiplies by three. A model that "fits" in a single chat can run out of memory once several agents use it at the same time. Leave at least 20–30% of memory free beyond the weights if you plan to serve more than one user.

GPU VRAM or unified memory?

There are two ways to get the memory a model needs.

A dedicated GPU keeps the model in its own VRAM. It is the fastest option, but the capacity is fixed: 24GB on an RTX 5090 Laptop GPU, 32GB on a desktop RTX 5090, 96GB on an RTX PRO 6000 Blackwell. If the model does not fit, part of it falls back to system RAM and speed drops sharply. The same cards are gaming GPUs; our GTA 6 PC requirements guide looks at which RTX 5090 desktops and laptops suit both jobs.

Unified or shared memory lets the CPU and GPU use one large pool. Apple Silicon Macs such as the Mac Studio, NVIDIA GB10 machines such as the DGX Spark and AMD Ryzen AI Max+ systems such as the Framework Desktop offer 128GB or more. Large models fit, but memory bandwidth is lower than on a high-end GPU, so text is generated more slowly.

A practical rule for unified memory: plan for about 75% of the total for model weights. The operating system, your other applications and the context cache need the rest.

Which machine for which model

You can filter machines by memory in our AI hardware directory and put two configurations side by side with the comparison tool. For the background on RAM, VRAM and unified memory, see our local LLM hardware requirements guide.

Bottom line

To size memory for a local LLM: multiply billions of parameters by about 0.6GB for 4-bit or 1.06GB for 8-bit, add the context cache for your longest conversations and number of parallel users, then add 10–20% for the runtime. If the total is close to what a machine offers, pick the next size up, because the cache will grow before the model does.

Frequently asked questions

How much VRAM do I need to run a 70B model?

About 43GB for the weights at 4-bit (Q4_K_M), 74GB at 8-bit and 140GB unquantized, plus the context cache and 10–20% overhead. In practice that means a 48GB+ GPU or a machine with at least 64GB of unified memory, and 128GB for long contexts.

How do I calculate how much memory an LLM needs?

Multiply the parameter count by the bits per weight of your quantization and divide by 8 to get the weights in bytes. Add the KV cache (cache per token × context length × parallel requests) and about 10–20% for the runtime.

Does quantization reduce VRAM requirements?

Yes. Q4_K_M uses about 4.9 bits per weight instead of 16, so the weights need roughly 30% of the unquantized memory. It does not shrink the context cache, which is set by the model architecture and context length.

Is unified memory as good as GPU VRAM for LLMs?

It fits larger models for the money, because 128GB or more is shared by the CPU and GPU. It is usually slower than a high-end GPU’s VRAM, so models generate text more slowly. Plan for about 75% of unified memory for model weights.

Sources and verification

Miklos Kovacs
Miklos Kovacs
Site owner
ABOUT THE AUTHOR

Agent Team Plan editorial team

Agent Team Plan publishes practical guidance for choosing AI agents, agent service providers and local AI hardware. Articles are researched and written with AI assistance from official sources, which are linked beside each claim. We have not hands-on tested the products discussed.

View author profile →

Where to buy the machines in this article

Affiliate links: we may earn a commission at no extra cost to you. It never changes which machines we cover or how we compare them. As an Amazon Associate we earn from qualifying purchases.

Explore the options

Browse the hardware directory →

AI agent news, minus the noise.