OcxlyDev · Guide

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

VRAM vs. system RAM. They are not interchangeable. You can have 128 GB of system RAM and still fail to load a model that needs 16 GB of VRAM. When a model doesn't fit, some tools “offload” part of it to system RAM — but every byte that lives in system RAM must cross the comparatively slow PCIe link on each use, so performance falls off a cliff.

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:

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:

Bytes per parameter by numeric precision. Lower precision = smaller model, at some cost to accuracy.3
PrecisionBytes / parameterMemory 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

the estimate, in plain arithmetic
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 run
Why this is only an estimate. The formula nails the weights, which dominate. The +20% for activations and KV cache is a starting point — long prompts, big batches, and high image resolutions can push overhead much higher, as the next two sections explain.

Inference 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

Practical takeaway. When a model card says “8 GB,” that's usually the weights at a given precision. Budget headroom for context: a model that loads in 8 GB may need 10–12 GB once you feed it long prompts or run several requests in parallel.

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

LLM weight memory by precision. Parameter counts from the model publishers.
ModelParametersFP164-bit
Mistral 7B107B~14 GB~4 GB
Llama 3.1 8B98B~16 GB~5 GB
Llama 3.1 70B970B~140 GB~40 GB
Llama 3.1 405B9405B~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

Non-LLM models. Image generators also need VRAM for the latent image, which grows with resolution.
ModelSizeTypical VRAM to run
Stable Diffusion 1.512~0.9B UNet4 GB min, 6–8 GB comfortable
SDXL112.6B UNet8 GB min, 12 GB recommended
FLUX.1 [dev]1312B~24 GB (FP16); ~12 GB (FP8); 6–8 GB (4-bit)
Whisper large141.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.

A rough VRAM ladder. Data-center cards use HBM for far higher bandwidth than consumer GDDR.
GPUVRAMMemory typeComfortable with
RTX 306012 GBGDDR67–8B LLMs (4-bit), SD 1.5, SDXL
RTX 409024 GBGDDR6X8B LLMs (FP16), ~30B (4-bit), FLUX.1
RTX 5090132 GBGDDR7Larger 4-bit models, headroom for context
A100 / H1001580 GBHBM2e / HBM370B-class models; the workhorses of training

Rules of thumb to remember

About this piece. A guide from OcxlyDev. Figures are approximate, weights-focused estimates derived from published parameter counts and the standard precision arithmetic; real-world usage varies with framework, context length, batch size, and image resolution. Every claim links to a primary source — model publishers, the memory-estimation docs, or the original research papers.

References

  1. NVIDIA — GeForce RTX 5090 (32 GB GDDR7; memory bandwidth and specifications)
  2. High Bandwidth Memory (HBM) — 3D-stacked DRAM and wide-bus bandwidth vs. GDDR (encyclopedic overview)
  3. Hugging Face — Model memory estimator: bytes per parameter by precision and the ~20% inference overhead
  4. Hugging Face — Model memory anatomy: ~18 bytes/parameter for mixed-precision AdamW training (weights, optimizer states, gradients)
  5. Vaswani et al. (2017) — "Attention Is All You Need" (the Transformer and attention)
  6. Kwon et al. (2023) — "Efficient Memory Management for Large Language Model Serving with PagedAttention" (vLLM; KV-cache memory)
  7. Rajbhandari et al. (2020) — "ZeRO: Memory Optimizations Toward Training Trillion Parameter Models"
  8. Dettmers et al. (2023) — "QLoRA: Efficient Finetuning of Quantized LLMs" (4-bit NF4; 65B on a single 48 GB GPU)
  9. Meta / Hugging Face — "Llama 3.1: 405B, 70B & 8B" (parameter sizes, 128K context, training scale)
  10. Jiang et al. (2023) — "Mistral 7B" (7-billion-parameter model)
  11. Podell et al. (2023) — "SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis" (2.6B UNet)
  12. Rombach et al. (2022) — "High-Resolution Image Synthesis with Latent Diffusion Models" (the basis of Stable Diffusion)
  13. Black Forest Labs — FLUX.1 [dev] model card (~12B-parameter diffusion transformer; VRAM by precision)
  14. Radford et al. (2022) — "Robust Speech Recognition via Large-Scale Weak Supervision" (Whisper; model sizes 39M–1.5B)
  15. NVIDIA — H100 Tensor Core GPU (80 GB HBM; data-center training accelerator)