Serve an LLM with vLLM

vLLM is a serving engine built for throughput. It batches many requests continuously on one GPU and loads the original safetensors weights from Hugging Face instead of GGUF files. It runs on Linux with NVIDIA or AMD GPUs.

Linux with NVIDIA or AMD GPUs · model sizes synced 2026-11-30

Pick vLLM when

  • Several people or agents use the model at the same time.
  • You run on a datacenter GPU and want the most tokens per dollar.
  • You want the unquantized weights, or an FP8 build.

Look elsewhere when

  • The model does not fully fit in VRAM: vLLM has no CPU offload.
  • You are on a Mac or Windows desktop.

1. Install

Linux with an NVIDIA GPU

Create an environment with uv and let it pick the PyTorch build for your CUDA driver. Python 3.11 to 3.14.

AMD GPUs

Install from the ROCm wheel index.

Check that it worked

2. Run a model

Example: Qwen 3.8 27B as FP8 on NVIDIA L40S (48 GB). With a 16K context it needs 31.8 GB of 46.2 GB usable memory and should generate about 16.2–27 tok/s, with room for 15 requests in parallel.

Size your own model and hardware for vLLM

3. The settings that decide memory use

Set the context window

--max-model-len caps prompt plus output. Left out, vLLM takes the model's maximum and refuses to start if a single request of that length does not fit. --max-model-len auto picks the largest length that fits.

Halve the KV cache

Store the KV cache in FP8 instead of the model's data type. Every request then needs half the cache, so twice as many fit.

Reading nvidia-smi

vLLM uses the VRAM the weights leave over as KV cache for parallel requests. A nearly full GPU in nvidia-smi is normal and does not mean the model barely fits.

4. Connect your tools

Use it from other tools

The server exposes an OpenAI-compatible API on http://localhost:8000. It hosts one model per process.

Or let your coding agent do it

Paste this into Claude Code, Codex or any agent with a shell. It carries the target, our estimates and the steps, and tells the agent to check the hardware first and to report measured memory and speed against the estimates. The calculator builds the same prompt for any model, hardware and runtime.

Set up a local LLM on this machine and verify that it works.

Target
- Model: Qwen 3.8 27B (Hugging Face: Qwen/Qwen3.8-27B)
- Runtime: vLLM
- Build: FP8, RedHatAI/Qwen3.8-27B-FP8
- Context window: 16,384 tokens (16K)
- Hardware this was sized for: NVIDIA L40S (48 GB)

Estimates from llmsizing.com
- Memory: 31.8 GB of 46.2 GB usable (weights 28.8 GB, KV cache 1.0 GB, approximate, overhead 2.0 GB)
- Fit: Fits comfortably. 14.4 GB headroom left for a longer context or other apps.
- Speed: 16.2–27 tok/s for one request. Modelled from memory bandwidth and model size. No published measurement covers this setup.
- Parallel requests at this context length: about 15

