Skip to content

LLM VRAM Calculator

Will an LLM run on your GPU or Mac, and how many GPUs does it need? Any Hugging Face model, with the real KV cache of today's architectures.Will an LLM run on your GPU or Mac? Any Hugging Face model.

Trending on Hugging Face
Estimator
Inkling 2 Mini (MoE)
Inferencellama.cpp / Ollama / LM Studio1 × 32 GB

What do you want to know?

Your setup

Your machine, then a model.

Your machine

Auto picks the fewest GPUs that fit: tensor parallel inside a server (up to 8), pipeline parallel across servers.
Used when the model does not fit in GPU memory: llama.cpp then keeps part of it in RAM, slower. The detect script reads it for you.
A desktop and a browser take 0.5 to 1.5 GB on the card that drives the screen. On Windows, an overflow then spills into shared system memory and generation slows down sharply instead of failing; on Linux, loading fails.

Model

Trending on Hugging Face
Paste a link or org/model: reads the model's config.json and safetensors metadata straight from Hugging Face.

Thinking Machines Lab, United States

26.4B parameters (3.4B active) · 1M context · Apache 2.0

Looped MoE: 24 layers, the middle 12 run 3 times (48 layer visits, each with its own cache) · 128 experts · 8 global + 40 sliding-window visits (1024 tokens), GQA 8 KV × 128 · short convolutions · image input

Context

How much text the model keeps in mind: your prompt, documents and its answer. 32K tokens ≈ 25,000 words.

Using GGUF Q6_K weights (picked to fit), 1 request at a time, BF16 / FP16 KV cache, llama.cpp.

Measured on your GPU

Inkling 2 Mini (MoE) has been measured on a GeForce RTX 5090. Across 8 measurements on this card, our estimate is within 20% (median).

Published measurements on this GPU against our estimate
MeasurementRealEstimate
Inkling 2 Mini · generation · llama.cpp · UD-IQ4_XS96.9 tok/s91.2 tok/s
Inkling 2 Mini · prompt · llama.cpp · UD-IQ4_XS2,446 tok/s3,368 tok/s
Inkling 2 Mini · generation · vLLM · NVFP4 / MXFP8 (official)275 tok/s238 tok/s
gpt-oss 20B · generation · llama.cpp · MXFP4 GGUF283 tok/s323 tok/s
gpt-oss 20B · prompt · llama.cpp · MXFP4 GGUF9,848 tok/s12,378 tok/s

Published benchmarks, each with its source in How accurate is it?

Your answer

Yes or no, how fast, and what else fits.

On your machine

Fits

Yes, it runs

1 × GeForce RTX 5090 · 32 GB · GGUF Q6_K · about 70 tokens/s

24.8 GB of 32.0 GB7.21 GB free

  • Weights 21.5 GB
  • KV cache 1.23 GB
  • Recurrent state 0.00 GB
  • Engine 2.03 GB

Estimate, not a guarantee: keep some headroom, and confirm with nvidia-smi.

Or rent it: $0.40/h on Vast.aiOn-demand prices, checked every hour. Prices change: check before you rent.Compare 3 providers →

An image of this answer, for X, Reddit or Discord.

Or run it with Strata

Strata, an open-source engine for gaming PCs, runs it. Strata loads its own packs of the model, with its built-in DSpark speculative decoding; below 12 GB of VRAM, part of the model runs from RAM. With 32 GB of VRAM, the project recommends SQ-20 (19.4 GB, lossless).

Measured by the project on an RTX 5090: 199 to 250 tokens/s (SQ-15 or SQ-20).

Requirements and speeds by RAM · Strata on GitHub (opens in a new tab)

Figures published by the Strata project (read on 2026-11-21), not estimated by this calculator.

Speed

Faster with vLLM and the NVFP4 / MXFP8 experts + BF16 (native) weights, plus the model's draft for speculative decoding: about 220 tokens/s on the same machine (Linux or WSL, not Ollama).

Drafts tokens ahead, checks them in one pass. Costs the draft weights plus ~2 GiB per GPU (vLLM logs). Measured gain on InferenceX, 510 runs with and without it: ×1.71 at 1–4 requests, ×1.48 at 8–16, ×1.33 past 64. Less on unpredictable text.
Per request Generation speed seen by one user, at full context≈ 70 tok/s
First token, 32K prompt Time to read a prompt as long as the chosen context before the first token appears (prefill), for one request. It depends on the GPU's compute (TFLOPS), not its memory bandwidth.≈ 11 s

