Set up a vLLM coding agent on Windows, Mac or Linux
Updated Fact-checked
A vLLM coding agent uses a model running on a server you control. Contenox can connect from a Windows, Mac or Linux desktop. If someone already runs vLLM for you, ask for the server address and any access key and start at the connection check. Otherwise, start the server on your own computer below. Download Contenox
Contenox#
Windows with an NVIDIA GPU#
Keep Contenox on Windows. Run the vLLM server inside Ubuntu on WSL 2. The upstream NVIDIA build requires a supported GPU with compute capability 7.5 or later. Install the current NVIDIA Windows driver for your card first. Windows supplies the GPU driver to Ubuntu. GPU requirements · NVIDIA’s WSL guide
- Open PowerShell as administrator and run
wsl --install -d Ubuntu. Restart Windows if prompted. If Ubuntu is already installed,wsl -l -vshould show version 2 for it. Microsoft’s WSL setup - Open Ubuntu from Start. On the first launch, create the Linux username and password it asks for.
- In that Ubuntu terminal, run
nvidia-smi. You should see your GPU. If it is unavailable, check WSL and the Windows driver before installing vLLM. Continue with the NVIDIA commands below.
Install and start the NVIDIA server on Linux or WSL 2#
On a Linux host, first install the NVIDIA driver recommended for your distribution and check that nvidia-smi lists your GPU. These commands use vLLM’s NVIDIA package. AMD and Intel have different builds and hardware requirements. vLLM installation options
Open a terminal. Install the Python package manager uv if you don’t have it, then reopen the terminal so it can find uv. Official uv installer
curl -LsSf https://astral.sh/uv/install.sh | sh
Create a separate environment, install vLLM and start a small chat model. Run these in Linux or Ubuntu on WSL. The model downloads the first time.
uv venv --python 3.12 --seed ~/contenox-vllm
source ~/contenox-vllm/bin/activate
uv pip install vllm --torch-backend=auto
vllm serve Qwen/Qwen2.5-1.5B-Instruct \
--served-model-name local-chat --host 127.0.0.1 --port 8000 \
--max-model-len 16384 --enable-auto-tool-choice --tool-call-parser hermes
local-chat is the name you’ll see in Contenox. The hermes parser lets vLLM recognize tool calls from this Qwen2.5 model. Leave the terminal running until it reports the server has started. Next time, activate the same environment and run just the vllm serve command. vLLM quickstart · Qwen tool-calling support
macOS on Apple Silicon#
On an M-series Mac running macOS 15 or later, vLLM’s Metal plugin uses the Apple GPU. Open Terminal. If brew --version is unavailable, install Homebrew and follow its printed instructions to add it to your shell.
brew tap vllm-project/vllm-metal https://github.com/vllm-project/vllm-metal
brew install vllm-project/vllm-metal/vllm-metal
vllm serve mlx-community/Qwen2.5-7B-Instruct-4bit \
--served-model-name local-chat --host 127.0.0.1 --port 8000 \
--max-model-len 16384 --enable-auto-tool-choice --tool-call-parser hermes
Keep this terminal open during chat. This example uses the four-bit Qwen2.5 model from the Metal project’s supported-model list. If your Mac cannot run the Metal plugin, you can still connect Contenox to a server on another computer. Metal installation and requirements · Metal model list
Check the server from your desktop#
On the computer running Contenox, open http://127.0.0.1:8000/v1/models in your browser. With either example above, look for "id":"local-chat" in the JSON response. On Windows, use the Windows browser for this check even though the server runs inside Ubuntu.
Connection refused usually means the model is still loading, the server stopped, or the address or port is wrong. Check the terminal where you ran vllm serve for a startup or memory error. For a shared server, get the full reachable address from the person hosting it. 127.0.0.1 always means the computer where you opened the browser. A 401 means you reached a server that requires a key. Use the authenticated terminal check under Start the server.
Fill in the vLLM provider and send a message#
On first launch, select Use another provider. After setup, open Backends → Providers. Choose Cloud → vLLM, including when the server is on your own computer.
/v1 shown in the gray hint.| Field | What to enter |
|---|---|
| Base URL | Type http://127.0.0.1:8000 for the examples above. For a shared server, enter its scheme, hostname and port. Contenox appends /v1/models during discovery. Entering the field’s gray /v1 suffix in 1.0.23 makes the app request /v1/v1/models and can return HTTP 404. |
| Advanced → API Key (optional) | Leave blank for the loopback-only examples above. If the server requires a key, enter the key issued for that server, or use the environment variable below. |
| Advanced → Environment variable name | Leave blank if the server has no key or you filled in API Key. If Contenox should read the key from its environment, enter the variable’s name, such as VLLM_API_KEY. Set the variable on the desktop running Contenox and fully restart the app after a change. |
When editing an existing connection, a stored key is kept until you choose to replace it. You can correct the server address without retyping the key.
Select Connect. On first launch Contenox selects a default model. If it presents Default model, choose local-chat and select Save and continue. In an existing workspace choose local-chat under Model. In Contenox Scratchpad, ask Suggest three checks before launching a website on mobile. The answer should appear in your chat. Continue with your first project
Use vLLM with your agent#
| Agent | Supported? | How | Note |
|---|---|---|---|
| Claude Code | Works, not supported by Anthropic | ANTHROPIC_BASE_URL=http://gpu-host:8000 and the model tiers set to your served name |
vLLM documents this. Anthropic doesn’t support Claude Code with non-Claude models |
| Codex CLI | Yes | A custom [model_providers.vllm] block with base_url = "http://gpu-host:8000/v1" |
Codex only speaks the Responses API, which vLLM serves at /v1/responses |
| OpenCode | Yes | Local vLLM discovery, or providers.vllm.settings.baseURL for another endpoint |
Discovered models advertise text. Verify parser support before enabling tools. |
| Contenox | Yes | Backends → Providers → vLLM, host and port only | Reads the model and its context length from the server |
Start the server#
The other-client examples below use a larger Qwen3-Coder model and a server key. They require enough GPU memory for the model. Replace YOUR_KEY with your own access key on the server and client, and gpu-host with the actual host in the requests below.
vllm serve Qwen/Qwen3-Coder-30B-A3B-Instruct \
--served-model-name qwen3-coder \
--enable-auto-tool-choice \
--tool-call-parser qwen3_xml \
--api-key YOUR_KEY
--served-model-name gives the model a short name. Claude Code needs it: names with a slash, like the Hugging Face path, don’t work there.
The server listens on port 8000. Check it from the machine where the agent runs. In PowerShell on Windows:
curl.exe http://gpu-host:8000/v1/models -H "Authorization: Bearer YOUR_KEY"
On macOS or Linux:
curl http://gpu-host:8000/v1/models -H "Authorization: Bearer YOUR_KEY"
If that returns your model, the agent can reach it.
Which tool-call parser does my model need?#
The parser must match the format the model writes its tool calls in. From the vLLM tool calling guide:
| Model family | --tool-call-parser |
|---|---|
| Qwen3-Coder | qwen3_xml |
| Qwen2.5 | hermes |
| Mistral | mistral |
| Llama 3.x | llama3_json, plus a --chat-template for Llama 3.1 |
| gpt-oss | openai |
| DeepSeek V3.1 | deepseek_v31 |
| GLM-4.5 and GLM-4.6 | glm45 |
The guide lists more families, and some need a --chat-template file from vLLM’s examples. A wrong parser often fails quietly: the model describes the tool call in plain text instead of making it.
What else should I set when starting vLLM?#
--api-key(or theVLLM_API_KEYenvironment variable): requires a key on/v1requests. Anyone who can reach an open server can use it.--max-model-len: the context length. Agents send long prompts, so give it as much as your GPU memory allows. If you leave it out, vLLM takes the value from the model’s config.--hostand--port: where the server listens. The port defaults to 8000.
Claude Code#
Point Claude Code at the server and map all three model tiers to your served name. In PowerShell on Windows:
$env:ANTHROPIC_BASE_URL = "http://gpu-host:8000"
$env:ANTHROPIC_API_KEY = "YOUR_KEY"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_KEY"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "qwen3-coder"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "qwen3-coder"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "qwen3-coder"
claude
On macOS or Linux:
ANTHROPIC_BASE_URL=http://gpu-host:8000 \
ANTHROPIC_API_KEY=YOUR_KEY \
ANTHROPIC_AUTH_TOKEN=YOUR_KEY \
ANTHROPIC_DEFAULT_OPUS_MODEL=qwen3-coder \
ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3-coder \
ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3-coder \
claude
vLLM’s own example uses dummy for both keys on a server started without --api-key.
The slow-every-turn trap: newer Claude Code builds send a per-request attribution header that can defeat vLLM’s prefix caching. vLLM versions above 0.17.1 handle it. On older ones, set CLAUDE_CODE_ATTRIBUTION_HEADER to "0" in the env section of ~/.claude/settings.json. See prompt caching. Why it matters is measurable: in Contenox’s own inference daemon, a stable prompt of about 9,000 tokens took 1.77 s to prefill cold and 0.03 s warm on a 6 GB laptop GPU, and editing the stable part sent the next turn back to the full prefill.
The web search gotcha: Claude Code’s built-in web search fails with tool type 'web_search_...' is not supported, because vLLM rejects that server-side tool. Add a web search MCP server instead. And since Anthropic doesn’t support Claude Code with non-Claude models, other features may break the same way.
Codex CLI#
Add a provider to ~/.codex/config.toml. Codex ignores provider settings in a project’s .codex/config.toml, so it has to be the user-level file.
model_provider = "vllm"
model = "qwen3-coder"
[model_providers.vllm]
name = "vLLM"
base_url = "http://gpu-host:8000/v1"
env_key = "VLLM_API_KEY"
Set the key in PowerShell with setx VLLM_API_KEY "YOUR_KEY" and open a new terminal, or on macOS or Linux with export VLLM_API_KEY="YOUR_KEY". Then run codex.
Codex sends requests in the Responses API format only; it’s the only wire_api value Codex accepts. vLLM serves it at /v1/responses.
OpenCode#
OpenCode v2 checks a local vLLM server at http://127.0.0.1:8000. Once the server is running, use /models to select a discovered model. For a different address, set providers.vllm.settings.baseURL to the server’s OpenAI-compatible URL including /v1. This differs from the Contenox field shown above.
Discovery reads the context limit from vLLM. It cannot tell whether the server has a working tool-call parser. If you need file or shell tools, start vLLM with the parser your model requires and declare tools for that model in OpenCode only after verifying the server supports them. OpenCode’s vLLM settings
Common errors#
- Connection refused or Unreachable: the server isn’t running, the port is blocked from your computer, or (in Contenox) the address has a path after the port. Run the
curlcheck above from the same machine. - 401 or Key rejected: the key doesn’t match the server’s
--api-key. - 400 error mentioning
tool_choice: the server was started without--enable-auto-tool-choiceand--tool-call-parser. Restart it with both. With containers, check that the flags reach the actualvllm servecommand. - Model not found: the name in the agent doesn’t match
--served-model-name. - The model replies in text instead of calling tools: the parser doesn’t match the model, or the model needs a chat template.
- Requests fail on long sessions: the conversation exceeds
--max-model-len. Raise it if memory allows, or lower the context limit in your agent.
Related#
Run models locally: hardware and model choice for local agentsLocal AI coding agent: Claude Code, Codex, OpenCode setupRun a local AI coding agent on your own hardware: Ollama or vLLM, setup for Claude Code, Codex CLI and OpenCode, memory needs, and models that call tools.
Ollama: the single-computer optionSet up an Ollama coding agent on Windows, Mac or LinuxSet up an Ollama coding agent in Contenox on Windows, macOS or Linux. Install Ollama, download a chat model, check the connection and send your first message.
How to run local LLMs for codingHow to run local LLMs for coding: hardware, setup, contextHow to run local LLMs for coding: which model fits your GPU, the Ollama setup, the context setting that breaks agents, and connecting Claude Code, Codex or OpenCode.
Keep secrets away from AI agentsHow to keep secrets away from AI agents (and out of git)How to keep secrets away from AI agents: block .env reads in Claude Code, OpenCode and Codex, stop keys leaking through commands, and what to do if one leaked.
ChatGPT subscriptionUse your ChatGPT subscription for a coding agent | ContenoxUse your ChatGPT subscription for a coding agent. Set up device sign-in in Contenox or use Codex on desktop, in an editor or in the terminal. Check plan limits.
GitHub Copilot subscriptionUse your GitHub Copilot subscription in other coding agentsUse your GitHub Copilot subscription outside VS Code: sign-in steps for OpenCode, Codex and Contenox Harness, which plans you need, and how AI Credits are billed.
Anthropic (Claude)Claude coding agent on Windows: API key setup | ContenoxRun a Claude coding agent on Windows: Claude Code with a subscription or API key, OpenCode with a key, why Codex can't, plus models, billing and key errors.
GeminiGemini coding agent: API key, free tier and setup | ContenoxSet up a Gemini coding agent: AI Studio key in OpenCode, Antigravity CLI or Contenox Harness, why Claude Code and Codex can't, free-tier data use, models and 429 fixes.