Cloud Pick Guide

Home / GPU VRAM calculator

GPU VRAM calculator for LLMs

Pick a model, precision, context and number of users. The calculator adds up weights, KV cache and overhead, then lists the cheapest on-demand cloud GPUs that hold it.

  • Weights + KV cache + overhead
  • 6 model presets or custom
  • Cheapest GPUs that fit
  • Runs in your browser

Some links on this page are affiliate links.

On this page
  1. Calculator
  2. Popular models
  3. KV cache size
  4. Making a model fit
  5. Questions people ask

How it works

  • Weights = parameters × bytes per parameter: 2 at 16-bit, 1 at 8-bit, about 0.56 at 4-bit (including quantisation scales).
  • KV cache = 2 × layers × KV heads × head size × bytes × context × users. It grows with every token and every user.
  • Overhead = about 10% of the weights plus 1 GB for the CUDA context and serving software.
  • The calculator then lists the cheapest on-demand GPUs that fit, from our GPU price data.

GPU VRAM calculator

GPU memory needed
—
Weights
—
KV cache
—
Overhead
—

Cheapest GPUs that fit, on demand:

  • Turn on JavaScript to use the calculator.
Try a GPU on $300 of credit

Vultr GPUs open now for this: A40 ($1.712/h, 2 regions) and A100 80 GB ($2.397/h, New Jersey).

Memory for popular models at an 8K context

One request at a time, 16-bit KV cache. Under each figure, the smallest GPU setup that holds it with 5% to spare.

Model16-bit8-bit4-bit
Llama 3.1 8B20 GB1 × 24 GB11 GB1 × 24 GB7 GB1 × 24 GB
Qwen2.5 7B18 GB1 × 24 GB10 GB1 × 24 GB6 GB1 × 24 GB
Qwen2.5 14B35 GB1 × 48 GB19 GB1 × 24 GB12 GB1 × 24 GB
Qwen2.5 32B75 GB1 × 80 GB39 GB1 × 48 GB23 GB1 × 48 GB
Llama 3.3 70B159 GB1 × 180 GB81 GB1 × 141 GB47 GB1 × 80 GB
Qwen2.5 72B164 GB1 × 180 GB84 GB1 × 141 GB49 GB1 × 80 GB

How big the KV cache gets

Per token at 16-bit, and for a full 32K-token context. Models with fewer KV heads (grouped-query attention) keep the cache small; multiply by the number of requests served at once.

ModelLayersKV headsPer token32K tokens
Llama 3.1 8B3280.13 MB4.3 GB
Qwen2.5 7B2840.06 MB1.9 GB
Qwen2.5 14B4880.20 MB6.4 GB
Qwen2.5 32B6480.26 MB8.6 GB
Llama 3.3 70B8080.33 MB10.7 GB
Qwen2.5 72B8080.33 MB10.7 GB

Making a model fit

  • Lower the weight precision. 8-bit roughly halves the weights with little quality loss; 4-bit quarters them, with some loss on harder tasks.
  • Cap the context. Serving software reserves memory for the longest context you allow. In vLLM, set --max-model-len; in Ollama, the context length setting.
  • Use an 8-bit KV cache if your server supports it: it halves the cache.
  • Split across GPUs only when you must: 2, 4 or 8 GPUs, and the price scales with them.

Next: which GPU for LLM inference, and how to serve a model with vLLM or Ollama.

Sources

Questions people ask

How much VRAM do I need to run an LLM?

Model weights (parameters times bytes per parameter), plus the KV cache for your context and users, plus about 10% and 1 GB for the serving software. An 8B model at 16-bit with an 8K context needs about 20 GB; a 70B model at 4-bit about 47 GB.

What is the KV cache?

The keys and values a model keeps for every token already in the context, so it does not recompute them. It grows with context length and with the number of requests served at once, and can be larger than the model on long contexts.

Does quantising the model shrink the KV cache?

No. Weight precision and KV cache precision are separate settings. Servers such as vLLM can store the KV cache in 8-bit (FP8), which halves it; pick that in the calculator.

Why does the calculator jump from 1 to 2, 4 or 8 GPUs?

Serving software splits a model across GPUs in powers of two (tensor parallelism), and cloud servers come with 1, 2, 4 or 8 GPUs.

How accurate is this?

Within a few gigabytes for standard dense models. Real use varies with the serving software, its settings and the model architecture. Leave headroom, then test on an hourly GPU before committing.

Up to $300 free creditClaim credit