vLLM is what you put in front of an open model when more than one person will use it. It is fast, most production deployments run on it, and it has a reputation for being painful to install.
The reputation is earned, but the cause is narrow. Most tools ship a program that just runs. vLLM ships pre-compiled GPU code, small optimised routines built for one version of NVIDIA's CUDA toolkit and one version of PyTorch. If the versions on your machine don't match the ones the download was built for, the code can't load. The installer then drops the download and tries to rebuild everything from source on your machine. That is the thirty-minute wait people complain about, and it usually ends in an error like undefined symbol that says nothing about the real cause.
The fix comes down to two things, and the rest of this guide is detail:
- Use
uvinstead ofpip. Its--torch-backend=autoflag reads your GPU driver and picks the matching versions, which removes the guesswork behind most failed installs. - Install into a brand-new, empty Python environment. If PyTorch is already there, you are heading for the slow rebuild.
Table of contents
- First, check that vLLM is even installable on your machine
- Why the install is hard (the actual reason)
- One more check, then size the model
- Linux with an NVIDIA GPU, the supported path
- Windows, WSL2, and the one mistake that breaks it
- macOS and Apple Silicon, CPU only, and what that means
- Serve a model and verify it
- The five errors everyone hits
- Lock the port down before you forget
- Is vLLM even the right tool for you
- FAQ
- Sources
First, check that vLLM is even installable on your machine
Do this before running any command below. Most "vLLM won't install" frustration is one of these answers being no, and no flag or reinstall changes it.
| If your machine is… | vLLM will… | What to do |
|---|---|---|
| Linux + NVIDIA GPU (compute capability 7.5+) | Work properly, GPU-accelerated | Follow the Linux steps below |
| Windows + NVIDIA GPU | Work inside WSL2 | Follow the Windows section |
| Mac (M1/M2/M3/M4 or Intel) | Run on CPU only: no GPU, source build, experimental | Use Ollama or LM Studio instead |
| Any machine with an older NVIDIA card (GTX 10-series or earlier) | Not work at all | Hardware floor, no workaround |
| Any machine, no NVIDIA GPU | Run on CPU only, slowly | Use Ollama or LM Studio |
Then check your Python version, because there is a hard floor here too:
python3 --versionvLLM needs Python 3.10 to 3.13. If that prints 3.9 (the version macOS still ships) or 3.14, the install fails whatever else you do. The Linux steps below get around this by having uv fetch its own Python, so you never touch the system one.
The Mac case is the most common disappointment, so to be blunt: vLLM's advantage is custom NVIDIA GPU code, and Apple Silicon has no NVIDIA GPU. vLLM will not serve models fast on a MacBook. If you want local models on that machine, Ollama and LM Studio both use Metal and install in a minute. Read the rest as reference for the Linux box you deploy to.
Why the install is hard (the actual reason)
Ollama ships a self-contained binary. vLLM can't, because it exists to provide custom CUDA kernels (PagedAttention, continuous batching) that must be compiled against a specific CUDA toolkit and linked against a specific PyTorch ABI.
That gives you a four-way compatibility matrix:
| Axis | Constraint |
|---|---|
| Python | 3.10 – 3.13 on the CUDA path |
| CUDA | Released wheels are built against 12.9; 12.8 and 13.0 also published |
| PyTorch | The wheel is built against one public PyTorch release |
| GPU | NVIDIA compute capability 7.5+ (T4, A100, L4, H100, B200) |
Each of these consequences is a documented failure, not folklore.
A different CUDA version means building from source, and so does a PyTorch that is already installed. The docs say the compiled kernels are "binary incompatible with other CUDA versions and PyTorch versions", even across differently-configured builds of the same PyTorch version. They recommend a "fresh new" environment. That is not boilerplate caution. It is the highest-yield thing you can do.
Conda-installed PyTorch is the worst case. It statically links NCCL, which breaks vLLM's own NCCL usage. If your PyTorch came from conda, you don't have a version problem, you have a rebuild.
Building from source needs GCC/G++ ≥ 11.3, because PyTorch's C++20 headers don't compile on older GCC. On an older LTS distro, this is the wall people hit after the thirty-minute wait.
uv fixes most of this for a dull reason: --torch-backend=auto inspects your installed CUDA driver and selects the matching PyTorch index. That removes the most common cause of a mismatched install, a human picking the wrong index URL.
One more check, then size the model
You have checked your GPU and your Python version. The third check is the one people skip:
python3 -c "import torch" 2>&1 | head -1If that succeeds, don't install vLLM into this environment. An existing PyTorch is the most common trigger for the slow source build, because vLLM's pre-compiled code was built against a different one. Success here is the bad outcome. Make a new, empty environment instead, which Step 2 below does.
Then size the model before you download 40 GB of weights. vLLM claims 92% of your VRAM by default (--gpu-memory-utilization defaults to 0.92), and the KV cache lives inside that budget, so context length is a memory decision. Work it out first with the AI VRAM Calculator: pick the model, set the quantization you intend to serve, and use a realistic context length instead of the model's theoretical maximum.
Linux with an NVIDIA GPU, the supported path
This is the only configuration vLLM treats as a first-class serving target. It takes four commands.
Step 1: install uv
curl -LsSf https://astral.sh/uv/install.sh | shStep 2: create a fresh, isolated environment
uv venv --python 3.12 --seed --managed-python
source .venv/bin/activate--managed-python makes uv fetch its own Python 3.12 instead of trusting whatever the distro ships. If your python3 is 3.9 or 3.14, this is what saves you.
Step 3: install vLLM
uv pip install vllm --torch-backend=autoThat is the whole install. --torch-backend=auto reads your driver and picks the matching PyTorch index. To force one, use --torch-backend=cu130 or set UV_TORCH_BACKEND.
Step 4: verify before you trust it
python -c "import vllm; print(vllm.__version__)"If that prints a version, your kernels loaded and the hard part is over.
Plain pip works too, but you name the index yourself, and that is where mistakes happen:
pip install vllm --extra-index-url https://download.pytorch.org/whl/cu129If you go looking for nightlies, note that installing them with pip is unsupported. Pip merges the extra index with PyPI and takes whichever version is newest, while uv gives the extra index priority. That is a real behavioural difference between the tools, not a preference.
Blackwell owners: B200 and GB200 need at least CUDA 12.8, so the PyTorch wheels must be at least that version.
Windows, WSL2, and the one mistake that breaks it
There is no native Windows build. vLLM's platform list names CUDA, ROCm, Intel XPU, Apple Silicon and several CPU architectures, and Windows is not on it. WSL2 is the working route.
Install WSL2 with Ubuntu from PowerShell:
wsl --install -d Ubuntu
wsl --updateNow the mistake. Inside WSL, nvidia-smi works, and it is tempting to apt install the CUDA toolkit the normal way. Do not install a Linux GPU driver inside WSL. NVIDIA says so bluntly: "This is the only driver you need to install. Do not install any Linux display driver in WSL". The Windows host driver is stubbed into the distro as libcuda.so, and a standard CUDA Toolkit install bundles its own driver and clobbers that mapping. Your GPU stops being visible, and nothing in the error message points back at the cause.
Install the NVIDIA driver on Windows only. If you then need the toolkit inside WSL, use the WSL-Ubuntu package from NVIDIA's CUDA downloads page, which leaves out the Linux driver. With meta-packages, install cuda-toolkit-12-x and never cuda, cuda-12-x or cuda-drivers, all of which pull in the driver.
For vLLM you usually need no toolkit at all. The wheel ships pre-compiled kernels and the host driver satisfies them. Install the Windows driver, then follow the Linux steps above inside the distro.
nvidia-smi # run this INSIDE wsl - if your GPU appears, the mapping worksTwo other WSL2 facts. NVIDIA still labels toolkit support on WSL a preview: application development and compilation are supported, but not every profiler is there. And GPU acceleration needs Pascal or later in WDDM mode, so TCC-mode Quadro and Tesla cards are not covered.
macOS and Apple Silicon, CPU only, and what that means
On Apple Silicon, vLLM is a CPU-only source build labelled experimental. There is no Metal or MPS acceleration in-tree.
You need macOS Sonoma or later, XCode 15.4+ with Command Line Tools, Apple Clang ≥ 15.0.0 and Python 3.10–3.13. There are no pre-built Apple Silicon wheels and no pre-built container images.
git clone https://github.com/vllm-project/vllm.git
cd vllm
uv pip install -r requirements/cpu.txt
uv pip install -e .VLLM_TARGET_DEVICE is set to cpu automatically, so you don't choose. The docs call out two build failures: missing standard C++ headers (reinstall Command Line Tools) and constexpr errors from an older C++ standard (add set(CMAKE_CXX_STANDARD 17) to cmake/cpu_extension.cmake).
The CPU quantization support list covers x86 and s390x only, so AWQ, GPTQ and INT8 W8A8 are not listed for Apple Silicon. The build is smoke-tested in CI on the latest GA Apple Silicon runner. Other macOS or Clang versions are best-effort.
The docs don't literally say "development only", so I won't put words in their mouth. They do say experimental, source-only, CPU-only, FP32/FP16 only. If you want high-throughput serving on a Mac, vLLM is the wrong tool and LM Studio or Ollama are right, since both have real Metal acceleration. If you want to develop against vLLM's API on a Mac and deploy to a Linux GPU box, this build does that job.
There is also a community hardware plugin, vllm-metal, that uses MLX as its compute backend. It is out-of-tree and community-maintained, so judge it on those terms.
Serve a model and verify it
Start small. A 1.5B model proves the install without a long download.
vllm serve Qwen/Qwen2.5-1.5B-InstructThat serves on http://localhost:8000 (override with --host and --port), one model per server process.
Check it is up:
curl http://localhost:8000/v1/modelsThen send a real request:
curl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen2.5-1.5B-Instruct",
"prompt": "San Francisco is a",
"max_tokens": 7,
"temperature": 0
}'The server speaks the OpenAI protocol, so any OpenAI client works. Point base_url at http://localhost:8000/v1 and pass a dummy key.
For offline batch work, skip the server:
from vllm import LLM, SamplingParams
llm = LLM(model="facebook/opt-125m")
outputs = llm.generate(["The capital of France is"], SamplingParams(temperature=0.8, top_p=0.95))
print(outputs[0].outputs[0].text)That snippet has a trap that costs people an afternoon: llm.generate does not apply the model's chat template. On an instruct or chat model, raw generate gives noticeably worse output, for reasons that look like a model problem. Use llm.chat(messages, sampling_params), or apply tokenizer.apply_chat_template yourself.
Also, vLLM applies generation_config.json from the Hugging Face repo by default. If you want vLLM's own defaults, pass generation_config="vllm" (or --generation-config vllm on the server).
The five errors everyone hits
undefined symbol, or a missing library, on import
Your kernels were built against a different PyTorch or CUDA than the one present. This is the fresh-environment rule being enforced. Don't debug it. Rebuild in a clean venv with --torch-backend=auto.
Out of memory at startup, before any request
vLLM pre-allocates. The default --gpu-memory-utilization is 0.92, and the KV cache is inside that. Lower it, or cap what actually drives the cache:
vllm serve <model> --gpu-memory-utilization 0.85 --max-model-len 8192 --max-num-seqs 8--max-model-len caps context and --max-num-seqs caps concurrent sequences. If you leave --max-model-len unset it is derived from the model config, which often means the model's theoretical maximum. That is far more than you need and the usual reason a model that "should fit" doesn't.
Still out of memory after that
CUDA graphs are on by default and cost extra GPU memory. Cap the capture sizes via compilation_config with cudagraph_capture_sizes (e.g. [1, 2, 4, 8, 16], which otherwise goes up to max_num_seqs), or disable capture with --enforce-eager. Eager mode is slower, a trade of speed for memory, so try the flags in that order.
Two vLLM processes on one card, both crash
--gpu-memory-utilization is per instance, not global. Two servers each claiming 0.92 of the same GPU is 184%. Give each about 0.45.
A source build that runs 30+ minutes, then fails
Check GCC with gcc --version; it needs ≥ 11.3. Then ask why you are building at all. A mismatched CUDA or a pre-existing PyTorch is almost always the answer, and a clean venv is faster than fixing the compile. If you must build and the machine has limited RAM, cap parallel jobs with MAX_JOBS.
Lock the port down before you forget
vLLM's server has no authentication by default. On a reachable interface, anyone who can hit port 8000 can use your GPU and read anything you send through it.
Enable a key:
vllm serve <model> --api-key "$(openssl rand -hex 32)"Or set VLLM_API_KEY. Multiple keys are accepted, so rotation needs no downtime. Generate real values instead of reusing a memorable string; the API Key & .env Secret Generator does it locally in your browser.
Bind deliberately too. If the server only serves apps on the same machine, keep it on loopback and put a reverse proxy with TLS in front for anything else. A GPU box on a shared network with an open inference port invites trouble.
Is vLLM even the right tool for you
Plenty of people install vLLM when they wanted Ollama.
| vLLM | Ollama / LM Studio | |
|---|---|---|
| Install | Version matrix, fresh venv required | Single installer |
| Platforms | Linux GPU (real), WSL2, macOS CPU-only | Linux, Windows, macOS all native |
| Concurrency | Continuous batching, high GPU utilisation | Requests largely serialise |
| Single-user latency | Good | Good, and far easier |
| Apple Silicon GPU | No in-tree support | Yes, Metal |
vLLM earns its complexity when you have concurrency. PagedAttention plus continuous batching keeps the GPU busy across many simultaneous requests, which a single-user desktop chat never needs. If you are one person talking to one model, Ollama installs in a minute and serves you better; LM Studio vs Ollama covers that choice. If you are putting a model behind an API that several people or several agent loops will hit at once, vLLM is worth the setup and the alternatives will bottleneck. Decide on concurrency, not on benchmark screenshots.
FAQ
What is the most reliable way to install vLLM?
A fresh uv virtual environment on Linux with an NVIDIA GPU, then uv pip install vllm --torch-backend=auto. The fresh environment prevents the binary-incompatibility failures, and --torch-backend=auto picks the PyTorch index that matches your driver.
Can I run vLLM natively on Windows?
No. vLLM's supported platform list has no Windows entry. Use WSL2 with Ubuntu, install the NVIDIA driver on the Windows host only, and follow the Linux instructions inside the distro. If your GPU vanishes inside WSL after installing CUDA, you installed a Linux GPU driver that overwrote the host driver WSL maps in as libcuda.so.
Does vLLM use the GPU on an M-series Mac?
Not in-tree. The native macOS path is an experimental, source-only, CPU-only build with FP32/FP16 support. Metal acceleration exists only through the community vllm-metal plugin, which uses MLX. For GPU-accelerated local inference on a Mac, use Ollama or LM Studio.
Why does vLLM run out of memory when the model should fit?
Usually two reasons. --gpu-memory-utilization defaults to 0.92 and the KV cache is inside that budget. And --max-model-len, if unset, comes from the model config, often the model's maximum context, which makes the cache far larger than your workload needs. Set both explicitly, and use the AI VRAM Calculator to pick a context length you can afford. You don't need the CUDA toolkit for any of this: released wheels ship pre-compiled CUDA 12.9 binaries and the driver satisfies them.
Sources
- vLLM GPU installation docs: Python and CUDA support,
uvinstall commands, CUDA 12.9 default wheels, binary-incompatibility and GCC ≥ 11.3 warnings, conda/NCCL caveat - vLLM CPU installation docs: macOS Sonoma / XCode 15.4 / Apple Clang requirements, source-only build,
vllm-metalplugin note, documented build failures - vLLM quickstart:
vllm serve, port 8000, curl examples, offlineLLMclass, chat-template caveat,--api-key - vLLM engine arguments:
--gpu-memory-utilizationdefault0.92,--dtype auto,--enforce-eagerdefaultFalse,--max-model-lenderivation - vLLM: conserving memory:
max_model_len/max_num_seqs, CUDA graph capture sizes,enforce_eager, quantization - vLLM installation index: supported platform list (no Windows entry)
- NVIDIA CUDA on WSL user guide: host driver stubbed as
libcuda.so, explicit "do not install any Linux display driver in WSL", WSL-Ubuntu package guidance, WDDM/Pascal requirement - vllm-project/vllm on GitHub: Apache-2.0 licence, hardware support matrix
