mlx-optiq
Benchmark · July 25, 2026

OptiQ Code vs opencode

We put two coding agents on the same local model, a 4-bit Qwen3.6-35B-A3B under optiq serve, and ran both through an open benchmark built to test coding agents. They solve the same tasks. The difference is cost: OptiQ Code gets the same work done with about five times fewer tokens. On a laptop those tokens are your own compute and your own battery, so the gap costs real time.

We had wanted to test one claim properly for a while. The claim is that an agent built for local models does better than a general one when both run the same local model. The claim is easy to make. Testing it fairly is harder, because most agent benchmarks vary the model and hold the tool constant. openbench does the reverse.

openbench is a benchmark for coding-agent harnesses. It holds the model and the tasks fixed and measures how much the scaffolding around the model changes the result. Each task is a small repo with an instruction and a grading script, and it only counts as solved when that script exits zero. The agent's own word does not count, so an agent that claims it fixed the bug but did not still scores a zero.

The setup

Every request in this test hits one model. We loaded mlx-community/Qwen3.6-35B-A3B-OptiQ-4bit once under optiq serve: a 35B sparse MoE with about 3B active parameters per token, quantized to 4-bit, sitting resident on a 36 GB M3 Max. It exposes an OpenAI-compatible endpoint, and both agents point at it. The model, the quantization, and the KV cache do not change between runs.

Held fixedValue
ModelQwen3.6-35B-A3B-OptiQ-4bit (3B active)
Serveroptiq serve · 64k context · mixed-precision KV
HardwareM3 Max, 36 GB, no cloud
Tasksopenbench core set, 8 tasks, 1 trial
Gradingchecker.sh exit code, not self-report

The two agents are OptiQ Code, our terminal agent for local models, and opencode, a general-purpose coding agent that plenty of people use. OptiQ Code runs through openbench's bring-your-own-harness manifest, headless, approving its own edits. opencode runs through its own openbench adapter, pointed at the same endpoint.

Measuring tokens the same way

opencode reports its own token counts. OptiQ Code runs as a black-box CLI and reports none to openbench. Rather than compare one agent's self-reported numbers against nothing, we dropped a small proxy between both agents and optiq serve. It passes every request through untouched and reads the usage field back out of each response. Both agents end up counted the same way, at the server, with the token and turn counts coming from one place.

Both solve the same tasks

On correctness the two agents are hard to tell apart, which is roughly what openbench's own results lead you to expect once the model is good enough. Both go six for six on the standard tasks. Both also solve taskflow, a 7,800-line codebase. They only come apart on webcore, the other large task, where both hit the 600-second cap before finishing. When the clock ran out, OptiQ Code had gotten about twice as far, 0.74 against 0.38.

Solve rate · openbench core set
TasksOptiQ Codeopencode
6 standard tasks6 / 66 / 6
taskflow (7.8k lines)1.001.00
webcore (7.1k lines, capped)0.740.38

Stop there and it is a tie. The question worth asking, once both agents finish the task, is what each one spent to do it.

The cost of a solve

Here are the six tasks both agents solve, with every figure read off the same proxy: prompt tokens sent, output tokens generated, round-trips to the model, and wall-clock time.

Per-task · OptiQ Code vs opencode · same local model
TaskPrompt tokOutput tokTurnsTime
fix-failing-test7.2k vs 40.8k250 vs 3735 vs 510.9s vs 30.5s
make-it-run7.7k vs 40.5k491 vs 6285 vs 515.5s vs 36.7s
misleading-error12.3k vs 44.2k457 vs 6797 vs 515.6s vs 40.3s
build-a-cli13.5k vs 49.4k719 vs 5327 vs 621.0s vs 34.2s
add-feature28.5k vs 180.0k1.2k vs 7.8k8 vs 1433.5s vs 268.8s
make-ci-green26.9k vs 127.7k1.5k vs 2.9k6 vs 940.4s vs 142.7s

Bold is OptiQ Code. Dim is opencode. Both drove the same Qwen3.6-35B-A3B.

Averaged over those six tasks:

Mean per solved task
MetricOptiQ CodeopencodeAdvantage
Prompt tokens16.0k80.4k5.0× leaner
Output tokens7702,1402.8× fewer
Total tokens16.8k82.6k4.9× fewer
Turns6.37.3fewer
Wall time23s92s4.0× faster

Where the tokens go

Almost all of the gap is in what each agent sends up. opencode ships a large general-purpose system prompt, around 7,600 tokens of instructions and tool schemas, and re-sends the growing conversation every turn. OptiQ Code is built for one job against one kind of model, so its prompts are shorter and it holds down how much context it resends. Same task, but opencode gives the model a lot more to read on every step.

On a laptop those tokens are compute you pay for directly. There is no invoice, but every prompt token is the model re-reading context, and on local hardware that is real prefill time and real battery. Five times fewer tokens is about five times less of that work, and it is most of why the wall-clock gap is as wide as it is.

What this means on a Mac

So: a 4-bit 35B model, running entirely on a laptop, gets real coding tasks done, including a 7,800-line refactor, graded by an outside checker, with no cloud and no API key. Which agent you wrap around it decides whether a task costs 17k tokens or 83k.

On a hosted model that overhead is someone else's server and a line on your invoice. On a local model it is your own hardware. A leaner agent finishes sooner and leaves more of the context window for the actual code. That is the argument for a local-first agent over a general one, at least on a Mac.

Reproduce it

All of this runs on hardware you already own. Serve the model, then point OptiQ Code at it.

terminalbash
# serve the model once
optiq serve --model mlx-community/Qwen3.6-35B-A3B-OptiQ-4bit --port 8099

# drive it with the local coding agent
export OPTIQ_BASE_URL=http://localhost:8099/v1
optiq code launch .

The openbench manifest, the proxy, and the raw per-task numbers are small enough to rerun on any 36 GB Apple Silicon Mac. Both agents reached the same result; OptiQ Code used far fewer tokens to get there.