bitsrun

LLM VRAM calculator

Pick a model, a precision and how much context you need. See the GPU memory it takes, which GPU fits and what that costs per hour. Free, and no account needed.

Qwen3 8B: 36 layers, 8 KV heads of 128, from its config.json.

Requests at once

llama.cpp keeps a full context for each request at once.

GPU memory needed

7.7 GB

Weights
5.0 GB
Cache
1.2 GB
Runtime
1.5 GB

Cheapest BitsRun GPU that fits

NVIDIA L4, 24 GB

$0.95 per hour, billed per second

Longest context there: 40,960 tokens per request. Speed: about 36 tokens a second for one request (estimate).

  • NVIDIA L4Fits
  • NVIDIA L40SFits
  • 4x NVIDIA L4Fits

How the memory adds up

A model needs GPU memory for three things:

  1. Weights: the model itself. Parameters times bits per weight, divided by 8. An 8B model at Q4_K_M (about 4.9 bits) is about 5 GB, and at 16-bit it is about 16 GB.
  2. KV cache: the working memory for the text the model is reading. Per token it is 2 x layers x KV heads x head size x 2 bytes. Qwen3 8B uses 147,456 bytes a token, so 32,768 tokens take about 4.8 GB.
  3. Runtime: about 1.2 GB for llama.cpp, or 2 GB plus a safety margin for vLLM.

The calculator uses the same rules as the BitsRun model sizer. For a full walk-through, read How much VRAM do you need to run an LLM.

Common models at a glance

Memory needed and GPU for common models at Q4
Model (Ollama, Q4)Memory neededGPU and price
Qwen3 8B7.9 GBNVIDIA L4, $0.95/h
Qwen3 14B13 GBNVIDIA L4, $0.95/h
Qwen3 32B26 GBNVIDIA L40S, $3.20/h
Qwen3 30B A3B24 GBNVIDIA L4, $0.95/h
Qwen2.5 Coder 7B Instruct7.2 GBNVIDIA L4, $0.95/h
Qwen2.5 Coder 32B Instruct25 GBNVIDIA L40S, $3.20/h
Llama 3.1 8B Instruct7.5 GBNVIDIA L4, $0.95/h
Llama 3.3 70B Instruct53 GB4x NVIDIA L4, $8.52/h

More in the model list.

Frequently asked questions

How do I calculate the VRAM an LLM needs?
Add the weights (parameters times bits per weight, divided by 8), the KV cache (2 x layers x KV heads x head size x 2 bytes, for every token of context and every request at once) and about 1 to 2 GB for the runtime.
How much VRAM does an 8B model need?
About 5 GB of weights at Q4_K_M, so roughly 7 to 8 GB in total with a normal context. At full 16-bit precision the weights alone are about 16 GB.
Why does context length change the memory needed?
The model keeps a cache of every token it has read. The cache grows in step with the context and with the number of requests served at once, and at long contexts it can be larger than the weights.
Is this the exact number BitsRun uses?
It uses the same rules as the model sizer, which reads the real file sizes. Run Check model in the dashboard or bitsrun size <model> for the exact answer before you deploy.

Try it on your own model

Sign up with your email, add $10 of credit and deploy from an Ollama name or a Hugging Face repo. An L4 costs $0.95 an hour, billed per second only while your model is awake. Waking up is never billed, and credit you buy does not expire.