中文
Home / Tools / LLM VRAM & Deployment Cost Calculator

LLM VRAM & Deployment Cost Calculator

Estimate VRAM for any open LLM by precision, context length and concurrency, see which GPUs fit and how fast they run, and compare the monthly cost of an API, rented GPUs and buying your own.

1 · Memory and speed

Advanced options
Weights–
KV cache–
Runtime overhead–
Total VRAM needed–
Usable VRAM–
Speed per request–
Total throughput–

Which GPUs can run it

GPUVRAMGPUs neededSpeed per requestNotes

2 · Monthly cost: API vs. rent vs. buy

Advanced options

API–
Rent GPUs–
Buy GPUs–
Replicas needed–
GPU busy time–

How it works

Memory

Total VRAM = weights + KV cache + runtime overhead
Weights = parameters × bytes per parameter
KV cache = 2 × layers × KV heads × head dim × bytes per element × context length × concurrent requests

Bytes per parameter: 2 for BF16, 1 for FP8/INT8, about 0.56 for INT4 (including scales) and 0.5 for FP4. KV cache is reserved for each request's full context, the way inference engines such as vLLM allocate it. Runtime overhead is estimated as 8% of the weights plus 1 GB per GPU. Usable VRAM is 90% of each card, matching vLLM's default gpu-memory-utilization.

DeepSeek V3/R1 uses Multi-head Latent Attention (MLA), which caches only 576 elements per token per layer, so its KV cache is far smaller than usual. Mixture-of-Experts models such as Qwen3 30B-A3B must hold every expert in memory, but each token only computes with the active parameters.

Speed

Speed per request ≈ effective bandwidth ÷ bytes read per step
Bytes read per step = active parameters × bytes per parameter + KV cache in use

Generating a token reads the active weights from memory once, so speed is set mainly by memory bandwidth. Effective bandwidth is taken as 70% of the peak. With several GPUs, scaling efficiency is 85% over NVLink and 55% over PCIe only. This is the decode-phase ceiling; prefill time for long prompts isn't included.

Cost

  • API: 30 days × requests per day × (input tokens × input price + output tokens × output price).
  • Rent: billed for the hours you're online. The output speed needed at peak sets how many replicas you need, multiplied by GPUs per replica and the hourly price.
  • Buy: GPU cost spread over the depreciation period, plus electricity (from GPU power draw and how busy it is) and a share of server and hosting. Payback = total GPU cost ÷ (API monthly bill − self-hosted monthly running cost).

Before you rely on it

  • Default prices are examples only. Replace them with the quotes you actually have.
  • Expect about ±20% error. Before launch, load-test with real traffic and watch memory use, time to first token and throughput.
  • For the reasoning behind these numbers, read the GPU Fundamentals & LLM Deployment Guide.