How much VRAM do you need to run an LLM locally? The simple math

How much VRAM do you need to run an LLM locally? The simple math

This article was written with AI assistance and edited by a person.

Black-and-white close-up of a computer circuit board
Photo by Miguel Á. Padriñán on Pexels

A plain-English formula for working out how much GPU memory a local AI model needs, with worked examples for 8GB, 12GB, 16GB and 32GB cards.

"How much VRAM do I need" is one of the most common questions from people who want to run AI models on their own machine. You don't need a benchmark site to answer it. You need one formula and a bit of headroom.

Step 1: weights

A model's weights take up roughly:

GB ≈ parameters (in billions) × bits per weight ÷ 8

Model size 16-bit 8-bit 4-bit
8B 16 GB 8 GB 4 GB
14B 28 GB 14 GB 7 GB
32B 64 GB 32 GB 16 GB
70B 140 GB 70 GB 35 GB
120B 240 GB 120 GB 60 GB

Real quantized files usually come out a little bigger than this, because they also store scaling information. Check the actual file size on the model page.

Step 2: context (the KV cache)

While the model works through your prompt, it keeps a KV cache for every token in the context. That cache lives in VRAM too, and it grows with context length.

The formula:

KV cache bytes ≈ 2 × layers × KV heads × head size × bytes per value × tokens

You'll find layers, KV heads and head size in the model's config.json. As a worked example, take a model shape with 32 layers, 8 KV heads and a head size of 128, storing the cache at 16-bit (2 bytes):

  • Per token: 2 × 32 × 8 × 128 × 2 = 131,072 bytes (128 KB)
  • 32k-token context (32,768 tokens): 4 GiB, about 4.3 GB
  • 128k-token context (131,072 tokens): 16 GiB, about 17 GB

So a model that fits nicely at short context can run out of memory when you paste in a whole codebase. Newer models use tricks to shrink this cache; see how DeepSeek V4.1 Flash tackles it.

Step 3: headroom

The runtime, the desktop and other apps also use VRAM. As a rule of thumb, don't plan to fill more than about 85–90% of the card.

Total ≈ weights + KV cache + headroom.

What fits on RTX 50 cards

VRAM and starting prices are from NVIDIA's RTX 50 page as of Oct 22, 2026. "Fits" means weights at 4-bit plus some context, by the arithmetic above.

Card VRAM Memory bandwidth Comfortable at 4-bit
RTX 5050 (from $249) 8GB GDDR6 320 GB/s ~8B, short context
RTX 5060 (from $299) 8GB GDDR7 448 GB/s ~8B, short context
RTX 5060 Ti 8GB / 16GB (from $379) 8 or 16GB 448 GB/s ~8B (8GB) or ~14B (16GB)
RTX 5070 12GB 672 GB/s ~8B with longer context, ~14B tight
RTX 5070 Ti (from $749) 16GB 896 GB/s ~14B with room for context
RTX 5080 16GB 960 GB/s ~14B with room for context
RTX 5090 32GB 1,792 GB/s ~32B (16GB weights) with long context

Two things to notice:

  • Two 16GB cards can feel very different. Token speed depends heavily on memory bandwidth, and the 5060 Ti 16GB has about half the bandwidth of the 5080.
  • 70B is a two-GPU (or rental) model. At 4-bit it needs ~35GB for weights alone.

Street prices have moved with the memory crunch, so check current listings. Our explainer on RAM prices covers why.

Buy or rent?

If you only need a big model for a weekend project, renting may be the better deal. On Oct 22, 2026, Runpod listed an RTX 5090 at $0.69/hour (Community Cloud) or $1.19/hour (Secure Cloud). At those rates, 40 hours a month for four months costs about $110–$190. For bigger models, see what it costs to rent an H100, B200 or B300.

To run these numbers for your own model and card, use our local AI hardware sizing sheet.

Running models locally pairs nicely with keeping your data on your own machine. More on that in own your code and data.

FAQ

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

About 4GB for the weights at 4-bit, 8GB at 8-bit, 16GB at 16-bit, plus room for context. An 8GB card handles an 8B model at 4-bit with modest context.

Can I run a 70B model on an RTX 5090?

Not fully in VRAM at 4-bit. 70B × 4 ÷ 8 = 35GB for weights alone, and the 5090 has 32GB. You'd need lower-bit quantization, offloading to system RAM (much slower), or two GPUs.

Does system RAM count?

Runtimes can offload layers to system RAM, but generation slows sharply because system RAM is far slower than VRAM. Treat VRAM as the real limit.

Is 4-bit quantization good enough?

For many chat and coding tasks it's a common trade-off, but quality drops vary by model and method. Test on your own prompts before committing.

What about mixture-of-experts models?

MoE models only use some of their parameters per token, which speeds things up, but all the weights still need to be loaded somewhere. Size them by total parameters, not active ones.

Sources

  1. NVIDIA, GeForce RTX 50 Series graphics cards (specs and starting prices)https://www.nvidia.com/en-us/geforce/graphics-cards/50-series/
  2. Runpod, GPU Cloud Pricing (updated Oct 8, 2026)https://www.runpod.io/pricing

Report a correction

Before you go
Matching resources

Matching resources

Keep reading

Keep reading

Newsletter

The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.