Illustration of a graphics card whose memory is drawn as a stack of blocks, filling up with model weights and cache

Which AI Models Fit Your GPU? VRAM Guide for 8, 12, 16, 24 GB

Which open AI models run on 8, 12, 16 and 24 GB of VRAM: the formula for weights plus KV cache, what Q4 and Q8 cost in quality, and real Ollama model sizes.

At the 4-bit quantization Ollama ships by default, a 7B or 8B model needs an 8 GB card, 12B to 14B models need 12 GB (16 GB if you want long prompts), and 27B to 32B models need 24 GB. A 70B model at 4-bit is 43 GB, which means 48 GB or more of VRAM.

The longer version matters because the download size is not the whole bill. The context you use takes memory too, and a model that looks like it fits can end up half on the CPU and several times slower. Below is the formula I use, what the quantization labels mean, and a table of current open models with their real download sizes from the Ollama library. Sizes and specs were checked in September 2026; sources are at the end.

Quick answer by VRAM size

VRAMTypical cardsWhat runs fully on the GPU (4-bit)
8 GBRTX 4060, RTX 5060, RTX 30707B to 8B models: Llama 3.1 8B, Qwen3 8B, Mistral 7B
12 GBRTX 3060 12 GB, RTX 4070, RTX 507012B to 14B models at short context; 7B to 8B at Q8_0
16 GBRTX 4060 Ti 16 GB, RTX 4080, RTX 508014B with long context, gpt-oss 20B
24 GBRTX 3090, RTX 409024B to 32B: Mistral Small 3.2, Gemma 3 27B, Qwen3 32B
32 GBRTX 509032B with long context, 35B mixture-of-experts models
48 to 80 GBL40S (48 GB), H100 (80 GB)70B at 4-bit, gpt-oss 120B on 80 GB

Card memory sizes are from NVIDIA’s spec pages. Some cards come in two versions: the RTX 3060 exists with 12 GB and 8 GB, and the RTX 4060 Ti and RTX 5060 Ti with 16 GB and 8 GB. Check which one you are buying or renting.

How to estimate the VRAM a model needs

Three things sit in GPU memory while a model answers you:

  1. The weights. Parameters × bits per weight ÷ 8 = bytes.
  2. The KV cache. The model keeps the keys and values of every token in the conversation so it does not recompute them. Per token that is 2 × layers × KV heads × head size × 2 bytes (at the default 16-bit cache). Multiply by the context length.
  3. Overhead. The CUDA context, scratch buffers and the runtime itself. I budget about 1 GB. It varies by engine and settings, so treat it as a rule of thumb, not a spec.

The layer and head counts are in each model’s config.json on Hugging Face.

Worked example: Qwen 2.5 14B on a 16 GB card

Qwen 2.5 14B has 14.7 billion parameters, 48 layers, 8 KV heads and a head size of 128 (5,120 hidden size ÷ 40 attention heads).

  • Weights at Q4_K_M: llama.cpp lists Q4_K_M at about 4.89 bits per weight. 14.7 billion × 4.89 ÷ 8 = 8.99 GB. Ollama’s qwen2.5:14b download is 9.0 GB, so the arithmetic matches the real file.
  • KV cache per token: 2 × 48 × 8 × 128 × 2 bytes = 196,608 bytes, about 0.2 MB.
  • KV cache for the whole context: 4,096 tokens = 0.8 GB. 16,384 tokens = 3.2 GB. 32,768 tokens = 6.4 GB.
  • Total: 9.0 + 0.8 + 1 = 10.8 GB at 4K context. 9.0 + 3.2 + 1 = 13.2 GB at 16K. 9.0 + 6.4 + 1 = 16.4 GB at 32K, which no longer fits on a 16 GB card.
