Deploy your own code assistant
Esta página aún no está disponible en tu idioma.
This guide deploys a coding model on your own GPU capacity and connects Claude Code to it. Every request from the coding assistant then runs on a worker in your project, behind an API key you control.
It follows the walkthrough video step by step. Each section links to the moment in the video where that step happens.
What the video sets up:
- Model:
cyankiwi/Qwen3-Coder-Next-AWQ-4bit, an 80B-parameter coding model quantized to 4 bits. - Runtime: vLLM 0.15.0.
- Hardware: one NVIDIA A100 SXM 80 GB rented from the cloud GPU catalog.
- Client: Claude Code, talking to the workload’s
/v1/messagesendpoint.
For the background story behind the video, read the article An 80B coding model on one rented A100, driven by Claude Code.
Before you start
You need:
- An InferenceKey account. Open the dashboard.
- Balance or billing set up if you rent a cloud GPU. Cloud GPUs are charged per hour while the worker runs. See Stop the cloud GPU for how to release it.
- Claude Code installed on the developer machine, plus
curlfor the checks below.
-
Create a project
Video: 0:13
A project groups workloads, workers and keys. Open Create a new project, type a name, and click Create project. The slug is generated from the name; you use it later in the endpoint URL. The video names the project
Code Assistant, which gives the slugcode-assistant. -
Create the vLLM workload
Video: 0:24 (the full command is readable at 0:44)
In the project, open the Workloads tab and click Create workload. Then:
- Backend:
vLLM. - Workload name: auto-filled from model and backend. The video keeps
Qwen3 Coder Next AWQ 4bit · vLLM, which gives the workload slugqwen3-coder-next-awq-4bit-vllm. The slug is part of the endpoint URL and is also the model name clients send. - vLLM runtime version:
0.15.0in the video. The worker installs this exact version. - vLLM command: paste the full command. It runs as-is on the worker.
vLLM command vllm serve cyankiwi/Qwen3-Coder-Next-AWQ-4bit --enable-expert-parallel --kv-cache-dtype fp8_e4m3 --max-model-len 262144 --gpu-memory-utilization 0.90 --max-num-seqs 2 --enable-auto-tool-choice --tool-call-parser qwen3_coderFlag What it does here cyankiwi/Qwen3-Coder-Next-AWQ-4bitThe Hugging Face model the worker downloads and serves. --enable-expert-parallelUses expert parallelism for the mixture-of-experts layers. It only changes placement when the model spans several GPUs. --kv-cache-dtype fp8_e4m3Stores the KV cache in FP8, which roughly halves its memory and leaves room for long contexts. --max-model-len 262144Maximum context length per request, in tokens (prompt plus output). --gpu-memory-utilization 0.90Fraction of GPU memory vLLM may use for weights, activations and KV cache. --max-num-seqs 2At most 2 sequences run at the same time on the GPU. Further requests are queued until a slot frees up. --enable-auto-tool-choiceLets the model decide when to call a tool. Required for coding assistants. --tool-call-parser qwen3_coderParses this model’s tool-call format into structured tool calls. After saving, the workload exists but nothing runs it yet: the Workloads tab shows it with no workers assigned and no capacity.
- Backend:
-
Add a worker with a cloud GPU
You can run the workload on your own server (Pick existing worker) or rent a GPU. The video rents one. In the workload row, click Add worker and open the Deploy new cloud GPU tab of the Add worker to workload dialog:
Field Value in the video Notes GPUs per node 1 Options are 1, 2, 4 or 8 GPUs of the same model. Required CUDA driver 13.0 Filters the catalog to hosts with that CUDA version. Leave it empty to list every host. GPU model A100 SXM · 80GB The catalog listed it at $1.79/h at recording time. Secure cloud Checked Higher reliability, slightly higher price. Uncheck for community cloud pricing. Worker name A100-SXM-80GB-CUDA130-01Auto-generated from GPU model, VRAM and CUDA. You can override it. Concurrent requests 20 (default) Initial concurrency for this worker on this workload. The video keeps 20 while vLLM runs 2 sequences at a time ( --max-num-seqs 2), so extra requests are queued.Click Deploy & assign. The pod is created, the worker registers, and it is assigned to the workload automatically. The worker installs vLLM and its dependencies, downloads the model and starts the server. No SSH or manual setup is needed.
-
Follow the logs and test the model
Video: logs at 1:34, test at 1:47
Open the worker (Platform Management → Workers, or the worker in the Live Flow tab) and click view logs to follow the vLLM output while the weights download and load. The worker drawer shows the startup steps up to Model ready.
When the model is ready, open the workload in Live Flow and click Test endpoint. The Chat tab sends a test message and reports First token (time to first token), Total time, Tokens/s and Total tokens. The Load test tab sends concurrent requests.
-
Create an API key scoped to the endpoint
Video: 1:56
Open Platform Management → API Keys and click + New API Key. In Create API Key:
- Name: something that identifies the user or team.
- Access scope: Specific endpoints (the least-privilege choice) or Entire project.
- Allowed endpoints: tick only
code-assistant/qwen3-coder-next-awq-4bit-vllm.
Click Create key and copy the
ik_live_key. The full secret is shown only once. Usage recorded against the key lets you track who consumes what. See Authentication for how data keys are scoped. -
Connect Claude Code
Video: 2:09
The workload exposes an Anthropic-compatible Messages endpoint:
POST https://api.inferencekey.com/endpoint/<project_slug>/<workload_slug>/v1/messagesClaude Code appends
/v1/messagestoANTHROPIC_BASE_URL, so the base URL stops at the workload slug. To get the URL from the panel, open the row actions menu of the workload in the Workloads tab and click Copy URL. It copies the OpenAI-compatible base, which ends in/v1; remove that/v1forANTHROPIC_BASE_URL. The default public host isapi.inferencekey.com.Claude Code asks for Claude model names (for example a Haiku-class model for background tasks). The endpoint only accepts the workload slug, the workload’s model name or
default, so set every model variable to the workload slug.Shell, before running claude export ANTHROPIC_BASE_URL="https://api.inferencekey.com/endpoint/code-assistant/qwen3-coder-next-awq-4bit-vllm"export ANTHROPIC_AUTH_TOKEN="ik_live_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"export ANTHROPIC_MODEL="qwen3-coder-next-awq-4bit-vllm"export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen3-coder-next-awq-4bit-vllm"export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3-coder-next-awq-4bit-vllm"export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3-coder-next-awq-4bit-vllm"export CLAUDE_CODE_SUBAGENT_MODEL="qwen3-coder-next-awq-4bit-vllm"claudeVariable Why ANTHROPIC_BASE_URLSends Claude Code’s requests to your workload instead of Anthropic. ANTHROPIC_AUTH_TOKENSent as Authorization: Bearer <key>, the header the endpoint checks first.ANTHROPIC_MODELThe model of the main session. ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL,ANTHROPIC_DEFAULT_HAIKU_MODELWhat the opus,sonnetandhaikualiases resolve to. The Haiku one is also used for background tasks.CLAUDE_CODE_SUBAGENT_MODELDefault model for subagents. Variable names are from the Claude Code environment variables reference.
Check the endpoint with
curlbefore starting Claude Code:Plain request curl -sS "$ANTHROPIC_BASE_URL/v1/messages" \-H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \-H "Content-Type: application/json" \-d '{"model": "qwen3-coder-next-awq-4bit-vllm","max_tokens": 256,"messages": [{"role": "user", "content": "Write a Python function that reverses a string."}]}'Request with a tool (checks the tool flags) curl -sS "$ANTHROPIC_BASE_URL/v1/messages" \-H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \-H "Content-Type: application/json" \-d '{"model": "qwen3-coder-next-awq-4bit-vllm","max_tokens": 256,"tools": [{"name": "read_file","description": "Read a file from the repository","input_schema": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}],"messages": [{"role": "user", "content": "Open README.md"}]}'A working endpoint answers both with a Messages response (
"type": "message"); the second one usually contains atool_useblock. Errors come back in the Anthropic error shape ("type": "error"). -
Watch the live view and GPU telemetry
Video: 2:28, telemetry at 2:35
The project’s Live Flow tab shows requests travelling from the workload to the worker in real time. Click the workload to open its drawer: Backlog, Requests Total, p95 Latency, a backlog vs throughput chart, and Token Usage for the last 30 days, broken down by API key.
Click the worker to open its drawer. GPU Telemetry reports per GPU: GPU Utilization, Memory Utilization, Memory Used, Temperature and Power Draw. Driver health confirms that the vLLM version is compatible with the host’s CUDA runtime.
Scale to more workers or GPUs
Video: 2:48
The video runs on one GPU. The platform supports these ways to add capacity:
- More workers on the same workload. Click Add worker again (or Assign workers) to attach another cloud GPU or one of your own servers. All workers assigned to a workload pull from the same queue, so each request is taken by one worker that has a free slot.
- Concurrent requests per worker. Each worker-to-workload assignment has a Concurrent requests limit (1 to 1000, default 20): the maximum number of requests that worker processes at the same time for that workload. Keep it in line with the vLLM
--max-num-seqsvalue; requests above vLLM’s limit are queued. - More GPUs per node. GPUs per node accepts 1, 2, 4 or 8 GPUs of the same model. Tensor parallelism splits one model across them. When the command has no tensor parallel flag, the worker adds
--tensor-parallel-sizewith the number of GPUs it can use; an explicit--tensor-parallel-sizein your command always wins. Automatic tensor parallelism needs an up-to-date worker, so setting--tensor-parallel-sizeexplicitly (for example--tensor-parallel-size 2on 2 GPUs) is the safe choice. For a mixture-of-experts model like this one, keep--enable-expert-parallel.
For schedule- or demand-driven capacity, see the execution policies in Backends & policies.
Stop the cloud GPU
A rented GPU is billed while its pod exists, whether or not it serves requests. To release it, delete the worker:
- Open Platform Management → Workers.
- On the worker’s card, click Delete, then confirm with Delete in the Delete worker dialog.
For a cloud worker, the platform terminates the pod at the cloud provider, closes the billing of that deployment, and then removes the worker. If the provider does not confirm the termination, the worker is not deleted: an error explains why, the termination is retried automatically, and the card shows Pod termination pending with the pod id. While that label is shown, the pod may still be billed.
Limits
- Model names. The endpoint accepts only the workload slug, the workload’s model name (
cyankiwi/Qwen3-Coder-Next-AWQ-4bithere),default, or no model. Any other name, including Claude model ids, returns HTTP400with error typeinvalid_request_errorand the message “Model ’…’ is not available on this endpoint” (internallymodel_not_available). - Local GPU workloads only.
/v1/messagesserves workloads that run on your workers. A workload that forwards to an external AI provider returns HTTP501(error typeapi_error) on this route. - Chat endpoint toggle.
/v1/messagesshares the chat endpoint toggle with/v1/chat/completions. If chat is disabled for the workload (Endpoint column of the Workloads tab), requests return HTTP409(error typeinvalid_request_error). - Context and parallelism come from the command. With the command above, a request can hold up to 262,144 tokens, and the GPU runs 2 sequences at a time. Change
--max-model-lenand--max-num-seqsto trade context length for parallel requests. - Model quality. Claude Code is designed around Claude models. An open-weight model behind the same interface handles tool calls and long sessions differently; evaluate it on your own tasks.
Troubleshooting
400 invalid_request_error: “Model ’…’ is not available on this endpoint”
{"type": "error", "error": {"type": "invalid_request_error", "message": "Model 'claude-…' is not available on this endpoint. This endpoint is bound to queue 'qwen3-coder-next-awq-4bit-vllm'. Use model 'default'."}}- Symptom: HTTP
400with error typeinvalid_request_errorand the message above (internallymodel_not_available). - Cause: Claude Code sent a model name the endpoint does not serve, usually a Claude id from an alias or a background task.
- Fix: set
ANTHROPIC_MODEL, the threeANTHROPIC_DEFAULT_*_MODELvariables andCLAUDE_CODE_SUBAGENT_MODELto the workload slug, as in Connect Claude Code, and restartclaude.
400 on requests with tools
- Symptom: plain prompts work, but Claude Code (or the tool
curlabove) gets a400(error typeinvalid_request_error) whose message comes from vLLM and mentions--enable-auto-tool-choiceand--tool-call-parser. - Cause: the vLLM command lacks the tool flags. The endpoint passes vLLM’s
400and its message through to the client. - Fix: add
--enable-auto-tool-choice --tool-call-parser qwen3_coder(or the parser that matches your model) to the vLLM command and save the workload.
401 or 403
401(error typeauthentication_error): the key is missing or invalid. CheckANTHROPIC_AUTH_TOKENholds anik_live_key, and thatANTHROPIC_API_KEYis unset or holds the same key.403(error typepermission_error): the key is valid but not allowed on this endpoint. Edit the key’s allowed endpoints, or check the project and workload slugs inANTHROPIC_BASE_URL.
For other errors, see Common errors.
Next steps
New to InferenceKey? Create an account or open the dashboard · Read the article behind the video: An 80B coding model on one rented A100, driven by Claude Code.