Checked against 3 published llama.cpp measurements on this GPU: generation within ±14%, first token within ±38%. Every measurement

Measured something different on your machine? Report it on GitHub (opens in a new tab): we check it and add it to the accuracy table.

Same model through an API: $0.300 per 1M output tokens on Primeintellect Cheapest of 3 API offers (OpenRouter and Hugging Face Inference Providers): $0.075 per 1M input tokens, $0.3 per 1M output tokens.

Compare 2 API providers: price, speed, first token
How this speed is estimated

Estimate (±30–50%, no speculative decoding): generation at full context from memory bandwidth (1.792 TB/s per GPU) and llama.cpp / Ollama / LM Studio efficiency, first token from llama.cpp's measured speed on this GPU. API prices and speeds: OpenRouter and Hugging Face Inference Providers.

VRAM per GPU

  • Weights21.5 GB
  • KV cache1.23 GB
  • Recurrent state0.00 GB
  • Runtime overhead2.03 GB
Needed24.8 GB
Usable Memory per GPU × usable %32.0 GB
Headroom7.21 GB
Longest context here With these weights, on your GPU memory alone268,910 tokens

Median gap against 141 real launches: 1.3% on weights. How is this computed?

Watch it generate

One answer as a user sees it, after a 1K-token prompt. You read about 5 tokens a second.

1 × GeForce RTX 5090: about 70 tokens per second, first token after 294 ms; Io-net API: about 121 tokens per second, first token after 712 ms.

A 500-token answer takes about 7.4 s here, 4.8 s with Io-net.

Simulated in your browser from the estimate above (the text is only filler). API speed and first token: measured by Hugging Face Inference Providers. Reading speed: 238 words a minute (Brysbaert, 2019).

Measured on your GPU

Inkling 2 Mini (MoE) has been measured on a GeForce RTX 5090. Across 8 measurements on this card, our estimate is within 20% (median).

Published measurements on this GPU against our estimate
MeasurementRealEstimate
Inkling 2 Mini · generation · llama.cpp · UD-IQ4_XS96.9 tok/s91.2 tok/s
Inkling 2 Mini · prompt · llama.cpp · UD-IQ4_XS2,446 tok/s3,368 tok/s
Inkling 2 Mini · generation · vLLM · NVFP4 / MXFP8 (official)275 tok/s238 tok/s
gpt-oss 20B · generation · llama.cpp · MXFP4 GGUF283 tok/s323 tok/s
gpt-oss 20B · prompt · llama.cpp · MXFP4 GGUF9,848 tok/s12,378 tok/s

Published benchmarks, each with its source in How accurate is it?

Your options

Formats and context lengths that fit, and what else runs on your machine. Click to apply.

Does it fit? Weights × context on 1 × GeForce RTX 5090

Weights4K8K32K128K256K1M
BF16 / FP16
GGUF Q8_0
GGUF Q6_K
GGUF Q5_K_M
GGUF Q4_K_M
GGUF Q3_K_M

Longest context that fits

  • BF16 / FP16 up to 1M with RAM
  • GGUF Q8_0 up to 128K (tight), 1M with RAM
  • GGUF Q6_K up to 256K (tight), 1M with RAM
  • GGUF Q5_K_M to GGUF Q3_K_M up to 256K, 1M with RAM

✓ fits · ~ tight · ◐ fits with 64 GB of system RAM (slower) · ✕ does not fit. Context per request, 1 concurrent request, llama.cpp / Ollama / LM Studio. Click a cell to apply it. Tap a format to use it at its longest context.

What else runs on your machine

Largest first, each with the most faithful weight format that fits 32K tokens × 1 request.

Quantization on GeForce RTX 5090

Fits on your GPU

With your RAM, slower

Fewer bits per weight: smaller and faster, at some quality cost. The KV cache is set separately.

Run it

The command for Ollama, LM Studio or llama.cpp, and the electricity it uses at home.

Run it at home: electricity