What fills VRAM for Qwen 2.5 14B at Q4_K_M on a 16 GB card: weights, KV cache at three context lengths, and overhead Weights 9.0 GB KV cache Overhead ~1 GB 16 GB card 4K context weights 10.8 GB 16K context weights 3.2 13.2 GB 32K context weights 6.4 16.4 GB 0 4 8 12 16 20 GB of VRAM
Qwen 2.5 14B at Q4_K_M on a 16 GB card. The weights stay at 9.0 GB; the KV cache grows with context until, at 32K tokens, the total passes 16 GB. Overhead is a rule-of-thumb 1 GB.

Two things follow from this. First, the context you set can cost as much memory as the model. Llama 3.1 8B (32 layers, 8 KV heads, head size 128) needs 131,072 bytes of KV cache per token, so its full 128K context would need 17.2 GB of cache alone, about three and a half times its 4.9 GB download. Second, KV cache size per token varies a lot between models. Qwen 2.5 7B has only 4 KV heads and 28 layers, so it needs 57,344 bytes per token, less than half of Llama 3.1 8B. Check the config before you assume.

What Ollama does with context by default

Ollama picks a default context length from the VRAM it finds: 4K tokens below 24 GiB, 32K tokens from 24 to 48 GiB, and 256K from 48 GiB up. You can change it with the OLLAMA_CONTEXT_LENGTH environment variable, and ollama ps shows the context actually allocated in its CONTEXT column. Two more settings change the math:

  • OLLAMA_NUM_PARALLEL (default 1): Ollama’s docs say parallel requests increase the context size by the number of parallel requests. Four parallel slots means four times the KV cache.
  • OLLAMA_KV_CACHE_TYPE: q8_0 uses about half the memory of the default f16 cache, q4_0 about a quarter. It requires flash attention to be enabled.

What quantization levels mean

Open models are published in 16-bit precision (the configs linked below list bfloat16): two bytes per parameter. Quantization stores the weights in fewer bits. In GGUF files, the format Ollama and llama.cpp use, the labels mean roughly this:

LabelBits per weightLlama 3.1 8B sizePerplexity on Llama 3 8B (lower is better)
F1616.014.96 GiB6.233
Q8_08.507.95 GiB6.234
Q6_K6.566.14 GiB6.253
Q5_K_M5.705.33 GiB6.289
Q4_K_M4.894.58 GiB6.407
Q3_K_M4.003.74 GiB6.888
Q2_K_S / Q2_K2.972.78 GiB9.752 (Q2_K)

Bits per weight and sizes come from the llama.cpp quantize README (Llama 3.1 8B). Perplexity comes from the llama.cpp perplexity README (Llama 3 8B, Wikitext). The “K” types are llama.cpp’s k-quants, which mix precisions across the model; _S, _M and _L are small, medium and large mixes.

What the numbers say: Q8_0 is practically lossless (perplexity 6.234 against 6.233). Q4_K_M costs about 3% in perplexity, and the same README reports that its most likely next token matches the full-precision model 91.9% of the time. Q3 is noticeably worse, and Q2 falls apart.

Perplexity is not the same as usefulness, so it helps that a January 2026 study by Uygar Kurt ran Llama 3.1 8B Instruct through reasoning, knowledge, instruction-following and truthfulness benchmarks at each llama.cpp level. The unweighted average was 69.47 at F16, 69.41 at Q8_0, 69.36 at Q5_K_M and 69.15 at Q4_K_M. That is the reason almost everyone, Ollama included, defaults to Q4_K_M: the file is less than a third of FP16 for a loss you will rarely notice. On Ollama the plain tag is that 4-bit build: qwen3:8b and qwen3:8b-q4_K_M are both 5.2 GB, phi4:14b and phi4:14b-q4_K_M both 9.1 GB.

My rule: take the biggest model that fits at Q4_K_M before you take a smaller model at Q8_0. A 14B at Q4 usually beats a 7B at Q8, and the files are about the same size. Go to Q5 or Q8 when you have memory left over and the task is sensitive to small errors, such as code or exact extraction.

Newer Ollama tags also include formats such as qat (Gemma’s quantization-aware trained builds), nvfp4 and mxfp8. gpt-oss ships in MXFP4 from OpenAI itself, at 4.25 bits per parameter for the mixture-of-experts weights.

