Skip to content
HIPS
  • Earn with your GPU
  • Pricing
  • Docs
Sign inJoin early access
01VRAM calculator_
  1. Home
  2. /Tools
  3. /VRAM calculator

LLM VRAM calculator

This LLM VRAM calculator estimates how much GPU memory a model needs: its weights at the precision you choose, plus the cache that grows with every token of context it keeps. Pick a model and your GPU's memory to see whether it fits, how much context fits beside it, and which formula each number comes from.

HIPS's catalog cannot be read right now, so this tool has no models to show. Reload the page in a minute.

Turn on JavaScript to try your own model and GPU. The example below uses the same formulas.

We are inviting early-access interest while we develop the platform.

Join early accessRent out your GPU

How the VRAM calculator works

A model on a GPU holds three things in memory:

  1. The weights. Every parameter of the model, stored at the precision you choose. For most models this is the largest part, and it does not change while the model runs.
  2. The context cache. While a model reads and writes, it keeps two vectors, a key and a value, for every token in every attention layer, so it does not compute them again for each new token. This cache grows with every token of context, and each request served at once keeps its own.
  3. The engine's working memory. The serving engine needs room for its own buffers and for the GPU's software. It depends on the engine, its settings and the GPU, so this calculator does not estimate it; it shows how much room is left for it.

The calculator adds the first two and sets the total against your GPU's memory.

The formulas and their sources

Weights

weights in bytes = parameters × bits per weight ÷ 8

Stored asBits per weight usedSource
BF16 or F1616The formats' definition: 16-bit numbers
FP88The format's definition: 8-bit numbers (a model's scale factors on top are not counted)
Q8_08.5008llama.cpp's quantize documentation, measured on Llama 3.1 8B
Q4_K_M4.8944The same table. Q4_K_M mixes types per tensor, so another model's file can differ slightly
MXFP44.25The Open Compute Project's Microscaling (MX) specification v1.0, Table 1: 4-bit elements with one 8-bit scale for every 32

Context cache, for a layer that attends to every token

