mlx-optiq
OptiQ Code · terminal coding agent

A coding agent for your local model.

It drives whatever optiq serve is serving, a 4-bit quant on your MacBook or a 27B on a Mac Studio, through a read, edit, run-tests loop right in your terminal. It runs offline and stays on your machine.

optiq code · ~/my-project
OptiQ Code running a task in the terminal
$ optiq code
How it works

It runs the same loop as a cloud agent, locally.

Describe a change. OptiQ Code plans, edits, and runs your tests, turn after turn, until the suite is green, pausing for your approval on anything that writes.

01 · READ

Read the code

Searches and reads the files it needs, so the change is grounded in your actual code.

02 · EDIT

Make the change

Writes a precise diff, or rewrites a whole file when that is cleaner. You approve it.

03 · TEST

Run the suite

Runs your tests, so it tracks the real pass/fail count.

04 · REPEAT

Repeat

Feeds the failures back and tries again, until the tests pass or you stop it.


Built for local models

It handles the failure modes small models hit.

A small model often reasons its way to the right fix and then loses it on the mechanics. OptiQ Code targets exactly those failure modes, so the model you can actually run still lands the change.

When the modelloses the diff on its final turn
OptiQ Codesalvages the working git diff on every exit path, so it never returns an empty patch.
When the modelbotches an exact-match edit, again and again
OptiQ Codestops the retries and asks for a full-file rewrite instead of dead-ending on one file.
When the modelreads in circles or repeats itself
OptiQ Codetrips a stall nudge: make one small, testable change, then run the tests.
When the modelwrites a tool call as text, not a structured call
OptiQ Codeheals it into a real call, so a malformed call is recovered rather than wasting a turn.

On real bugs

Measured against other harnesses.

We put three coding agents on two public benchmarks. In each one, all three drive the same local model, so the agent is the only thing that changes. OptiQ Code scores highest on both. It resolves the most on SWE-bench-Lite, and on openbench it beats opencode by a small margin while using far fewer tokens.

Same local model across all three harnesses in each row · checker-graded
Benchmark OptiQ Code mini-swe-agent opencode
SWE-bench-Lite
4-bit 4B local · % resolved
36% 25% 0%
openbench core
4-bit 35B local · 8 tasks · score
7.74 / 8 6.70 / 8 7.38 / 8
Same tasks, fewer tokens On openbench, OptiQ Code and opencode solve the same tasks, but OptiQ Code uses about 5× fewer tokens to get there: roughly 17k per task against 83k. On a Mac, that is your own compute and battery. Read the benchmark study →

The interface

You stay in the loop.

A session banner that scrolls away, an open prompt, inline tool markers, and single-Enter approval before anything writes to your files. Or let it run unattended in auto mode.

OptiQ Code session start
Session start
OptiQ Code running a task
Running a task
OptiQ Code approval prompt
Approval

Quickstart

Serve a model, then run Code in your repo.

i

Serve a model

--idle-timeout frees the RAM when you step away and reloads on the next turn.

terminalbash
$ optiq serve --model mlx-community/Qwen3.6-27B-OptiQ-4bit --idle-timeout 300
ii

Launch in a repo

Zero config, it discovers the served model. Describe the change; approve edits with a single Enter, or run auto.

terminalbash
$ cd my-project && optiq code
iii

Or run it headless

Auto-approve, run to completion, print the diff, exit non-zero if the goal was not met.

terminalbash
$ optiq code -p "Fix the failing test in parser.py"
$ optiq code -c            # resume the last session
$ optiq code export -o s.jsonl
$ optiq code --preset plan          # read-only: investigate, propose, change nothing
$ optiq code -p "..." --preset minimal   # benchmarking: two tools, no harness
Where to next The OptiQ Code guide covers approval modes, sessions, the tool set, and headless use in full. Presets cover plan mode, which you toggle with Tab, and when to strip the harness back so a benchmark measures the model.

Run a coding agent on your own model and machine.

It runs locally, with no per-token billing.