Which models fit: sizes and VRAM tiers

The table lists current open models in the Ollama library as of September 2026 with their download sizes. The “4-bit” column is the size of the default tag. For most models that is the same file as the q4_K_M tag; where the default is a different build, the table gives both sizes (Mistral Nemo’s default is 7.1 GB, its q4_K_M 7.5 GB). “Smallest card” means the model plus about 1 GB overhead plus a 4K to 8K context fits fully on the GPU. Want long context? Go one tier up.

ModelOllama tag4-bit sizeQ8_0 sizeSmallest card (4-bit / Q8_0)
Mistral 7B v0.3mistral:7b4.4 GB7.7 GB8 GB / 12 GB
Qwen 2.5 7Bqwen2.5:7b4.7 GB8.1 GB8 GB / 12 GB
DeepSeek-R1 distill 7B (Qwen 2.5)deepseek-r1:7b4.7 GBnot checked8 GB
Llama 3.1 8Bllama3.1:8b4.9 GB8.5 GB8 GB / 12 GB
Qwen3 8Bqwen3:8b5.2 GB8.9 GB8 GB / 12 GB
DeepSeek-R1-0528 (Qwen3 8B)deepseek-r1:8b5.2 GBnot checked8 GB
Qwen3.5 9Bqwen3.5:9b6.6 GB11 GB8 GB, short context only / 16 GB
Mistral Nemo 12Bmistral-nemo:12b7.1 GB (q4_K_M: 7.5 GB)13 GB12 GB / 16 GB
Gemma 4 12Bgemma4:12b7.6 GB13 GB12 GB / 16 GB
Gemma 3 12Bgemma3:12b8.1 GB13 GB12 GB / 16 GB
Qwen 2.5 14Bqwen2.5:14b9.0 GB16 GB12 GB / 24 GB
DeepSeek-R1 distill 14B (Qwen 2.5)deepseek-r1:14b9.0 GBnot checked12 GB
Phi-4 14Bphi4:14b9.1 GB16 GB12 GB / 24 GB
Qwen3 14Bqwen3:14b9.3 GB16 GB12 GB / 24 GB
gpt-oss 20B (MoE)gpt-oss:20b14 GB (MXFP4)n/a16 GB
Mistral Small 3.2 24Bmistral-small3.2:24b15 GB26 GB24 GB / 32 GB
Gemma 3 27Bgemma3:27b17 GB30 GB24 GB / 48 GB
Qwen3.5 27Bqwen3.5:27b17 GB30 GB24 GB / 48 GB
Qwen3.6 27Bqwen3.6:27b18 GB (q4_K_M: 17 GB)30 GB24 GB / 48 GB
Gemma 4 26B (MoE, 3.8B active)gemma4:26b19 GB (q4_K_M: 18 GB)28 GB24 GB / 32 GB
Qwen3 30B-A3B (MoE)qwen3:30b19 GBnot checked24 GB
Gemma 4 31Bgemma4:31b20 GB34 GB24 GB / 48 GB
Qwen3 32Bqwen3:32b20 GB35 GB24 GB / 48 GB
Qwen 2.5 32Bqwen2.5:32b20 GB35 GB24 GB / 48 GB
DeepSeek-R1 distill 32B (Qwen 2.5)deepseek-r1:32b20 GBnot checked24 GB
Qwen3.6 35B-A3B (MoE)qwen3.6:35b23 GB (q4_K_M: 24 GB)39 GB32 GB / 48 GB
Qwen3.5 35B-A3B (MoE)qwen3.5:35b24 GB39 GB32 GB / 48 GB
Llama 3.3 70Bllama3.3:70b43 GB75 GB48 GB, tight / 80 GB, tight
Qwen 2.5 72Bqwen2.5:72b47 GBnot checked80 GB
gpt-oss 120B (MoE)gpt-oss:120b65 GB (MXFP4)n/a80 GB

I used the default tag’s size for the tier, since that is what ollama pull with the short name downloads.

