FREE TOOL · RUNS IN YOUR BROWSER · NO SIGN-UP

Pick a model size, a quantisation and a context length, then tell it about your GPU, Mac or PC. It estimates the memory for the weights, the KV cache and overhead, and tells you whether the model fits on the GPU, needs partial offload, runs on the CPU only, or won't fit.

Illustration of a desktop PC tower, a laptop, a graphics card, a RAM stick and a tape measure, for sizing the hardware a local AI model needs

001 / THE CALCULATOR

How much memory does your model need?

Start with the defaults (an 8B model at Q4_K_M on a 12 GB graphics card) and change one thing at a time. Results update as you type. Size presets use the real layer and attention-head counts of an open-weight model at that size, so the KV cache estimate isn't a guess from the parameter count alone.

6.8 GBFits on GPU
1. The model
B

Architecture for the KV cache from Qwen3-8B's config.json: 36 layers, 8 KV heads, head size 128.

The common default for local use: good balance of size and quality.

Ollama sets 4K, 32K or 256K by default depending on VRAM.

Parallel requests, each with its own cache.

q8_0 and q4_0 need flash attention enabled.

Advanced: model architecture (for the KV cache)

Find these in the model's config.json on Hugging Face: num_hidden_layers, num_key_value_heads and head_dim (or hidden_size ÷ num_attention_heads).

2. Your computer
GB

Add cards together for multi-GPU.

GB

Used for layers that don't fit on the GPU.

ESTIMATED MEMORY NEEDED

6.8 GBof 39.4 GB usable (11.4 GPU + 28.0 RAM)

Fits on GPU

The whole model and its cache fit in GPU memory. This is the fast case.

Memory breakdown
Model weights8.2B × 4.89 bits ÷ 84.7 GB
KV cache8K tokens × 1 user, f161.1 GB
Overhead (approx.)0.5 GB + 10% of weights1.0 GB
Total6.8 GB

OPTIONS

  • You have 4.6 GB spare: Q8_0 (higher quality) would also fit.
  • Context could go up to about 32K tokens and still fit.
Show the working

Weights = 8.2 × 10⁹ × 4.8944 ÷ 8 bytes = 4.7 GB

KV cache = 2 × 36 layers × 8 KV heads × 128 × 8,192 tokens × 1 × 2 bytes = 1.1 GB

Overhead = 0.5 + 0.1 × 4.7 = 1.0 GB

1 GB here = 1,024³ bytes, the way VRAM and RAM are sized. Usable memory: 95% of VRAM, and system RAM minus 4 GB for the OS.

Runs in your browser. Nothing you enter is sent anywhere.

002 / RULE OF THUMB

How much VRAM do I need for an LLM?

For the weights alone: parameters (in billions) × bits per weight ÷ 8 gives gigabytes. At the popular Q4_K_M quantisation that's about 0.6 GB per billion parameters, so an 8B model is about 4.7 GB and a 70B-class model about 41 GB, before you add the KV cache and working memory.

The table below runs the calculator's maths for each size preset at four quantisations, with an 8K context and one user. Read it as “the smallest memory you'd want free”, not a guarantee. A 12 GB card comfortably holds an 8B model at Q4_K_M or Q5_K_M, and 16 GB takes a 14B model at Q4_K_M. A 32B model at Q4_K_M (about 23 GB) is borderline on a 24 GB card: it fits with a 4K context or at IQ4_XS. A 70B-class model at Q4_K_M needs about 49 GB, a little more than two 24 GB cards or one 48 GB card can give it, so on 48 GB you'd drop to IQ4_XS or a shorter context. On a Mac, 64 GB is borderline at the default GPU share and 96 GB is comfortable.