Your electricity price, in dollars per kWh, as on your bill
575 W per card at full load (manufacturer's board power)

Choose your country or enter your price per kWh.

Upper bound: board power at full load; generation usually draws less, the rest of the computer adds some. Household prices, all taxes included, 2,500 to 4,999 kWh a year: Eurostat, first half of 2026. United States: average residential price from January to August 2026, by state (EIA). No figure for the UK: enter yours.

Command

# Ollama: start the server with a 32,768-token context, then run the model in another terminal
# (Mac app: launchctl setenv OLLAMA_CONTEXT_LENGTH 32768, then restart Ollama)
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
ollama run hf.co/lmstudio-community/Inkling-2-Mini-GGUF:Q6_K

New & trending open models

Lab countries from the registry of this site, completed with Epoch AI (opens in a new tab) (CC BY 4.0).

Best computers for local LLMs

Which machine should you buy to run open models at home? Not simply the cheapest, nor the one that fits the most models: we rank 29 machines with the Local LLM Score, a score made for this page. A model counts only if it really runs on the machine alone (8K context, at least 10 tokens/s), a large model counts more than a small one, and a faithful file more than a heavily compressed one. Then we divide by the price, in US dollars: 2 prices read today at retailers and price trackers, the others checked by hand on 2026-11-22 or later, each with its source.

  • Best valueScore 25 for $1,299: 19.3 points per $1,000
  • Best under $2,500Score 37, 131 models at 10+ tokens/s, $2,499
  • Cheapest that runs almost everythingScore 65, three quarters of the top machine's, for $10,799
MachinePriceScoreModelsPer $1,000
· best buy at this price · largest: Recursive Flint$1,299 (source: Apple, via AppleInsider review (+$400), opens in a new tab) list · 2026-10-022510319.3
· best buy at this price · largest: Kimi VL A3B Instruct$899 (source: Apple, via AppleInsider review, opens in a new tab) list · 2026-10-02168017.3
· best buy at this price · largest: Ornith 1.5 35B-A3B$1,100 (source: GPU Price Index, opens in a new tab) street + $1,000 PC · 2026-11-143612717.3
· best buy at this price · largest: Qwen3-Next 80B-A3B$1,959 (source: Framework store, opens in a new tab) list · 2026-11-223312517.0
· best buy at this price · largest: Gemma 4 26B-A4B$1,099 (source: Apple, via AppleInsider review (+$200), opens in a new tab) list · 2026-10-02188416.0
· largest: Mixtral 8x7B$2,299 (source: Apple, via Macworld review (+$600), opens in a new tab) list · 2026-113513115.0
· best buy at this price · largest: Mixtral 8x7B$2,499 (source: Apple, via Macworld review, opens in a new tab) list · 2026-113713114.8
· largest: Ornith 1.5 35B-A3B$1,584 (source: eBay sold listings, 90-day median (664 sales), opens in a new tab) used + $1,000 PC · 2026-113612714.0
· best buy at this price · largest: Mixtral 8x7B$1,729 (source: RunAIHome, November 2026 US listings, opens in a new tab) street + $1,000 PC · 2026-113813114.0
· largest: JEV 27B VL$1,699 (source: Apple, via Macworld review, opens in a new tab) list · 2026-11239713.5
· largest: Qwen3-Next 80B-A3B$2,699 (source: Apple, via Macworld review (+$400), opens in a new tab) list · 2026-113613513.5
· largest: Kimi VL A3B Instruct$370 (source: GPU Price Index, opens in a new tab) street + $1,000 PC · 2026-11-14188013.1
· largest: Mixtral 8x7B$2,000 (source: GPUPrix (B&H, lowest US listing), opens in a new tab) street + $1,000 PC · 2026-11-043813112.8
· best buy at this price · largest: GLM-5.3-Flash$3,449 (source: Framework store (out of stock), opens in a new tab) list · 2026-11-224114012.0
· largest: Qwen3-Next 80B-A3B$3,499 (source: B&H, Apple configuration, opens in a new tab) list · 2026-11-224113711.7
· largest: LFM2.5 24B-A2B$769 (source: Nvidia RTX 50 price tracker, opens in a new tab) street + $1,000 PC · 2026-11208611.5
· largest: LFM2.5 24B-A2B$899 (source: GPU Price Index, opens in a new tab) street + $1,000 PC · 2026-11-14208610.7
· best buy at this price · largest: GLM-5.3-Flash$5,099 (source: Apple configuration, via PromptQuorum, opens in a new tab) list · 2026-11501539.8
· largest: Qwen3.8-Flash-Next$5,499 (source: Apple, via Macworld, opens in a new tab) list · 2026-11501559.1
· largest: Ornith 1.5 35B-A3B$3,235 (source: eBay sold listings, 90-day median (165 sales), opens in a new tab) used + $1,000 PC · 2026-11361278.6
· largest: LFM2.5 24B-A2B$1,399 (source: Nvidia RTX 50 price tracker, opens in a new tab) street + $1,000 PC · 2026-11-0320868.5
· largest: Qwen3.8-Flash-Next E384 FP4 V2$4,999 (source: NVIDIA list price, opens in a new tab) list · 2026-10-23351297.0
· largest: GLM-5.3-Flash$6,799 (source: Framework store, opens in a new tab) list · 2026-11-22471536.9
· largest: LFM2.5 24B-A2B$1,999 (source: Nvidia RTX 50 price tracker, opens in a new tab) street + $1,000 PC · 2026-1120866.8
· largest: GLM-5.3-Flash$6,950 (source: NVIDIA list price (October 2026), opens in a new tab) list · 2026-10441456.3
· best buy at this price · largest: GLM-4.7$10,799 (source: Apple, via MacRumors, opens in a new tab) list · 2026-11651786.0
· largest: Mixtral 8x7B$6,919 (source: Tom's Hardware lowest US price, opens in a new tab) street + $1,000 PC · 2026-11-03391314.9
· best buy at this price · largest: Hy4 Preview$22,299 (source: Apple, via TechRepublic, opens in a new tab) list · 2026-10-28862083.9
· largest: GLM-5.3-Flash$16,000 (source: NVIDIA US list price (August 2026), opens in a new tab) list + $1,000 PC · 2026-11541593.2
How the Local LLM Score works
  • Every model in our list that llama.cpp runs (Ollama, LM Studio) is tried on the machine alone, with an 8K context, from the most faithful file down to Q4_K_M.
  • Speed: below 10 tokens/s a model scores nothing; it gets full credit from 20 tokens/s, half at 10.
  • Size: each model weighs log₂(1 + billions of parameters): 3.2 for an 8B, 6.1 for a 70B, 9.4 for a 671B. Bigger models are worth more, without a single giant drowning out the rest.
  • File: full credit for BF16 and Q8_0, 0.98 for Q6_K, 0.96 for Q5_K_M, 0.92 for Q4_K_M.
  • Score = 100 × credits earned ÷ credits possible. Per $1,000 = score ÷ price in thousands of dollars. A graphics card is priced with a $1,000 computer around it (our assumption: processor, 32 GB of RAM, power supply, SSD).
  • Best buy at this price: no cheaper machine scores higher.

Speeds are this calculator's llama.cpp estimates (see How accurate is it?); on a Mac, MLX is often faster and is not counted. Prices move fast in 2026 (memory shortage): each one links to its source, as a list price, the lowest street price found, or the median of used sales. Click a machine to try it with any model above.

GPU rental prices

The cheapest on-demand price to rent a GPU, per hour, checked every hour across 11 providers, with its daily history. Pick a GPU:

ProviderPer GPU-hour1 GPU, per monthRent
Vast.ai$0.401$292.73Rent on Vast.ai (opens in a new tab) →
Akash Network$0.580$423.40Rent on Akash Network (opens in a new tab) →
RunPod$1.39$1,014.70Rent on RunPod (opens in a new tab) →

Loading the daily history…

Per GPU and per hour, on demand, prices of 2026-11-24 03:06 UTC on the GeForce RTX 5090 price page. Marketplaces: Vast.ai, the price at which at least two reliable machines rent it; Akash, the average across its providers.

Use it in Claude, Cursor or ChatGPT

Add this calculator to your AI assistant once, then just ask, for example: Can Qwen3.8 27B run on one RTX 4090 with a 32K context? It answers with the same numbers as this page, for the listed models and any Hugging Face model, with GPU rental prices. No key, no sign-up.

Claude (web or desktop): Settings → Connectors → Add custom connector, paste this URL, then turn it on in a chat with the + button.

https://studiotvai.com/api/mcp

The same data as JSON: /api/models.json (every model, with the link to its file), /api/gpus.json, and one file per model such as /api/models/llama-3-3-70b.json. Each model page also has a VRAM badge to paste in a model card.

LLM VRAM FAQ

How does the calculator compute VRAM?

It adds up what each GPU must hold, for the engine and the GPU you pick, and checks that it fits in the memory the engine allows itself.

  • Weights: parameters × bits ÷ 8, split across the tensor-parallel and pipeline-parallel GPUs. Official checkpoints and published GGUF files count at their exact file size.
  • KV cache: for each group of layers, layers × width × cached tokens × bytes, times the concurrent requests. Width is 2 × KV heads × head dim (GQA), or one compressed latent plus its RoPE part (MLA).
  • Cached tokens: the whole context on full-attention layers, at most the window on sliding-window layers (a modern engine with a paged KV cache keeps only that), the context ÷ the ratio on compressed layers.
  • SGLang: it sizes the sliding-window cache as a fixed share of the full-attention cache (swa_full_tokens_ratio: 0.8 by default, 0.1 for Inkling), so a long request costs full layers + 0.8 × sliding layers per token. On some GPUs it keeps no separate sliding-window cache for a model (Gemma 3 on Hopper, LFM3): every layer then holds the whole context. For models with a recurrent state, its prefix cache keeps states in 0.9× the KV cache memory (5 states per request).
  • vLLM: on hybrid models its prefix cache keeps 2 copies of the recurrent state per request. On sliding-window layers it reserves the window plus the tokens still in flight (2 batches of 2,048 to 16,384 tokens, depending on the GPU's memory), so a long request costs more than the window alone.
  • Engine reserve: what the engine keeps for itself on that GPU: vLLM's 90% default and its overhead measured on real server logs, SGLang's own mem_fraction_static formula, llama.cpp's 1 GiB --fit margin. (KV cache + state) × requests + weights + overhead must stay under memory × usable %.

How accurate is the calculator?

It is checked every day against real server launches published by InferenceX (SemiAnalysis): across 141 launches, the median gap is 1.3% on weights per GPU, 1.9% on the KV cache allocated and 13.9% on speed per request. On home hardware (llama.cpp, Macs, consumer cards), 328 published generation-speed measurements are within 8.7% of the estimate (median) and 258 prompt-speed measurements within 13.8%: every one is listed with its source on studiotvai.com/llm-vram-accuracy, misses included. Memory follows each architecture exactly; training activations are a ±30% estimate. Keep some headroom and confirm with nvidia-smi.

How much VRAM do I need to run a 70B model?

Take Llama 3.3 70B. Its weights need 131 GiB in BF16 (2 × H100 80 GB), 67.7 GiB in FP8 and about 39.9 GiB in 4-bit (1 × H100, or 2 × RTX 4090). Then add the KV cache of each request: 2.5 GiB at 8K tokens and 10.0 GiB at 32K.

Can I run an LLM on a 24 GB GPU like the RTX 4090?

Yes, models up to about 35B parameters fit in 4-bit with an 8K-token context: Llama 3.1 8B, Llama 3 8B, Llama 3.2 3B, Nanbeige4.3 33B, Granite 4.2 30B, Granite 4.2 8B, Granite 4.2 3B, MiniCPM5 2B, MiniCPM5 1B, Ministral 3 14B, Ministral 3 8B, Ministral 3 3B, Devstral Small 2 24B, Magistral Small 1.2 24B, Mistral Small 3 24B, Codestral 22B, Mistral Small 2409 22B, Pixtral 12B, Nemotron 3.5 Parse, Gemma 2 9B, Gemma 3 4B, Gemma 3 12B, Gemma 3 27B, LLaVA 1.6 Mistral 7B, Mistral Small 3.2 24B, Qwen3 32B, Hy-Memory 30B-A3B, Kimi VL A3B Instruct, Unlimited-OCR, Unlimited-OCR 2, Xing4.0 29B-A4B, Qwen3.5 4B, MiniCPM-V-4.7 1B, Raon-1 mini preview, Raon-1 nano, Qwen3.5 9B, Qwen3.8 27B, Qwen3.6 35B-A3B, Maxwell V1 Flash, Clover 35B-A3B Preview, SenseNova Loop 9B Preview, LFM3 1.7B, LFM3-VL 2B, d1 2B, LFM2.5 8B-A1B, LFM2 24B-A2B, Gemma 4 12B, Gemma 4 31B, Gemma 4 26B-A4B, gpt-oss 20B, Nemotron Labs Dory 1.0 4B, Laguna XS 2.1, Muse Glimmer 30B, Mamba-Codestral 7B, Inkling 2 Mini, Qwen3-Coder 30B-A3B, Ornith 1.5 35B-A3B, Ornith 1.5 9B, Clef, Clef Flash, d1 3B, Humanizer, JEV 27B VL, Mellum2.1 12B-A2.5B, LightOnOCR-3 4B, Spark-X2.5 4B, Youtu-Parsing-Omni, Agnes-3.0-Flash, Mistral 7B v0.3, Mistral Small 3.1 24B, Mistral Nemo, Ministral 8B, DeepSeek R1 Qwen3 8B, DeepSeek R1 Distill Qwen 32B, DeepSeek R1 Distill Qwen 14B, DeepSeek R1 Distill Qwen 7B, DeepSeek R1 Distill Llama 8B, Qwen3 4B, Qwen3 8B, Qwen2.5 7B, Qwen3 14B, Qwen2.5 3B, Qwen3.6 27B, Qwen3.5 27B, Qwen2.5-Coder 7B, Qwen2.5 32B, Qwen2.5-Coder 14B, Qwen3.5 35B-A3B, Qwen3 30B-A3B, Qwen2.5 14B, Qwen2.5-Coder 32B, Qwen2.5-Coder 3B, Gemma 4 E4B, Gemma 4 E2B, Nemotron 3 Nano 4B, MiniCPM-V-4.7 35B-A3B, LFM2.5 24B-A2B, Qwen3-VL 8B, Qwen2.5-VL 7B, Qwen3-VL 4B, Qwen2.5-VL 3B, Qwen2.5-VL 32B, Qwen2-VL 7B, phi-4, Phi-3.5-mini, Phi-4-mini, Phi-3-mini-128k, Spark-X2.6 4B, Sage-A1.5, MLExpert, Agents-A1 4B, MiniCPM-OCR-1.0, WeVisOne-VL 4B, Granite 4.1 3B, Qwen3-VL 30B-A3B, Mage-VL-Cowork, Spark-X2.6 1.7B, Qwen3.5 4B-Qwenputer, 6.8-Code2Video, Qwen3.5 4B-GLB-3D-Coder, GLM-4.7-Flash, Laguna XS.2, Qwen2 7B, Qwen3-VL 32B, Qwen2.5 14B-1M, Nemotron Nano 9B v2, Qwen3.5 0.8B-weight-space-programming, Axion-1.0 35B, Hermes-3-Llama-3.1 8B, Qwen3.8 27B-DSpine-b16, Granite 3.3 8B, MNN-Pocket 0.3B, S5-nano, KORMo-Web 11B, ERNIE 4.5 21B-A3B, Aion-1.0 2.3B. Larger models need several GPUs or a card with more memory.

How do I know which GPU and how much VRAM I have?

Click Detect my config in the calculator and paste the one-line command in a terminal: curl -fsSL https://studiotvai.com/detect.sh | sh on macOS and Linux, irm https://studiotvai.com/detect.ps1 | iex in Windows PowerShell. It reads your GPU, its memory, how many you have and your RAM, then opens the calculator set to your machine. Nothing is installed or sent anywhere else. On a Mac, the unified memory is what the GPU uses.

Can I run an LLM that does not fit in my GPU memory?

Often, yes, with llama.cpp (and so Ollama and LM Studio): it keeps part of the model in system RAM and runs the rest on the GPU. It is slower, because each token reads the RAM part over the much slower memory bus. Mixture-of-experts models suffer least: only their active experts are read from RAM. The calculator shows the split, the speed and the llama.cpp command for your RAM, and picks the most faithful format that runs this way.

Ollama, LM Studio or llama.cpp: which one should I use?

All three run the same engine, llama.cpp, with GGUF files, so the memory and speed estimates are the same. Ollama is the simplest from a terminal (one command downloads and runs the model), LM Studio adds a desktop app with a chat window, and llama.cpp itself gives every setting, such as RAM offload flags. The calculator gives the command for each. On a Mac, MLX (Apple's engine) is often faster, mostly on small and MoE models: LM Studio runs MLX models, Ollama uses MLX by default for the models it supports there, and mlx-lm runs it directly. Pick MLX as the engine to see its own memory and speed. vLLM and SGLang are for servers: faster with many users, but they need the whole model in GPU memory.

How many GPUs do I need to run an LLM?

Each GPU must hold its share of the weights plus the KV cache of every concurrent request, under the memory the serving engine allows itself (90% by default in vLLM). The calculator tries 1, 2, 4, 8 GPUs and more, splitting the model with tensor parallelism inside a server and pipeline parallelism across servers, and returns the fewest that fit.

What drives LLM VRAM usage?

Four things decide how much memory a model needs once it is serving requests.

  • Weights are fixed: parameters × bits. “4-bit” formats really cost 4.2 to 4.9 bits once scales are counted.
  • KV cache grows with context × concurrent sequences; it decides how many users a GPU can serve.
  • Tensor parallelism splits GQA heads but never below one head per GPU, and replicates MLA latents.
  • Serving engines leave memory free on purpose: vLLM uses 90% of each GPU by default.

Why is VRAM higher than the model size on disk?

The file holds only the weights. At serving time you also pay for the KV cache, which grows with context × concurrent sequences, runtime buffers such as CUDA graphs and activation workspace, and the share of memory the engine leaves free on purpose.

Why are most LLM VRAM formulas wrong?

The classic estimate, 2 × layers × KV heads × head dim × bytes per token, assumes every layer attends to the whole context. Most models released since 2025 break that rule:

  • Hybrid linear attention (Qwen 3.5–3.8, Nemotron 3, Kimi K3): only 1 layer in 4, or fewer, keeps a KV cache; the rest hold a fixed-size state.
  • Sliding windows (Gemma 4, gpt-oss): most layers keep only the last 128 to 1,024 tokens.
  • MLA (GLM-5.3, Kimi K3): one 576-wide compressed latent per token instead of keys and values.
  • Compressed attention (DeepSeek V4): a 128-token window plus the rest of the sequence compressed 4× or 128×.

Why does the KV cache differ so much between models of the same size?

2026 architectures cache very different amounts per token. Qwen 3.5+ keeps a KV cache on only 1 layer in 4, Gemma 4 and gpt-oss limit most layers to a short sliding window, MLA models store one compressed latent instead of keys and values, and DeepSeek V4 compresses the sequence itself. At 128K context, Llama 3.3 70B needs 40 GiB of KV per sequence; Qwen3.8 27B needs 8 GiB.

Can quantization make a model fit on fewer GPUs?

Yes. Weights take parameters × bits per weight, so going from BF16 to 8 bits halves them and 4-bit formats cut them by about 3.5×. As a rule of thumb, 8-bit is near lossless, 5 to 6-bit loses very little and 4-bit loses a little more, depending on the model. Set a fixed number of GPUs and the calculator shows the most accurate format that fits.

Does quantizing the weights shrink the KV cache?

No. The weight format (FP8, NVFP4, GGUF Q4_K_M…) and the KV cache precision are set independently. An FP8 KV cache halves the cache whatever the weights are stored in, at a small accuracy cost.

How much memory does fine-tuning take?

Full fine-tuning with AdamW in mixed precision costs about 16 bytes per parameter before activations: BF16 weights and gradients, an FP32 master copy and two FP32 optimizer moments. LoRA keeps the frozen model at 2 bytes per parameter plus 16 per trainable one, QLoRA at about 0.52. Activations then scale with sequence length × batch, not with parameter count: about layers × 34 × sequence × batch × hidden bytes, or layers × 2 × sequence × batch × hidden plus one layer with gradient checkpointing, plus FP32 logits of sequence × batch × vocabulary × 4 bytes. They are a ±30% estimate: they depend on the MLP shape, fused kernels and the framework, and a fused cross-entropy (Liger) removes most of the logits term.