How much VRAM do AI models need? A practical guide
Ask “can my computer run this AI model?” and the answer almost always comes down to one number: VRAM, the memory on your graphics card. Too little and the model simply won't load; enough and it runs. This guide explains what VRAM is, why AI models are so hungry for it, how to estimate a model's appetite from two facts you can look up in seconds, and roughly how much real models — from a 7-billion-parameter chatbot to Llama 405B and the image generators behind today's art tools — actually demand.
What VRAM actually is
VRAM (video RAM) is the dedicated memory that lives on the graphics card itself, right next to the GPU. It is physically separate from your computer's main system RAM. When a program wants the GPU to compute something, the data has to be sitting in VRAM first — the GPU's thousands of cores can't reach into system RAM at usable speed.
Two things make VRAM special. The first is capacity: how many gigabytes it holds. The second, and just as important for AI, is bandwidth: how fast data moves between the memory and the GPU. Consumer cards use a memory type called GDDR — NVIDIA's GeForce RTX 5090, for instance, ships with 32 GB of GDDR7 running at about 1,792 GB/s.1 Data-center accelerators go a step further and use HBM (high-bandwidth memory), which stacks memory chips vertically and connects them with an extremely wide bus to reach far higher bandwidth than GDDR — which is exactly why HBM is standard on the GPUs used to train large models.2
Why AI models live in VRAM
A neural network is, at heart, a very large pile of numbers called parameters (or weights). To run the model, every one of those numbers has to be held in memory the GPU can read at speed. On top of the weights, running a model needs room for three more things:
- Activations — the intermediate results computed as data flows through the network.
- The KV cache — for language models, a running store of past context that grows with how much text you feed in (more on this below).
- Overhead — temporary buffers and workspace the framework needs.
Because modern models are dominated by huge matrix multiplications that stream weights through the cores, they tend to be memory-bandwidth-bound: the GPU often finishes the arithmetic faster than memory can feed it. That is why both the size and the speed of VRAM matter, and why “just add more system RAM” doesn't help.
The one formula that matters
Here's the trick that lets you estimate almost any model's memory in your head. A model's weight memory is simply its parameter count × the number of bytes used to store each parameter. That second factor is the model's precision, and it's the single biggest lever you control:
| Precision | Bytes / parameter | Memory for a 7B model (weights) |
|---|---|---|
| FP32 (full) | 4 | ~28 GB |
| FP16 / BF16 (half) | 2 | ~14 GB |
| INT8 / FP8 (8-bit) | 1 | ~7 GB |
| INT4 (4-bit) | 0.5 | ~3.5 GB |
So the rule of thumb is: a model with N billion parameters needs about N×2 GB of VRAM at FP16, or N×0.5 GB at 4-bit, just for the weights. Hugging Face's own memory estimator uses exactly this arithmetic — multiply parameters by bytes-per-parameter — and then adds up to about 20% on top for the activations and workspace that inference needs.3
weight memory (GB) = params (billions) x bytes_per_param
inference VRAM ≈ weight memory x 1.2 # +~20% overhead
# Example: a 7B model at FP16
# 7 x 2 = 14 GB weights -> ~17 GB to actually run
# The same model at 4-bit
# 7 x 0.5 = 3.5 GB -> ~4-5 GB to runInference vs. training: a 10× difference
Everything above is for inference — running a finished model. Training (or full fine-tuning) is a different universe. To update weights, the GPU must also hold gradients and the optimizer's bookkeeping. For the standard mixed-precision setup with the AdamW optimizer, Hugging Face breaks the cost down to roughly 18 bytes per parameter: about 6 for two copies of the weights, 8 for Adam's momentum and variance, and 4 for the gradients — and that's before activations.4
Concretely, fully fine-tuning a 7B model can require on the order of 7 × 18 ≈ 126 GB — far past any single consumer GPU. This memory blow-up is precisely what techniques like ZeRO were designed to attack, by splitting the optimizer states, gradients, and weights across many GPUs instead of duplicating them.7 It is also why almost nobody full-fine-tunes at home; they use parameter-efficient methods instead (see quantization, below).
The hidden cost: the KV cache and context length
Language models based on the Transformer use attention, which lets each new token look back at every previous token.5 To avoid recomputing the past on every step, the model caches the “keys” and “values” for all previous tokens — the KV cache. The catch: this cache grows with the number of tokens in play, so a long conversation or a 100,000-token document can consume many gigabytes on its own, on top of the weights. Serving many users at once multiplies it further. Managing this memory efficiently is such a hard problem that it spawned dedicated systems like vLLM's PagedAttention, which treats the KV cache like virtual memory to stop it from wasting VRAM.6
Quantization: how models got small enough to run at home
Quantization stores each weight in fewer bits — 8-bit or even 4-bit instead of 16 — shrinking the model with surprisingly little quality loss. It is the reason a laptop can run models that once needed a server. The landmark result is QLoRA, which introduced a 4-bit data type (NF4) and paged optimizers to fine-tune a 65-billion-parameter model on a single 48 GB GPU while keeping the quality of full 16-bit fine-tuning.8 For plain inference, 4-bit roughly quarters the FP16 footprint: that 7B model drops from ~14 GB to ~3.5 GB.3
How much VRAM real models need
Putting it together, here are ballpark figures for popular models. These are approximate weights-only numbers from the parameter-count-×-precision rule; add headroom for context and overhead as discussed.
Large language models
| Model | Parameters | FP16 | 4-bit |
|---|---|---|---|
| Mistral 7B10 | 7B | ~14 GB | ~4 GB |
| Llama 3.1 8B9 | 8B | ~16 GB | ~5 GB |
| Llama 3.1 70B9 | 70B | ~140 GB | ~40 GB |
| Llama 3.1 405B9 | 405B | ~810 GB | ~230 GB |
The jump is stark. An 8B model is comfortable on a mid-range gaming card; the 70B needs a high-end 48 GB workstation card (or two 24 GB cards) even at 4-bit; and Llama 405B — a model Meta trained on a cluster of more than 16,000 H100 GPUs — needs a multi-GPU server no matter how aggressively you quantize.9
Image, video, and speech models
| Model | Size | Typical VRAM to run |
|---|---|---|
| Stable Diffusion 1.512 | ~0.9B UNet | 4 GB min, 6–8 GB comfortable |
| SDXL11 | 2.6B UNet | 8 GB min, 12 GB recommended |
| FLUX.1 [dev]13 | 12B | ~24 GB (FP16); ~12 GB (FP8); 6–8 GB (4-bit) |
| Whisper large14 | 1.5B | ~3–5 GB |
Note how much heavier FLUX.1 is than the Stable Diffusion family: with about 12 billion parameters in its diffusion transformer, it needs roughly 24 GB at half precision — though FP8 halves that to about 12 GB, and 4-bit builds squeeze it onto 8 GB cards.13 Whisper's speech models, by contrast, span a wide range: the family runs from a 39-million-parameter “tiny” up to the 1.5-billion-parameter “large,” so you can pick a size to fit almost any card.14
Matching models to graphics cards
To translate all of this into a shopping decision, here's where common GPUs land. Capacity is what determines whether a model fits; bandwidth largely determines how fast it runs once it does.
| GPU | VRAM | Memory type | Comfortable with |
|---|---|---|---|
| RTX 3060 | 12 GB | GDDR6 | 7–8B LLMs (4-bit), SD 1.5, SDXL |
| RTX 4090 | 24 GB | GDDR6X | 8B LLMs (FP16), ~30B (4-bit), FLUX.1 |
| RTX 50901 | 32 GB | GDDR7 | Larger 4-bit models, headroom for context |
| A100 / H10015 | 80 GB | HBM2e / HBM3 | 70B-class models; the workhorses of training |
Rules of thumb to remember
- Weights ≈ parameters × bytes-per-parameter. FP16 = 2 bytes, 4-bit = 0.5 bytes. A 13B model is ~26 GB at FP16, ~6.5 GB at 4-bit.3
- Add ~20% for inference, and much more for long context or large batches.3
- Training costs ~10× inference because of gradients and optimizer states (~18 bytes/param).4
- Quantize to fit. 4-bit is the great equalizer — it's what puts capable models on ordinary hardware.8
- Capacity decides if it runs; bandwidth decides how fast. Both are properties of VRAM, and neither can be substituted with system RAM.2