The tiers for 24 GB and 32 GB cards have a catch. Ollama’s default context jumps from 4K to 32K at 24 GiB, so a 20 GB model on an RTX 4090 may be given a 32K cache that does not fit next to it. If ollama ps shows a CPU share, set a smaller context. And don’t judge a model by the number in its name: Gemma 4’s edge model gemma4:e4b (4.5B effective parameters) is a 9.6 GB download, larger than gemma4:12b at 7.6 GB. Check the size.

Download size of popular Ollama models at their default 4-bit quantization, compared with 8, 12, 16, 24 and 32 GB of VRAM 8 GB 12 GB 16 GB 24 GB 32 GB VRAM tiers mistral:7b 4.4 qwen2.5:7b 4.7 llama3.1:8b 4.9 qwen3:8b 5.2 qwen3.5:9b 6.6 gemma4:12b 7.6 gemma3:12b 8.1 qwen2.5:14b 9.0 qwen3:14b 9.3 gpt-oss:20b 14 mistral-small3.2:24b 15 gemma3:27b 17 qwen3.5:27b 17 gemma4:31b 20 qwen3:32b 20 qwen3.6:35b 23 0 4 8 12 16 20 24 28 32 Download size in GB (Ollama default tag, 4-bit)
Download sizes of the default 4-bit Ollama tags, drawn to scale against common VRAM sizes. A bar has to end well left of a line to fit: leave about 1 GB for overhead plus room for the KV cache.

Mixture-of-experts models change the picture a little

gpt-oss, Gemma 4 26B and the Qwen “A3B” models are mixture-of-experts (MoE) models. For each token, only a few experts run: Gemma 4 26B has 25.2B parameters but 3.8B active. The memory rule does not change, since all the weights still have to be loaded somewhere. What changes is speed when they do not all fit. Because each token only touches a fraction of the weights, an MoE model that spills into system RAM slows down far less than a dense one of the same size. The measurements in the next section show how big that difference is.

What happens when a model does not fit

Ollama does not refuse to load a model that is too big. It puts as many layers as fit on the GPU and runs the rest on the CPU from system RAM. ollama ps tells you which case you are in: 100% GPU means everything fits, 100% CPU means nothing does, and a mix like 48%/52% CPU/GPU means a split.

A split costs a lot, because generating each token means reading every active weight, and system RAM is much slower than VRAM. A set of llama.cpp runs on a 16 GB RTX 4080, published by Rost on DEV Community in April 2026, shows it clearly:

Model (quant, file size)ContextGPU / CPU loadTokens per second
Qwen3.5 27B dense (IQ3_XXS, 11.5 GB)32K98% / 100%45.1
Qwen3.5 27B dense64K45% / 410%22.7
Qwen3.5 27B dense128K16% / 625%9.6
Qwen3.5 35B-A3B MoE (IQ3_S, 13.6 GB)64K88% / 115%136.8
Qwen3.5 122B-A10B MoE (IQ3_XXS, 44.7 GB)32K30% / 480%21.8

A high CPU figure with a low GPU figure means most of the work moved to the CPU; the author reads the numbers the same way.

The same dense model lost half its speed going from 32K to 64K context, only because the larger KV cache pushed layers off the GPU, and lost almost 80% at 128K. The 122B MoE model, a 44.7 GB file on a 16 GB card, still ran at about 22 tokens per second because only 10B parameters are active per token. For dense models, treat “partly on CPU” as “several times slower”. For MoE models it can be an acceptable trade.

If you hit a split, the fixes in order of cost: lower the context, quantize the KV cache to q8_0, pick a smaller quantization of the same model (Q4_K_M rather than Q5), pick a smaller model, or move to a card with more memory.

32 GB and datacenter cards

The RTX 5090 has 32 GB. That buys you a 32B model at 4-bit with a long context, or the 23 to 24 GB 35B-A3B MoE models with room for cache. It does not get you to 70B: llama3.3:70b is 43 GB even at 4-bit.