Steps
1. Check the hardware before downloading anything (`nvidia-smi`, or the vendor's equivalent). If it is not NVIDIA L40S (48 GB), or less than 31.8 GB of memory is free, stop and tell me what you found.
2. Check whether vLLM is installed with `vllm --help`. If it is not, install it:
   - Linux with an NVIDIA GPU: `uv venv --python 3.14 --seed && source .venv/bin/activate && uv pip install vllm --torch-backend=auto`
   - AMD GPUs: `uv pip install vllm --extra-index-url https://wheels.vllm.ai/rocm/`
3. Start the model: `vllm serve RedHatAI/Qwen3.8-27B-FP8 --max-model-len 16384`
4. Send one short test prompt. Then report, next to the estimates above: memory actually used (`nvidia-smi`), tokens per second, and whether everything runs on the GPU.
5. Tell me the base URL and model name to use from other tools. vLLM API: http://localhost:8000/v1.

Rules
- Ask me before using sudo, changing system settings or installing system packages.
- Do not delete or replace models that are already on this machine.
- If the download is larger than the free disk space, stop and tell me.
- If the measured memory or speed is far from the estimates, say so plainly.

Sized with https://llmsizing.com/?m=qwen3-8-27b&hw=nvidia-l40s-48gb&q=q8_0&ctx=16384&rt=vllm
Setup guide: https://llmsizing.com/guides/vllm

How to read our numbers for vLLM

The question for vLLM is not how much memory it uses, since it puts all of it to work, but whether weights plus one request of your context length fit, and how many such requests fit at once. Our vLLM numbers use the safetensors sizes from Hugging Face and count every layer's cache at full length.

  • Gated models need a Hugging Face token in HF_TOKEN.
  • Several GPUs need --tensor-parallel-size N; otherwise only the first is used.

76 models with a ready FP8 build for vLLM

Command
Qwen 3 0.6B1.0 GB
Llama 3.2 1B Instruct1.9 GB
DeepSeek R1 Distill Qwen 1.5B2.1 GB
Qwen 3 1.7B2.5 GB
SmolLM3 3B3.1 GB
Phi-3 Mini 3.8B3.7 GB
Qwen 2.5 3B3.8 GB
Gemma 2 2B4.1 GB
Llama 3.2 3B Instruct4.1 GB
Gemma 3 4B5.0 GB
Phi-4 Mini 3.8B5.3 GB
Granite 4.0 H Tiny 7B A1B (MoE)6.6 GB
Mistral 7B Instruct v0.37.0 GB
Qwen 3.5 4B7.3 GB
Qwen 2.5 Coder 7B8.1 GB
Qwen 2.5 7B8.1 GB
DeepSeek R1 Distill Qwen 7B8.1 GB
Gemma 3n E2B8.4 GB
DeepSeek R1 Distill Llama 8B8.5 GB
Llama 3 8B Instruct8.5 GB
Qwen 3 8B8.8 GB
Qwen 2.5 VL 7B9.4 GB
Nemotron Nano 9B v29.4 GB
Gemma 2 9B9.5 GB
Gemma 3n E4B11.0 GB
Qwen 3.5 9B12.6 GB
Mistral Nemo 12B12.7 GB
Gemma 3 12B12.7 GB
Phi-3 Medium 14B13.3 GB
Gemma 4 12B14.0 GB
Phi-4 14B14.6 GB
Phi-4 Reasoning 14B14.6 GB
DeepSeek Coder V2 Lite (16B MoE)15.0 GB
Qwen 3 14B15.2 GB
DeepSeek R1 Distill Qwen 14B15.2 GB
Qwen 2.5 14B15.2 GB
Qwen 2.5 Coder 14B15.2 GB
Ministral 3 14B16.6 GB
Magistral Small 24B23.2 GB
Mistral Small 3.2 24B24.0 GB
Mistral Small 3.1 24B24.0 GB
Gemma 4 26B A4B (MoE)26.7 GB
Gemma 3 27B27.3 GB
Qwen 3.8 27B28.8 GB
Qwen 3.6 27B28.8 GB
Qwen 3 30B A3B (MoE)29.1 GB
Nemotron 3.5 Lightning 30B A3B30.1 GB
Granite 4.0 H Small 32B A9B (MoE)30.4 GB
Nemotron 3 Nano 30B A3B (MoE)30.4 GB
Gemma 4 31B31.0 GB
Qwen 3 32B32.0 GB
Qwen 2.5 Coder 32B32.0 GB
QwQ 32B32.0 GB
DeepSeek R1 Distill Qwen 32B32.0 GB
Qwen 2.5 32B32.0 GB
Qwen 3.6 35B A3B (MoE)35.1 GB
Qwen 3.5 35B A3B (MoE)35.1 GB
Mixtral 8x7B Instruct (MoE)43.7 GB
Llama 3 70B Instruct67.7 GB
DeepSeek R1 Distill Llama 70B67.7 GB
Llama 3.3 70B Instruct67.7 GB
Llama 3.1 Nemotron 70B Instruct67.7 GB
Qwen 2.5 72B70.0 GB
Qwen 2.5 VL 72B71.4 GB
Qwen3 Next 80B A3B (MoE)76.1 GB
Qwen3 Coder Next 80B A3B (MoE)76.1 GB
Llama 3.2 90B Vision Instruct85.3 GB
Llama 4 Scout (109B MoE)107 GB
Nemotron 3.5 Super 120B A12B117 GB
Qwen 3.5 122B A10B (MoE)119 GB
Nemotron 3 Super 120B A12B (MoE)120 GB
Mixtral 8x22B Instruct (MoE)131 GB
Qwen 3.5 397B A17B (MoE)377 GB
Llama 4 Maverick (400B MoE)388 GB
Qwen 3 Coder 480B A35B449 GB
Nemotron 3 Ultra 550B A55B (MoE)525 GB