vLLM: what it is, GPU needs, install, and vllm serve for agents
vLLM 0.34 as of December 2026: GPU and CPU requirements, install with uv, pip or Docker, and vllm serve with tool calling, an API key and safe binding.
vLLM is an open-source engine that serves open-weight language models over an HTTP API compatible with OpenAI’s, and with Anthropic’s Messages API too. It runs on Linux, best on an NVIDIA GPU of compute capability 7.5 or newer (T4, RTX 20-series, A100, L4, H100 and up), with AMD, Intel and CPU builds as well. The current release is 0.34.0 (November 16, 2026), for Python 3.11 to 3.14. Install it with uv pip install vllm --torch-backend=auto followed by vllm download-kernels, or run the vllm/vllm-openai Docker image. Then vllm serve <model> starts the server on port 8000. For a coding agent, add --enable-auto-tool-choice and the --tool-call-parser that matches the model, an --api-key, and --host 127.0.0.1: without it, vLLM listens on every network interface.
What vLLM is for
vLLM began in the Sky Computing Lab at UC Berkeley and describes itself as “a fast and easy-to-use library for LLM inference and serving”. You give it a model from Hugging Face, it loads the weights onto your GPUs and answers requests at /v1/chat/completions, /v1/responses, /v1/messages and the rest of the endpoints listed in its online serving docs, so any client that speaks the OpenAI or Anthropic API can use your model in place of a hosted one. What it is built for, according to its README, is throughput: PagedAttention for the attention cache, continuous batching of incoming requests, and prefix caching.
That is the difference from Ollama or llama.cpp for serving a coding agent. Ollama installs on macOS, Windows and Linux, and llama.cpp aims at inference with minimal setup across a broad range of hardware. vLLM is Linux and GPU first, and its features are about many requests at once. Our reading of the three projects’ own pages: if the model fits the laptop or the single GPU in front of you and one agent uses it, the Ollama server is the shorter road; if you rent a GPU server that several agents, an agent fanning out to subagents, or a team will call at the same time, vLLM is the tool built for that job.
Hardware it needs
vLLM is a Linux program. Its GPU install page says it “does not support Windows natively” and suggests WSL. As of December 2026:
| Hardware | Requirement | How to get it |
|---|---|---|
NVIDIA GPU | Compute capability 7.5 or higher; release wheels built for CUDA 13.0, so the driver must support CUDA 13 (0.32.0 was the last release with CUDA 12.9 builds) | PyPI wheel, or vllm/vllm-openai |
AMD GPU | ROCm 6.3 or above; MI200, MI300, MI350, Radeon RX 7900 and 9000 series; prebuilt wheels for Python 3.14 only | vLLM’s ROCm wheel index, or vllm/vllm-openai-rocm |
Intel GPU | Data Center and Arc GPUs, Python 3.14 | vLLM’s XPU wheels, or vllm/vllm-openai-xpu |
CPU only | x86 with AVX-512 (AVX2 with limited features), or Arm64 | CPU wheels from the GitHub release, or vllm/vllm-openai-cpu |
Apple silicon | macOS Sonoma or later | The community vllm-metal plugin; no Docker image |
The CPU build exists, and the CPU page covers it; the rest of this guide assumes a GPU. On NVIDIA, run nvidia-smi first: its header shows the highest CUDA version your driver supports, and below 13.0 the current wheels will not run on it.
GPU memory decides which models you can serve. The weights come first: a 30.5-billion-parameter model such as Qwen3-Coder-30B-A3B-Instruct takes about 61 GB at two bytes per parameter in BF16 (our arithmetic, before any cache), which is one 80 GB card or two smaller ones with --tensor-parallel-size 2. Whatever memory is left holds the KV cache, the per-request memory that long contexts and many parallel requests consume. A quantized checkpoint (FP8, AWQ, GPTQ and others) shrinks the first part.
Installing it
vLLM’s wheel bundles its own PyTorch, and the docs ask for a fresh environment. With uv, the docs’ recommended installer, --torch-backend=auto chooses the PyTorch build:
uv venv --python 3.14 --seed
source .venv/bin/activate
uv pip install vllm --torch-backend=auto
vllm download-kernelsCopiedWith plain pip, point it at PyTorch’s CUDA 13.0 index:
pip install vllm --extra-index-url https://download.pytorch.org/whl/cu130
vllm download-kernelsCopiedvllm download-kernels fetches FlashInfer’s precompiled kernels, and the install page says to run it after every install and every upgrade. On AMD, use uv rather than pip: with any Python other than 3.14, pip “will silently fall back to the CUDA wheel from PyPI”, which then cannot use the card.
The Docker image
vllm/vllm-openai is the server ready to run, tagged latest or a version such as v0.34.0. The Docker page publishes the port as -p 8000:8000, which Docker binds to every interface of the host; its own port docs call publishing “insecure by default”. On a server, publish to localhost instead, and pass the API key through from your shell (how to set VLLM_API_KEY without typing it into the command is in the security section below):
docker run --runtime nvidia --gpus all \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env HF_TOKEN --env VLLM_API_KEY \
-p 127.0.0.1:8000:8000 \
--ipc=host \
vllm/vllm-openai:v0.34.0 \
--model Qwen/Qwen3-Coder-30B-A3B-Instruct \
--served-model-name qwen3-coder \
--enable-auto-tool-choice --tool-call-parser qwen3_xml \
--max-model-len 64kCopiedThe volume keeps downloaded weights between runs; HF_TOKEN matters only for gated models; --ipc=host (or --shm-size) gives PyTorch the shared memory it uses between processes. Inside the container vLLM listens on all interfaces, which is what Docker needs; the 127.0.0.1 in -p is what keeps it off the network.
vllm serve for a coding agent
The bare command works for a chat test: vllm serve Qwen/Qwen2.5-1.5B-Instruct downloads the model and starts answering on port 8000. A coding agent needs more, because everything it does, reading files, running commands, editing code, arrives as tool calls. Here is a server for Qwen3-Coder:
vllm serve Qwen/Qwen3-Coder-30B-A3B-Instruct \
--served-model-name qwen3-coder \
--enable-auto-tool-choice \
--tool-call-parser qwen3_xml \
--max-model-len 64k \
--host 127.0.0.1 \
--port 8000CopiedEach flag, from the serve reference:
--served-model-nameis the name clients ask for. Without it the name is the Hugging Face path, slash included, and Claude Code “cannot use model names with/in them”, per vLLM’s Claude Code page.--enable-auto-tool-choiceis off by default, and the parser is loaded only when it is on.--tool-call-parserturns the model’s own tool-call format into OpenAI-style tool calls, so it has to match the model family (the table below).--max-model-lenis the context length, prompt plus output. Unset, vLLM takes the model’s own maximum (262,144 tokens for this model), which may not fit in memory;autopicks the largest that fits. Suffixes are accepted:64kis 64,000 and64Kis 65,536. Coding agents send long prompts, so set it deliberately.--hostand--portdecide where it listens. The port defaults to 8000. The host is the trap covered in the next section.
Before connecting an agent, check the server from the same machine:
curl http://localhost:8000/v1/models -H "Authorization: Bearer $VLLM_API_KEY"CopiedWhich tool-call parser
The tool calling page pairs parsers with model families. The ones for models people put behind coding agents, as of 0.34.0:
| Models | --tool-call-parser |
|---|---|
Qwen3-Coder 480B-A35B and 30B-A3B | qwen3_xml |
Qwen2.5, QwQ-32B, Hermes | hermes |
gpt-oss-20b and gpt-oss-120b | openai |
GLM-4.5, GLM-4.5-Air, GLM-4.6 | glm45 |
GLM-4.7, GLM-4.7-Flash | glm47 |
DeepSeek-V3-0324, DeepSeek-R1-0528 | deepseek_v3 |
DeepSeek-V3.1 | deepseek_v31 |
Kimi-K2-Instruct | kimi_k2 |
Mistral function-calling models | mistral |
Llama 3.1, 3.2, 4 | llama3_json (Llama 4: llama4_pythonic) |
A model card may name a different parser than vLLM’s page does, and some reasoning models also want a --reasoning-parser; when they disagree, the parser list in the docs of the vLLM version you run is the one the server knows. A model not on the list can be served with a parser plugin (--tool-parser-plugin), or not used for agents.
Binding, the API key, and reaching it from elsewhere
vLLM’s quickstart says the server starts “at http://localhost:8000”. The code says otherwise: in 0.34.0 the host has no default, and with no --host the launcher binds to an empty address, which means every network interface; the startup log then reads Starting vLLM server on http://0.0.0.0:8000. On a cloud server with a public address and no firewall, a bare vllm serve is open to the internet, running on your GPU bill.
--api-key helps less than it looks. The security page says it covers only paths under /v1, /v2, /inference and /cohere; others, such as /invocations, /pooling, /tokenize and /metrics, answer without it, and the docs say plainly not to rely on the key alone. So keep the server private first and use the key as a second lock:
- Agent on the same machine:
--host 127.0.0.1and nothing else to do. - Agent on your laptop: keep
127.0.0.1and forward the port over SSH, which makes the server appear atlocalhost:8000on the laptop while the tunnel is open:
Copiedssh -N -L 8000:127.0.0.1:8000 you@your-gpu-server - Several machines of yours: join them to a private network such as Tailscale and pass the server’s private address as
--host, so vLLM listens there and nowhere else (the Tailscale guide for agent servers covers the network). - Anything public: a reverse proxy in front that allows only the endpoints you use and adds its own authentication, which is what vLLM’s docs recommend. A gateway such as the LiteLLM proxy also gives each person or agent its own key and budget.
Set the key through VLLM_API_KEY rather than on the command line, where any user on the machine can read it in the process list. Generate one and keep it in your password manager:
openssl rand -hex 32CopiedThen, in the shell that will start vLLM, paste it when asked:
printf 'vLLM API key: '
read -rs VLLM_API_KEY
echo
export VLLM_API_KEYCopiedClients send it as Authorization: Bearer <key>.
Keeping it running
A server you want up after a reboot belongs in systemd. This unit is plain systemd, not something vLLM ships; adjust the user and the path to the environment you installed into. First an environment file only root can read. The first command creates it empty, and would empty an existing file of that name, so skip it if you already have one; the second opens it in your editor:
sudo install -m 600 /dev/null /etc/vllm.env
sudoedit /etc/vllm.envCopiedIn it, one line VLLM_API_KEY= followed by the key, and HF_TOKEN= if the model is gated. Then /etc/systemd/system/vllm.service:
[Unit]
Description=vLLM server
After=network-online.target
Wants=network-online.target
[Service]
User=you
EnvironmentFile=/etc/vllm.env
ExecStart=/home/you/vllm/.venv/bin/vllm serve Qwen/Qwen3-Coder-30B-A3B-Instruct --served-model-name qwen3-coder --enable-auto-tool-choice --tool-call-parser qwen3_xml --max-model-len 64k --host 127.0.0.1 --port 8000
Restart=on-failure
[Install]
WantedBy=multi-user.targetCopiedsudo systemctl daemon-reload
sudo systemctl enable --now vllm
journalctl -u vllm -fCopiedThe agent gets connection errors until the model has loaded and the log shows the server listening. Give vLLM the GPU to itself: since 0.34.0 it sizes its cache from the memory free after warmup and defaults to using all of it.
Pointing coding agents at it
Claude Code
vLLM speaks Anthropic’s Messages API, and its Claude Code page gives the variables. Claude Code sends ANTHROPIC_AUTH_TOKEN as a Bearer token, so that is where your vLLM key goes; the page requires ANTHROPIC_API_KEY too, with any value, and Claude Code asks once whether to use it in place of your subscription. All three model tiers point at the one served name:
printf 'vLLM API key: '
read -rs VLLM_API_KEY
echo
export ANTHROPIC_BASE_URL=http://localhost:8000
export ANTHROPIC_AUTH_TOKEN="$VLLM_API_KEY"
export ANTHROPIC_API_KEY=dummy
export ANTHROPIC_DEFAULT_OPUS_MODEL=qwen3-coder
export ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3-coder
export ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3-coder
claudeCopiedThe base URL is the server’s root, without /v1, as vLLM’s page gives it. Claude Code’s built-in web search will not work, because that runs on Anthropic’s servers; vLLM answers “tool type 'web_search_...' is not supported”, and the page suggests an MCP server for search instead. Remote Control is also off whenever the base URL is not Anthropic’s, per Claude Code’s variable list.
Codex
Codex talks only the Responses API to custom providers (wire_api has one value, responses, in its config reference), and vLLM serves /v1/responses. Reading the two docs together, this in your user-level ~/.codex/config.toml should connect them; Codex ignores provider settings in a project’s own .codex/config.toml:
model = "qwen3-coder"
model_provider = "vllm"
[model_providers.vllm]
name = "vLLM"
base_url = "http://localhost:8000/v1"
env_key = "VLLM_API_KEY"CopiedOpenCode and others
OpenCode 2 finds a vLLM server at 127.0.0.1:8000 by itself, with tools off because it cannot tell whether the server was started with tool calling, as the OpenCode models guide explains. Anything else that accepts an OpenAI base URL takes http://localhost:8000/v1, the served model name and the key. To mix your vLLM model with hosted ones behind one endpoint, see OpenRouter with Codex, OpenCode and Claude Code.
Errors you will meet
"auto" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be setCopiedThe agent sent tools and the server was started without tool calling. This is the wording users have reported from vLLM 0.17.0; with a named or required tool choice the docs say the request also fails with HTTP 400. Restart with both flags. If they are set and it still fails, the parser does not match the model.
Model not found. The name the agent asks for differs from --served-model-name. curl .../v1/models shows the name the server actually uses.
Connection refused. The server is still loading, is listening on a different address from the one you call, or the SSH tunnel is closed.
Refused as unauthorized. The key is missing or different; check that the agent sends it as a Bearer token.
Startup fails on memory. The weights or the context you asked for do not fit. Lower --max-model-len, use --max-model-len auto, a quantized checkpoint, or more GPUs with --tensor-parallel-size.
Chat requests all error on a base model. The docs say a model without a chat template cannot serve chat; pass one with --chat-template, or use the model’s instruct version.
Upgrading to 0.34
The 0.34.0 release notes warn that some changes “can break existing setups”. The ones a single-server setup notices: VLLM_USE_V2_MODEL_RUNNER=0 now fails at startup, as the old model runner is gone; the default block size went from 16 to 64; the cache now sizes itself, and the notes say that in most cases it is best not to set gpu_memory_utilization; huggingface_hub 2.0 or newer is required; and the llama3_json parser no longer streams tool arguments piece by piece. The Docker image is built on CUDA 13.0, so check the driver before pulling it, and run vllm download-kernels again after the upgrade.