TutorialsGB10

Use Claude Code or Codex with a model on your own DGX Spark

Serve a model with tool calling on the Spark, then point Claude Code or Codex at it from a developer’s computer, so the code stays on your network.

Time
About 30 minutes, plus the model download
For
Developers who want a coding assistant that keeps the code in the building
Status
NVIDIA and vLLM public guides · not yet run by AI Deskside

What you will have

  • A model with tool calling running on your DGX Spark.
  • Claude Code or Codex on your own computer, sending its requests to that model in place of a cloud service.
  • Source code that stays on your network.

What you need

  • A DGX Spark on your network, with Docker. See the tutorial “Serve a model to your team from a DGX Spark” for the basics.
  • A free Hugging Face account and an access token.
  • Claude Code or Codex installed on the developer’s computer, from their official guides.
On this page
  1. 1Start a model that can call tools
  2. 2Connect Claude Code
  3. 3Or connect Codex
  4. 4Try it on a real task
  5. When something fails
  6. Before production
  7. Managed option
  8. Sources
  9. Fact sheet

Step 1

Start a model that can call tools

A coding tool does more than chat: it asks the model to read files and run commands. The model must therefore be served with tool calling enabled. NVIDIA publishes an “agent ready” recipe for the Spark, with Qwen3.6 35B.

Command
docker pull vllm/vllm-openai:latest
NVIDIA’s recipe, plus the last line
export HF_TOKEN="your_huggingface_token"

docker run -it --gpus all -p 8000:8000 \
  -e HF_TOKEN="$HF_TOKEN" \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  vllm/vllm-openai:latest \
  nvidia/Qwen3.6-35B-A3B-NVFP4 \
  --host 0.0.0.0 \
  --port 8000 \
  --tensor-parallel-size 1 \
  --trust-remote-code \
  --kv-cache-dtype fp8 \
  --attention-backend flashinfer \
  --moe-backend marlin \
  --gpu-memory-utilization 0.4 \
  --max-model-len 262144 \
  --max-num-seqs 4 \
  --max-num-batched-tokens 8192 \
  --enable-chunked-prefill \
  --async-scheduling \
  --enable-prefix-caching \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3,"moe_backend":"triton"}' \
  --load-format fastsafetensors \
  --reasoning-parser qwen3 \
  --tool-call-parser qwen3_xml \
  --enable-auto-tool-choice \
  --served-model-name my-model

The last line, --served-model-name my-model, is not in NVIDIA’s recipe. It comes from vLLM’s guide: Claude Code does not accept a model name that contains /, so the server must publish the model under a simple name.

In another terminal on the Spark, check that it answers:

Command
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
    "model": "my-model",
    "messages": [{"role": "user", "content": "12*17"}],
    "max_tokens": 500
}'

Step 2

Connect Claude Code

vLLM speaks the same protocol as the service Claude Code normally calls. Tell Claude Code to use your Spark’s address and the model name of Step 1. On the developer’s computer, from the project folder:

Command
ANTHROPIC_BASE_URL=http://<spark-address>:8000 \
ANTHROPIC_API_KEY=dummy \
ANTHROPIC_AUTH_TOKEN=dummy \
ANTHROPIC_DEFAULT_OPUS_MODEL=my-model \
ANTHROPIC_DEFAULT_SONNET_MODEL=my-model \
ANTHROPIC_DEFAULT_HAIKU_MODEL=my-model \
claude
VariableWhat it does
ANTHROPIC_BASE_URLThe address of your server. vLLM’s guide shows http://localhost:8000, for a tool running on the same machine as the model.
ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKENRequired, with any value: the server asks for no key unless you configure one.
The three ANTHROPIC_DEFAULT_…_MODELAll three must name your model. Each covers a different role inside the tool.

