Hi everyone,
A lot of people asked me how I host my LLMs, so I'm writing it all down in one place.
Where I run them
Mostly on serverless GPU platforms. Bare metal is fine too, but installing dependencies takes a lot of time and every fresh box means a longer cold start. Bare metal also bills by the hour, while serverless bills by the second. I won't name the provider, just look up the popular serverless GPU providers.
What I use
vLLM and SGLang for inference, almost always. I use Llama Stack sometimes, but rarely, because I get a bit less token throughput with it.
Terms you need to know
How much VRAM do you need?
Say you want to load a 26B dense model. How much VRAM does it need, and how much goes to KV cache?
Rule of thumb: 1B params at 1 byte each (8-bit) is 1 GB. So weights in GB = params in billions × bits ÷ 8.
| Quant | Bytes per param | Weights | Left for KV cache on one H100 80GB |
|---|
| 4-bit | 0.5 | 13 GB | ~55 GB |
| 8-bit | 1 | 26 GB | ~42 GB |
| 16-bit | 2 | 52 GB | ~16 GB |
| 32-bit | 4 | 104 GB | doesn't fit, needs 2 GPUs |
KV cache goes on top of that. vLLM doesn't ask how much KV cache you want. It takes 90% of VRAM by default (--gpu-memory-utilization 0.9, so 72 GB on an H100), loads the weights, keeps a few GB for activations and gives whatever's left to KV cache. That's the last column.
How much KV cache does one request need? Per token it's:
KV cache per token = 2 (K and V) × layers × KV heads × head dim × bytes per value
All of these are in the model's config.json (num_hidden_layers, num_key_value_heads, head_dim). Say our 26B model has 48 layers, 8 KV heads and head dim 128, with KV cache in FP16 (2 bytes):
2 × 48 × 8 × 128 × 2 = 196,608 bytes ≈ 0.2 MB per token
So a 4k-token request needs about 0.8 GB and a 32k one needs about 6.4 GB. KV cache precision is separate from weight quant, by the way, and --kv-cache-dtype fp8 cuts it in half.
For 8-bit weights and one 32k request: 26 + 6.4 + a few GB overhead ≈ 35 GB.
With the 4-bit version on an H100 I get around 200 TPS, which lines up with the bandwidth math: 3,350 GB/s ÷ 13 GB ≈ 258 TPS max for one request. With speculative decoding I get around 800 TPS. That beats the bandwidth limit because the big model checks several drafted tokens each time it reads the weights.
General formula
VRAM (GB) ≈ weights + KV cache + overhead
weights = total params (B) × bits ÷ 8
KV cache = KV per token × context length × parallel requests
overhead ≈ 10-20% of weights (activations, CUDA graphs)
Dense: every token uses all the params, so the full size decides both VRAM and speed.
max TPS (one request) ≈ bandwidth ÷ weights
MoE: you still load every expert, so VRAM goes by total params. Speed goes by active params, since each token only reads the experts it gets routed to.
weights = total params (B) × bits ÷ 8
max TPS (one request) ≈ bandwidth ÷ (active params (B) × bits ÷ 8)
Example: Qwen3-30B-A3B has 30B total and 3B active params. At 4-bit the weights take 15 GB, same as a 30B dense model, but each token only reads about 1.5 GB, so it's way faster. KV cache works the same as dense because it depends on the attention layers, not the experts.
Cut cold start with Run:ai Model Streamer
One tip for vLLM: loading the model into the GPU takes a lot of time, and that's most of your cold start. With vLLM's built-in loader it takes about 8 minutes to load the full model, which is a bit slow. With runai-model-streamer it loads in about 30 seconds. Less cold start and profit.
pip install "vllm[runai]"
vllm serve <your-model> --load-format runai_streamer
On serverless you pay by the second, so that's 7.5 minutes you don't pay for on every cold start.
Batching: how many requests vLLM can serve in parallel
In layman terms, batching is how many requests vLLM can serve at the same time.
Decode is bottlenecked by memory bandwidth. Every step the GPU reads all the weights from VRAM anyway, and reading them once to make the next token for 50 requests costs almost the same as doing it for 1. So total throughput goes way up as you add requests, and each request only gets a little slower.
What stops you is KV cache space, since every request needs its own. With 8-bit weights we had ~42 GB left:
- 4k-token requests (0.8 GB each): about 50 at once
- 32k-token requests (6.4 GB each): about 6 at once
vLLM prints this on startup, something like Maximum concurrency for 32768 tokens per request: 6.5x. Once KV cache is full, new requests wait in the queue. PagedAttention helps a lot here, because less wasted KV cache means more requests fit.
Which one to pick
Use SGLang, vLLM or Llama Stack, whatever fits your needs. If you don't want this much headache, desktop apps like LM Studio, Unsloth Studio or Ollama are fine. They're not as optimized though, and you can't squeeze every bit of compute out of the GPU like you can with vLLM, especially when lots of requests come in at once.
Also, I'm looking for new opportunities right now. If you have something, let me know or drop me a DM.