cache per token = 2 × layers × key-value heads × head dimension × bytes per number

  • The 2 counts the key and the value. DeepSeek's DeepSeek-V2 paper gives the per-token cache of grouped-query attention as 2 × groups × head dimension × layers numbers, and of multi-head attention as the same with every head counted.
  • The PagedAttention paper works one example through: for a 13-billion-parameter OPT model, "the KV cache of a single token demands 800 KB of space, calculated as 2 (key and value vectors) × 5120 (hidden state size) × 40 (number of layers) × 2 (bytes per FP16)."
  • Bytes per number: 2, since llama.cpp keeps its cache at 16 bits unless told otherwise (its server's default cache type is f16).

Three kinds of layer that change the sum

  • Sliding-window layers attend only to the last few thousand tokens, so their cache stops growing at the window. The Mistral 7B paper: "The cache has a fixed size of W". The calculator counts these layers up to their window and no further.
  • Recurrent and linear-attention layers, such as the Mamba layers of NVIDIA's Nemotron models and the Gated DeltaNet layers of the Qwen3.5 family, keep a state of fixed size instead of a cache per token. NVIDIA's Nemotron-H paper describes Mamba layers that "require constant memory per generated token". The calculator counts the cache of the attention layers only.
  • Latent attention, used by DeepSeek's models, stores one compressed vector per token and layer instead of keys and values for every head. The DeepSeek-V2 paper gives its cache per token as the compressed dimension plus the rotary key dimension, times the layers.

Total = weights + cache per token × tokens kept × requests served at once. The calculator counts memory in GiB, 1,073,741,824 bytes.

Can I run this LLM on my GPU?

Pick the model, its precision, the context you need and your GPU's memory, and the verdict line answers it. The answer depends on the context as much as on the model: a model that fits with a short conversation can stop fitting with a long document, because the cache grows with every token while the weights stay the same.

The example below is worked with the formulas above. The same arithmetic runs for every model in the picker.

Example: Qwen3 30B A3B Instruct 2507 on a GPU with 24 GiB

StepArithmeticResult
ParametersFrom HIPS's catalog30,533,947,392
Weights at Q4_K_M30,533,947,392 × 4.8944 ÷ 817.40 GiB
Cache per token2 × 48 layers × 4 key-value heads × 128 head dimension × 2 bytes96 KiB
Cache for 32,768 tokens, one request32,768 × 96 KiB3.00 GiB
Total17.40 + 3.0020.40 GiB
Left on a 24 GiB GPU24 − 20.403.60 GiB, for the engine's own working memory

Verdict: Fits, with 3.60 GiB left for the engine's own working memory.

At its full context of 262,144 tokens: the cache alone is 24.00 GiB, so weights and cache need 41.40 GiB and it does not fit on this GPU. About 72,100 tokens of context fit beside the weights, before the engine's own memory.

When it does not fit

  • Keep less context. Halving the context halves the cache.
  • Pick a smaller precision. Q4_K_M takes under a third of BF16's memory for the same weights, with some change to the model's answers.
  • Use a GPU with more memory. GPU rental on HIPS runs your container on an NVIDIA RTX PRO 6000 Blackwell with 96 GB, billed by the millisecond.
  • Call the model instead. If the model is in HIPS's catalog, call it through the API and pay per token, with no GPU to size. Each model in the picker links to its page.

Own a GPU with memory to spare?

Rent out your GPU. Earn from AI inference. The HIPS provider app runs AI inference on your GPU for HIPS's buyers. When one of your own jobs starts on a GPU, the app takes no new work there, stops the running job within seconds and frees the GPU's memory. See how earning works or download the GPU provider software.

VRAM calculator questions

How much VRAM does an LLM need?

Its weights plus its context cache plus the engine's own working memory. For the weights, multiply the parameter count by the bits per weight of its format and divide by 8: an 8-billion-parameter model takes about 16 GB at BF16 and about 5 GB at Q4_K_M. The cache depends on the model's layers and on how much context you keep.

How much VRAM do I need for an 8B model?

Take granite 4.2 8b, with 8,791,592,960 parameters: its weights take about 16.38 GiB at BF16, 8.70 GiB at Q8_0 and 5.01 GiB at Q4_K_M. Each token of context adds 160 KiB, so 8,192 tokens add 1.25 GiB and 32,768 tokens add 5.00 GiB. At Q4_K_M with 8,192 tokens of context it needs about 6.26 GiB before the engine's own memory.

Can gpt oss 20b run on a 16 GB GPU?

OpenAI says so for its own setup: its model card says MXFP4 quantization of the MoE weights makes "the gpt-oss-20b model run within 16GB of memory", and gpt-oss-120b "run on a single 80GB GPU (like NVIDIA H100 or AMD MI300X)". Both figures are OpenAI's, from its card; the room left for context depends on how much you keep.

Does a mixture-of-experts model need memory for every expert?

Yes, for this calculator: it counts every parameter, since all the experts' weights are loaded on the GPU even though only some of them run for each token. Some engines can keep part of the experts in the computer's main memory instead, which this calculator does not model.

Why does a long context take so much memory?

Because the cache keeps a key and a value for every token in every attention layer. For Qwen3 30B A3B Instruct 2507 that is 96 KiB per token, so its full context of 262,144 tokens needs 24 GiB of cache for one request, more than its weights at Q4_K_M.

Is the estimate exact?

No. A model file's real size depends on how its tensors were quantized, and the engine needs working memory that varies with its settings. Treat the total as the least the model needs, and leave room beside it.

What is the difference between Q4_K_M and BF16?

BF16 stores each weight in 16 bits, the precision most models are published in. Q4_K_M, a format of llama.cpp, stores most weights in about 4 bits, and measured 4.8944 bits per weight on Llama 3.1 8B in llama.cpp's own table. The file is about a third the size, and the model's answers can change a little.

Which precision does HIPS serve each model at?

Each model's page and the price table show the precision HIPS's catalog states for each pool, such as Q4_K_M (int4) or mxfp4 (fp4).

Run it without sizing a GPU

Call the models in HIPS's catalog by the token, or run your own container on a rented GPU.

Join early accessSee all models

Product

  • Inference
  • Models
  • Serverless GPUs
  • GPU rental
  • Deploy your model
  • Coding agents
  • How it works
  • Use cases
  • Pricing

Models

  • DeepSeek API
  • Kimi API
  • Qwen API
  • GLM API
  • Gemma API
  • Mistral API
  • gpt-oss API
  • All models

Developer

  • Docs
  • Quickstart
  • Migrate to HIPS
  • HIPS SDK
  • Batch jobs
  • API reference
  • Claude Code pricing
  • Claude Code limits
  • Best models for coding
  • Token counter
  • LLM price table
  • VRAM calculator
  • Compare models

Provider

  • Earn with your GPU
  • Register GPU interest
  • Download for Mac
  • Download for Windows
  • Download for Linux

Resource

  • Security and Data
  • Resources
  • Tools
  • Guides
  • llms.txt

Compare

  • OpenRouter alternatives
  • Together AI alternatives
  • Groq alternatives
  • Runpod alternatives
  • Claude Code alternatives
  • Cursor alternatives
  • All comparisons

Company

  • About
  • Contact
  • Affiliate program
  • HIPS Payments

Legal

  • Legal
  • Consumer Health Data Privacy Policy
  • Report content
  • Cookie preferences

Support

  • Contact HIPS
  • Looking for payments support?

HIPS. AI inference for builders.

hips.com

Hyperscale Inference Processing Systems OÜ