For 70B you need 48 GB or more. An L40S has 48 GB, which holds the 43 GB file with little room for context. An H100 SXM has 80 GB (the H100 NVL has 94 GB), which fits Llama 3.3 70B at 4-bit with a long context, gpt-oss 120B (65 GB, and Ollama’s page says it fits on a single 80 GB GPU), or Llama 3.3 70B at Q8_0 (75 GB) with a short one. Qwen3.5 122B at 81 GB is already past a single 80 GB card.

Renting instead of buying: checking a GPUFlow listing

If you rent a GPU on GPUFlow, the provider serves the models from their own machine (with Ollama, which the GPUFlow installer sets up by default) and picks which models are installed. You don’t pull models yourself: you get an OpenAI-compatible API key for that GPU, not a shell. The GPUFlow installer uses qwen2.5:7b by default, and the tags named in the installer and docs are qwen2.5:0.5b, deepseek-r1:1.5b, qwen2.5:7b, deepseek-r1:7b, llama3.1:8b and qwen2.5:14b. Providers can install others.

A GPUFlow marketplace card for an RTX 4090 serving qwen2.5 7B, showing 24 GB VRAM, $0.35 per hour and a Rent Now button

In the marketplace, each card shows the GPU, its VRAM and the price per hour, and the provider’s description lists the models they serve. GPUFlow’s docs give a slightly more cautious version of the same rule: a 7B model runs well on 8 GB or more, a 14B model on 16 GB or more. Once you have a key, GET /v1/models returns one model name; if the description lists more models, you can use those names in the model field too.

Two things to know. GPUFlow does not set a context limit of its own, so Ollama’s defaults on the provider’s machine apply unless the provider changed them. And a model the provider has not installed is not available to you, so pick the listing by the model you need first and the GPU second. Connecting the key to Open WebUI, Continue or LangChain works the same as with any OpenAI-style API.

Sources

All checked in September 2026.

Frequently asked questions

How much VRAM do I need for a 7B model?

About 6 GB at the 4-bit quantization Ollama uses by default. The qwen2.5:7b download is 4.7 GB, and you need room on top for the KV cache and runtime overhead, so an 8 GB card runs it well at normal context lengths. At Q8_0 the same model is 8.1 GB, which needs a 12 GB card.

Can a 14B model run on a 12 GB GPU?

Yes at short context. The 4-bit Ollama builds of Qwen 2.5 14B, Qwen3 14B and Phi-4 are 9.0 to 9.3 GB, which leaves 2 to 3 GB for KV cache and overhead. With long prompts the KV cache grows and part of the model moves to the CPU, so 16 GB is the comfortable size.

What is the largest model that fits on a 24 GB GPU like the RTX 4090 or RTX 3090?

Dense models of about 27B to 32B parameters at 4-bit. Gemma 3 27B is 17 GB, and Qwen3 32B and Gemma 4 31B are 20 GB in Ollama. A 70B model at 4-bit is 43 GB and needs two cards or a 48 GB datacenter GPU.

Is Q4_K_M much worse than FP16?

Only a little on most tasks. On Llama 3 8B, llama.cpp's own measurements show perplexity rising from 6.233 at F16 to 6.407 at Q4_K_M, and a 2026 benchmark study of Llama 3.1 8B Instruct found an average score of 69.15 at Q4_K_M against 69.47 at F16. Below 4 bits the loss grows fast.

What happens if a model doesn't fit in VRAM?

Ollama still loads it, but puts some layers in system RAM and runs them on the CPU. The model works, just much slower. Run ollama ps and look at the PROCESSOR column: 100% GPU means it fits, a split such as 48%/52% CPU/GPU means it does not.

How do I calculate the VRAM a model needs?

Parameters times bits per weight divided by 8 gives the weights in bytes. Add the KV cache (2 x layers x KV heads x head size x 2 bytes per token, times the context length) and about 1 GB for the runtime. For Qwen 2.5 14B at Q4_K_M and 16K context that is about 9.0 + 3.2 + 1 = 13.2 GB.