vLLM is the open-source inference engine many companies use to serve large language models in production. It’s built for throughput: many users, long contexts and fast batching on NVIDIA and AMD GPUs, with an OpenAI-compatible API out of the box.
Installing it has changed a lot in late 2026. vLLM now needs Python 3.11 or newer, ships CUDA 13 wheels only, and adds a new vllm download-kernels step.
This guide shows how to install vLLM 0.34 on Linux (and Windows through WSL), serve your first model, call it from the OpenAI SDK, run it in Docker, use the key flags, and fix common errors. It follows the official vLLM docs and PyPI release as of November 2026.
- Latest: vLLM 0.34.0 (16 Nov 2026). Python 3.11 to 3.14.
- GPU: NVIDIA compute capability 7.5+ (RTX 20 series and newer); default wheels use CUDA 13.0.
- Install:
uv pip install vllm --torch-backend=auto, thenvllm download-kernels. - Serve:
vllm serve Qwen/Qwen3-0.6Bon port 8000. - Windows: use WSL2; there’s no native Windows support.
- Docker:
vllm/vllm-openai:latestwith--gpus all --ipc=host.
What vLLM Is (and When to Use It)
- High throughput: PagedAttention and continuous batching let one GPU serve many requests at once.
- OpenAI-compatible server: chat completions, completions, responses, embeddings, transcriptions and model listing endpoints.
- Anthropic-compatible endpoint:
/v1/messagesis also available. - Hugging Face models: serve most popular open models directly by their Hugging Face name.
- Multi-GPU: tensor parallelism splits large models across GPUs.
vLLM shines when you’re serving a model to an app or a team. For a single person chatting on a gaming PC, Ollama or LM Studio are usually simpler. Our vLLM vs llama.cpp vs Ollama comparison goes deeper.
Requirements
| Item | Requirement (vLLM 0.34) |
|---|---|
| Operating system | Linux (Windows via WSL2) |
| Python | 3.11, 3.12, 3.13 or 3.14 |
| NVIDIA GPU | Compute capability 7.5+ (T4, RTX 20/30/40/50, A100, L4, H100, B200) |
| CUDA | Default wheels built for CUDA 13.0 (CUDA 12.9 wheels ended with 0.32.0) |
| CPU architectures | x86_64 and aarch64 wheels |
| VRAM | Enough for the model weights plus KV cache |
Make sure your NVIDIA driver is new enough for CUDA 13. On Windows, set up GPU support in WSL first with our WSL2 local AI setup guide. Choosing hardware? See the best GPU for local LLMs.
Install vLLM With uv or pip
The docs recommend uv, a fast Python package manager.
- Create a virtual environment:
uv venv --python 3.12 --seed --managed-python source .venv/bin/activate - Install vLLM (uv picks the right PyTorch build):
uv pip install vllm --torch-backend=auto - Download the GPU kernels (a new step in recent versions):
vllm download-kernels - Check the install:
vllm --version
Using plain pip instead:
python3 -m venv vllm-env
source vllm-env/bin/activate
pip install vllm --extra-index-url https://download.pytorch.org/whl/cu130
vllm download-kernels
Always install vLLM in a fresh environment. Mixing it with other projects’ PyTorch versions is the most common cause of broken installs.
Serve Your First Model
- Log in to Hugging Face if the model is gated, or set
HF_TOKEN. See how to download models from Hugging Face. - Start the server with a small model to test:
vllm serve Qwen/Qwen3-0.6B - Wait for “Application startup complete”. The first run downloads the model.
- Check it’s running:
curl http://localhost:8000/v1/models - Send a chat request:
curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"Qwen/Qwen3-0.6B","messages":[{"role":"user","content":"Hello!"}]}'
Chat endpoints need a chat template. Most instruction-tuned models include one; for models that don’t, pass --chat-template your_template.jinja.
Call vLLM From the OpenAI SDK
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
r = client.chat.completions.create(
model="Qwen/Qwen3-0.6B",
messages=[{"role": "user", "content": "Summarise what vLLM does in one line."}],
)
print(r.choices[0].message.content)
If you started the server with --api-key, use that key instead of EMPTY. Other useful endpoints include /v1/embeddings, /v1/responses, /health and /metrics.
Important vllm serve Flags
| Flag | What it does |
|---|---|
--port 8000 |
Port to listen on (default 8000) |
--max-model-len 32k |
Cap the context length to save memory; auto uses the largest that fits |
--gpu-memory-utilization 0.85 |
Fraction of GPU memory vLLM may use |
--tensor-parallel-size 2 / -tp 2 |
Split the model across 2 GPUs (default 1) |
--quantization / -q |
Quantization method; read from the model config if not set |
--dtype auto |
Weight precision: auto, half, bfloat16 or float32 |
--served-model-name mymodel |
Name clients use in the model field |
--api-key KEY |
Require a key on the /v1 API |
--enforce-eager |
Disable CUDA graphs (uses less memory, slower) |
--trust-remote-code |
Allow custom model code from Hugging Face (only for repos you trust) |
Security note: the docs say --api-key protects the /v1 routes but not every endpoint, so don’t expose vLLM directly to the internet. Put it behind a reverse proxy with proper authentication.
Run vLLM in Docker
docker run --runtime nvidia --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=$HF_TOKEN" \
-p 8000:8000 --ipc=host \
vllm/vllm-openai:latest --model Qwen/Qwen3-0.6B
--ipc=host(or a large--shm-size) is needed for shared memory between processes.- The volume keeps downloaded models between container restarts.
- AMD image:
vllm/vllm-openai-rocm:latest. - CPU images:
vllm/vllm-openai-cpu:latest-x86_64andlatest-arm64.
You’ll need the NVIDIA Container Toolkit installed. If you already run Ollama in containers, the setup is similar to our Ollama Docker guide.
AMD, Intel, CPU and Mac
| Hardware | Status | How |
|---|---|---|
| AMD ROCm GPUs | Supported (ROCm 6.3+) | uv pip install vllm --extra-index-url https://wheels.vllm.ai/rocm/ --upgrade; prebuilt wheels need Python 3.14 |
| Intel GPUs (XPU) | Supported | Python 3.14 only |
| x86 and ARM CPUs | Supported | Prebuilt CPU wheels or Docker images |
| Apple Silicon | Community plugin | vLLM-Metal (MLX backend, macOS Sonoma+) |
AMD gotcha: the docs warn that on Python 3.12 or 3.13, pip can silently install the CUDA wheel instead of the ROCm one, which then fails on AMD GPUs. Use Python 3.14 for prebuilt ROCm wheels. Supported AMD GPUs include MI200/MI300/MI350, Radeon RX 7900 and 9000 series, and Ryzen AI MAX.
vLLM vs Ollama vs llama.cpp
| vLLM | Ollama | llama.cpp | |
|---|---|---|---|
| Best for | Serving many users | Easy personal use | Flexible local inference |
| Model format | Hugging Face (safetensors), many quant formats | Ollama library / GGUF | GGUF |
| Windows | WSL2 only | Native | Native |
| Throughput under load | Excellent | Good | Good |
| Setup | Moderate | Very easy | Easy to moderate |
For a lightweight llama.cpp server instead, see our llama-server guide.
A Simple Production Checklist
Once your first model answers, a few habits make vLLM far easier to run every day, whether it’s a home lab box or a shared team server.
- Pin the version. Install a fixed release (for example
vllm==0.34.0) so an upgrade never surprises you. vLLM changes defaults often between releases. - Start small, then grow. Test with a small model and a short
--max-model-len, then raise context and model size while watching VRAM innvidia-smi. - Protect the port. Add
--api-keyand keep port 8000 behind a firewall or reverse proxy. Never expose an open vLLM server to the internet. - Cache downloads. Mount or reuse
~/.cache/huggingfaceso restarts and Docker containers don’t download the same weights again. - Watch the metrics. vLLM serves Prometheus metrics at
/metrics, which shows queue length, token throughput and cache use.
If you only ever chat alone on one PC, this is also the moment to ask whether Ollama or llama.cpp would be simpler. vLLM shines when many requests arrive at once.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| CUDA out of memory at startup | Context too long or model too big | Lower --max-model-len, lower --max-num-seqs, quantize, or add GPUs with -tp |
| CUDA driver too old | Driver doesn’t support CUDA 13 | Update the driver, or set VLLM_ENABLE_CUDA_COMPATIBILITY=1 with the cuda-compat package |
| Crash in graph.replay | CUDA graph issue | Add --enforce-eager |
| Model download hangs | Slow or blocked Hugging Face download | Download first with the hf CLI and pass the local path |
| “CUDA was previously initialized” | Multiprocessing method | Set VLLM_WORKER_MULTIPROC_METHOD=spawn |
| Chat endpoint error about templates | Model has no chat template | Pass --chat-template |
| AMD GPU not used | CUDA wheel installed by mistake | Reinstall from the ROCm index with Python 3.14 |
| Need more detail | Default logging | Set VLLM_LOGGING_LEVEL=DEBUG |
General GPU memory tips are in our CUDA out of memory guide.
FAQ
Does vLLM work on Windows?
Not natively. Use WSL2 with GPU support, or run the Docker image.
Which Python version does vLLM need?
vLLM 0.34 supports Python 3.11 to 3.14. Prebuilt AMD ROCm and Intel wheels need 3.14.
What port does vLLM use?
8000 by default, with the OpenAI-compatible API at http://localhost:8000/v1.
Can vLLM run GGUF models?
vLLM is built mainly for Hugging Face models and its supported quantization formats. For GGUF, Ollama or llama.cpp are usually the better fit.
What is vllm download-kernels?
A step in recent vLLM versions that downloads the GPU kernels after installing the package.
Does vLLM support AMD GPUs?
Yes, with ROCm 6.3 or newer, including Radeon RX 7900 and 9000 series and MI-series accelerators.
How do I secure a vLLM server?
Use –api-key and keep it behind a reverse proxy with authentication, since the key doesn’t cover every endpoint.




