GuideDec 5, 20264 min read

How Much VRAM Do You Need for an LLM? (Llama, Qwen, Mistral)

How much GPU memory local language models need at 4-bit and 16-bit, which models fit on 12, 16 and 24 GB cards, and why memory bandwidth decides how fast they answer.

Short answer: for the usual 4-bit models, count about 0.6 GB of GPU memory per billion parameters, plus 1 to 4 GB for the context. An 8B model needs about 6 GB, a 14B model about 10 GB, a 32B model about 20 GB. At full 16-bit precision it is about 2 GB per billion, so the same 8B model needs about 16 GB.

The rule is simple because a language model is mostly its weights. Each parameter is a number, and the precision decides how many bytes each number takes.

01The Formula

PrecisionBytes per parameterVRAM per billion parameters
16-bit (FP16, BF16)2about 2 GB
8-bit (Q8)1about 1 GB
4-bit (Q4_K_M, AWQ, GPTQ)about 0.55about 0.6 GB

On top of the weights comes the KV cache, the memory the model uses to keep the conversation in view. It grows with the context length: a few hundred MB for a short chat, several GB for a 32,000 token context on a larger model. Leave 1 to 4 GB free for it.

4-bit is what most people run. The quality loss against 16-bit is small for chat, coding and summaries, and it lets a card run a model about three times larger.

02Which Models Fit on Which Card

Measured as the 4-bit download size plus room for a normal context:

Model, 4-bitVRAM needed12 GB card16 GB card24 GB card
Llama 3.1 8Babout 6 GBFitsFitsFits
Qwen 2.5 14Babout 10 GBTight, short contextFitsFits
Mistral Small 24Babout 15 GBNoTightFits
Qwen 2.5 32Babout 20 GBNoNoFits
Llama 3.3 70Babout 40 GBNoNoNo
Stable Diffusion XL (images)about 9 GBFitsFitsFits

When a model does not fit, Ollama and llama.cpp move part of it to the CPU and system RAM. It still runs, but every token then waits on the slower side, and answers can drop to a fraction of the speed. Pick a card the model fits on whole.

03Bandwidth Decides the Speed

Generating text reads the whole model from GPU memory for every token. So once a model fits, the speed depends mostly on how fast the card can read its memory. The spec sheet figures:

CardVRAMMemory bandwidth
RTX A200012 GB GDDR6288 GB/s
RTX 2000 Ada16 GB GDDR6224 GB/s
RTX 309024 GB GDDR6X936 GB/s

The RTX 3090 reads memory about three times faster than the RTX A2000, so the same 8B model answers roughly three times as fast on it. The two smaller cards are about equal in speed; the 2000 Ada has more room, the A2000 slightly more bandwidth.

For one person chatting with an 8B model, the A2000 is already faster than reading speed. The 3090 matters when several people or agents use the model at once, when you run 24B to 32B models, or when you train.

04Training Needs More

Fine-tuning needs memory for the weights, the gradients and the optimizer, several times the size of the model. With LoRA or QLoRA you train a small add-on instead of the whole model, and a 24 GB card can fine-tune 7B to 13B models that way. Full fine-tuning of anything but small models needs more than one card.

05Picking a Server

You want toCardOur server
Chat with an 8B model, make images12 GBRTX A2000 GPU VPS, Amsterdam, $129 a month
Run 14B models or longer contexts16 GBRTX 2000 Ada GPU VPS, Kansas City, $139 a month
Run 24B to 32B models, train LoRAs24 GBRTX 3090 dedicated server, Kansas City, $499 a month

On all of them the card is yours alone, never shared. How to set one up with Ollama and a chat interface is in How to Self-Host an LLM on a GPU Server.

About 6 GB at 4-bit with a normal context, about 16 GB at 16-bit. A 12 GB card runs the 4-bit version with room to spare.

  • how much vram for llm
  • vram for llama
  • gpu for local llm
  • llm gpu memory
  • vram calculator
  • rtx 3090 llm
  • rtx a2000 llm

Keep reading

All articles