Claude Code and OpenCode with local Qwen: compatible or supported?
OpenCode documents local llama.cpp. Claude Code can traverse a compatible gateway, but Anthropic does not support routing it to non-Claude models.
Syntalith
OpenCode officially documents local models through llama.cpp and an OpenAI-compatible interface. Claude Code supports Anthropic-compatible gateways, while Anthropic does not support routing that client to non-Claude models. We completed the Qwen task through Claude Code because a patched vLLM emulated the required interface.
Technical compatibility lets a particular set of versions run together. Vendor support determines whether the provider commits to maintaining that setup and helping after an upgrade. For a company, the difference becomes downtime risk.
We ran this comparison after hours on a home PC with an RTX 3090. It describes these client versions on one stack. A few runs do not establish a vendor ranking or predict behaviour in another repository.
OpenCode has a documented local path
OpenCode's provider documentation shows llama.cpp through @ai-sdk/openai-compatible, a baseURL and explicit context and output limits. For a Responses endpoint, it points to @ai-sdk/openai.
This is the provider section we used, with local paths removed. The port, model name and limits match the measured vLLM profile with a 150,000-token context:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"qwen-local": {
"npm": "@ai-sdk/openai-compatible",
"name": "Local Qwen vLLM",
"options": {
"baseURL": "http://127.0.0.1:18020/v1",
"apiKey": "{env:QWEN_VLLM_API_KEY}"
},
"models": {
"qwen3.8-27b": {
"name": "Qwen3.8-27B 150K Medium",
"limit": { "context": 150000, "output": 32768 },
"options": { "reasoningEffort": "medium" }
}
}
}
}
}
The key and limits must match the server. The measurement configuration granted global "*": "allow" so approval prompts would not alter elapsed time. We leave that setting out of this example. In a normal repository, retain approval prompts or define a narrow operation allowlist. Broad permissions were limited to disposable worktrees with no secrets.
Four real OpenCode runs
| Task | Hidden checks | Time | What the run showed |
|---|---|---|---|
| CSV export | 1/3 | 32.69 s | missed the separator required by README |
| pagination | 3/3 | 325.88 s | made a minimal fix, then inspected unnecessary .git metadata and wrote a false statement in the report |
| CSV import | 5/5 | 89.04 s | fastest fully correct result for this task |
| import follow-up | 3/3 | 130.03 s | correctly created or updated the record in the same session |
This is more useful than saying “OpenCode works.” It performed very well on one task, broke an explicit contract on another and sometimes continued after the code was correct. We therefore inspect hidden checks, the final diff and the explanation of the result.
The Claude Code gateway has a defined boundary
Claude Code's gateway connection documentation describes ANTHROPIC_BASE_URL and a credential. A gateway can centralise authentication, logging and routing for supported Claude models.
Anthropic's support documentation states that routing Claude Code to non-Claude models is unsupported. A company standard should not depend on the next client release preserving incidental compatibility with an emulator.
What the Claude Code experiment showed
An early Claude Code attempt on llama.cpp ran for 7,298.5 seconds, exceeded the available context, failed to complete and left a test that did not compile. It received no final quality score.
On patched vLLM with a 150,000-token context, Claude Code and Qwen Code received the same long request: fix two Go paths that ignored json.Marshal errors, preserve the successful response format, add deterministic failure behaviour, tests and documentation.
| Client driving Qwen3.8-27B | Score | Time | Calls | What the score records |
|---|---|---|---|---|
| Qwen Code | 100/100 | 502.14 s | 52 | no deductions under the criteria, 2 regression tests |
| Claude Code through emulation | 98/100 | 1,732.38 s | 50 | two points deducted, correct failure behaviour and 6 tests |
Codex assigned both scores after the agent runs, using Syntalith's criteria: correctness (40 points), regression tests (20), compatibility (15), scope and maintainability (10), verification (10) and documentation (5). A score of 100/100 means that Codex deducted no points under those criteria in this single run. The 98/100 score records a two-point deduction, while the published summary does not break that difference down by category. These are neither external-auditor scores nor evidence of repeatability.
Claude Code took 3.45 times as long. In this run, it paired strong quality with a high time cost. The result shows compatibility between these client and emulator versions; it supports no broader claim.
Choose from the work
- Give each client the same code state, prompt, context limit, effort and tool policy.
- Use hidden checks the agent cannot see in its prompt.
- Reject a result when it breaks the contract, even if public tests are green.
- Record client, provider and chat-template versions.
- After an upgrade, repeat a short smoke test, session resume and one regression task.
OpenCode is a strong candidate for a documented local profile. Qwen Code produced the best result in our long task. Codex offers documented custom-provider configuration. Claude Code emulation has research value, yet Anthropic does not support the pairing, so we do not propose it as a company standard.
Syntalith can build two controlled profiles and hidden checks, then teach the team to evaluate them in the AI-Native course. The service leaves the team with a choice it can test and operate. The home GPU remains an experiment tool. A free process scan helps select the client for the work and required support level.
Free process scan
Start with a free process scan.
- A 30-minute call with the engineer who would lead the work.
- A review of the processes that cost you the most time and money.
- A written summary of what to automate first and the likely cost range.
The scan chooses one process to assess, and within 2 business days you receive a recommendation, including when a simpler route is the better fit.
€0
30 minutes · written takeaway within 2 business days
Times are shown in your own time zone. We work with clients across time zones.
Describe the process in the form