Estimated total memory (weights + f16 KV cache + overhead) at an 8,192-token context for one user. Architecture from each example model's config.json.
SIZE (EXAMPLE)Q4_K_MQ5_K_MQ8_0F16
~1.7B (Qwen3-1.7B)2.4 GB2.6 GB3.2 GB4.9 GB
~3B (Qwen2.5-3B-Instruct)2.7 GB3.0 GB4.1 GB7.1 GB
~4B (Qwen3-4B)4.1 GB4.5 GB6.0 GB9.8 GB
~8B (Qwen3-8B)6.8 GB7.6 GB10.6 GB18.4 GB
~14B (Qwen3-14B)11.0 GB12.6 GB17.9 GB32.1 GB
~32B (Qwen3-32B)23.1 GB26.5 GB38.2 GB69.7 GB
~70B (Qwen2.5-72B-Instruct)48.6 GB56.1 GB82.1 GB152 GB

Example models and their sizes come from the official model cards on Hugging Face (for instance Qwen3-8B, 8.2B parameters, and Qwen2.5-72B-Instruct, 72.7B). Other model families at the same size have different layer and head counts, so their KV cache will differ. Use the Advanced fields for a model that isn't listed.

003 / THE MATHS

How does the calculator work out the numbers?

It adds three things: the model weights, the KV cache, and an allowance for overhead. Then it compares the total with the memory your hardware can actually give the model. Every formula is below, and the calculator's “Show the working” panel fills in your numbers.

1. Weights

weights (bytes) = parameters × bits per weight ÷ 8

The bits-per-weight figures come from the table in the llama.cpp quantize README, measured on Llama 3.1 8B: for example Q4_K_M is 4.89, Q8_0 is 8.50 and F16 is 16.00. They're averages: a GGUF file mixes types, keeping some tensors at higher precision, so a different model at the “same” quantisation can land slightly higher or lower.

2. KV cache (an approximation)

KV cache (bytes) = 2 × layers × KV heads × head size × context tokens × users × bytes per value