Not in vLLM’s guide: Understand Tech’s own guide, written for its gateway, also sets CLAUDE_CODE_SUBAGENT_MODEL to the same model name, CLAUDE_CODE_DISABLE_1M_CONTEXT=1 and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1. The first covers subagents that are not given a model another way. The last turns off the tool’s automatic updates, telemetry and error reports, which otherwise still leave your network. The guide is linked at the end of this page.

To avoid typing them each time, put these variables in your shell profile or in the env section of ~/.claude/settings.json.

Step 3

Or connect Codex

Codex reads its configuration from ~/.codex/config.toml. Create or edit it:

~/.codex/config.toml
model = "my-model"
model_provider = "vllm"

[model_providers.vllm]
name = "vLLM"
env_key = "VLLM_API_KEY"
base_url = "http://<spark-address>:8000/v1"
wire_api = "responses"

Codex wants a key in the variable named by env_key. Any value works. Then start it in your project folder:

Command
export VLLM_API_KEY=dummy
codex

Step 4

Try it on a real task

Ask the tool to explain a file of your project, then to make a small change. If it reads the file and proposes the change, the connection and tool calling both work.

An open-weight model on one Spark is not the hosted model these tools were tuned for. Judge it on your own tasks before you rely on it.

When something fails

What you seeCauseWhat to do
Connection refusedThe server is not reachable at that addressCheck that it runs, that the port matches and, for Codex, that the address ends with /v1.
Model not foundThe name in the tool differs from --served-model-nameUse the same name on both sides, with no / in it.
The tool chats but never edits or runs anythingTool calling is not enabled for the modelCheck --enable-auto-tool-choice and the --tool-call-parser that fits your model.
Web search fails in Claude CodeThat tool runs on Anthropic’s servers, which a local model does not haveUse an MCP server that provides web search.
Everything is very slow with an older vLLMA value that changes in every request defeats the server’s cacheFixed in vLLM versions above 0.17.1. On older ones, add "CLAUDE_CODE_ATTRIBUTION_HEADER": "0" to the env section of ~/.claude/settings.json.

To do for a production deployment

Before you rely on it in production

  1. Protect the address. As started here the server asks for no key, and the code travels unencrypted on your network: add a key and HTTPS before more than a few trusted people use it.

  2. Size it. NVIDIA’s recipe accepts 4 requests at once (--max-num-seqs 4). Measure with your own team before raising it.

  3. Run the server in the background and make it start again after a reboot. The recipe above runs in the terminal that started it.

  4. Pin the container version and the model. latest changes without warning.

  5. Give each developer their own key if you need to know who used what.

Where the commands come from

Sources

Read on 30 November 2026. Commands are copied from the sources. A step a source does not show is described in words.

Reference

Fact sheet

Where this comes from

Two public guides, joined. NVIDIA’s playbook gives the command that serves a model with tool calling on a DGX Spark. vLLM’s documentation gives the settings that make Claude Code and Codex call a vLLM server. Understand Tech’s supported product is presented at the end as the managed alternative.

Machine

NVIDIA DGX Spark · 128 GB unified. A reference machine helps locate guidance; it does not establish identical behaviour on another maker’s system.

Software

vLLM (vllm/vllm-openai container) · Claude Code or Codex on the developer’s computer

Model

nvidia/Qwen3.6-35B-A3B-NVFP4, NVIDIA’s agent-ready recipe for the Spark

Evidence

Commands from NVIDIA’s DGX Spark playbooks and from the vLLM documentation (both Apache 2.0), read 30 November 2026 at fixed commits. AI Deskside has not run the two together. Two changes are ours and are marked on the page: one flag added to NVIDIA’s command, taken from vLLM’s guide, and the Spark’s address in place of localhost.

Still open
  • The combination of NVIDIA’s recipe and the two tools, on a Spark, has not been run by AI Deskside
  • Quality of this model on your own coding tasks
  • Number of developers one Spark serves at an acceptable speed
  • Behaviour of each tool’s newer features against a local server