The 2 is for keys and values. Bytes per value is 2 for the default f16 cache, about 1.06 for q8_0 and 0.56 for q4_0, which matches the “about half” and “about a quarter” in the Ollama FAQ. The formula is exact for standard grouped-query attention, which the preset models use. It overestimates for models with sliding-window attention on some layers, or with compressed (latent) attention, because they store less. It assumes each concurrent user gets their own full-length context. Runtimes handle this differently (llama.cpp's server, for example, can split one context budget across its parallel slots), so if yours shares a fixed budget, set users to 1 and enter the total context.

3. Overhead and usable memory (assumptions)

We add 0.5 GB plus 10% of the weights for compute buffers and the runtime. The real figure depends on the runtime, batch size and context, so this is the least precise part. On a GPU we treat 95% of VRAM as usable (the driver and your display take some). We keep 4 GB of system RAM for the operating system. On a Mac we assume the GPU can use 75% of unified memory: Apple doesn't publish a fixed figure, and you can change it in the calculator. 1 GB here is 1,024³ bytes, which is how VRAM and RAM are sized.

4. The verdict

  • Fits on GPU: the total is within usable GPU (or Mac GPU) memory.
  • Fits with partial offload: it doesn't fit on the GPU, but GPU plus spare system RAM is enough and at least 15% is on the GPU.
  • CPU only (slow): no GPU, or too little of the model on it to matter, but it fits in RAM.
  • Won't fit: not enough memory in total.

004 / WORKED EXAMPLE

Worked example: can a 12 GB graphics card run an 8B model?

Yes, comfortably. Qwen3-8B at Q4_K_M with an 8K context needs about 6.8 GB, well under the 11.4 GB the calculator treats as usable on a 12 GB card. Serve four people at 32K context each and the same model needs about 23.6 GB, so it only runs with partial offload.

Here's the arithmetic by hand, using the numbers from Qwen3-8B's model card (8.2B parameters) and config.json (36 layers, 8 KV heads, head size 128):

  • Weights: 8.2 × 10⁹ × 4.8944 ÷ 8 = 5.02 × 10⁹ bytes = 4.67 GB.
  • KV cache: 2 × 36 × 8 × 128 × 8,192 × 1 × 2 bytes = 1,207,959,552 bytes = 1.13 GB.
  • Overhead: 0.5 + 0.1 × 4.67 = 0.97 GB.
  • Total: 6.76 GB against 12 × 0.95 = 11.4 GB usable. Fits on GPU, with about 4.6 GB to spare.

A cross-check on the weights: llama.cpp's own table lists Llama 3.1 8B (about 8.03B parameters) at 4.58 GiB for Q4_K_M, and the same formula gives 8.03 × 10⁹ × 4.8944 ÷ 8 ÷ 1,024³ = 4.58.

Now set four concurrent users and a 32K context. The KV cache grows 16 times, to 18 GB, and the total to 23.6 GB. With 32 GB of system RAM the calculator says “fits with partial offload”, with about 48% on the GPU. Its suggestions: shorten the context, quantise the KV cache to q8_0 (saving about 8.4 GB), or serve fewer people at once. This is why a model that “runs fine” for one person can fall over when the whole office uses it.

005 / QUANTISATION NAMES

What do Q4_K_M, Q8_0 and the other quantisation names mean?

They're llama.cpp's GGUF quantisation types. The number is roughly the bits per weight, K means the newer “k-quant” block format, and S, M or L is the small, medium or large mix of precision within a file. Q4_K_M is the common default for local use.

The llama.cpp quantize README lists each type with its bits per weight, file size and speed on Llama 3.1 8B, and shows commands like llama-quantize model-bf16.gguf model-Q4_K_M.gguf Q4_K_M. IQ types (such as IQ4_XS) are a further family that squeezes a little more out at the same quality, often with an importance matrix.

Ollama runs the same GGUF files. Its import guide says Ollama doesn't quantise GGUF models during import and points you to llama.cpp's llama-quantize. Two Ollama settings matter for memory: OLLAMA_CONTEXT_LENGTH (its context length page says the default depends on VRAM: 4K under 24 GiB, 32K from 24 to 48 GiB, and 256K at 48 GiB or more, so a big card can quietly reserve a big cache) and OLLAMA_KV_CACHE_TYPE (f16 by default, or q8_0 or q4_0 with flash attention). Run ollama ps to see the real size of a loaded model and its CPU/GPU split, and compare it with the calculator.

006 / LIMITS

What this calculator can't tell you

It estimates memory, not speed or quality. A model that fits can still be too slow for your use, and a model that's fast can still be wrong for your task.

  • Speed. Generating each token means reading the model's weights from memory, so speed is roughly memory bandwidth ÷ model size. That's why a GPU beats a CPU, and why partial offload is so much slower than a full fit.
  • Mixture-of-experts models. Enter the total parameters: all the experts need memory, even though only some are active per token. Engines that stream experts from an SSD change this, at a big speed cost; our post on running a 744B model on a laptop explains how.
  • Extras. Vision models load an image encoder on top. Embedding and reranking models for document search need their own memory if they run at the same time.
  • Runtimes differ. Some servers built for throughput reserve a fixed share of GPU memory up front for the cache, so they'll look “full” regardless of model size.
  • Quality. Only testing on your own documents and questions tells you whether a 4-bit 8B model is good enough or you need something bigger.

007 / NEXT STEPS

Your model fits. What should you run it with?

Pick a runtime and an interface next. Our list of the best open-source local AI tools compares the options, and the local AI starter stack puts them together into a setup a small business can actually run.

If client data can't leave your control and you'd rather not run the hardware yourself, our private AI in Australia service hosts models and data in an Australian cloud region. We're based in Sydney, work remotely across Australia and New Zealand, and fly in for set-ups and training.

008 / QUESTIONS

Anything else is quicker to answer on a call. Thirty minutes, free, with the people who would build it.

Roughly the model's parameter count in billions multiplied by its bits per weight, divided by eight, plus room for the KV cache and overhead. At Q4_K_M (about 4.9 bits per weight) an 8B model needs about 7 GB with an 8K context, a 14B model about 11 GB, a 32B model about 23 GB and a 70B-class model about 49 GB. Longer contexts and more users add more.

Tell us what you want the model to do and who'll use it. In thirty minutes we'll tell you whether local, private cloud or an API makes more sense, and what hardware you'd need. Free, and no obligation.

Book a free call→