A coding agent for Apple Silicon Macs with the model inside it: a C port of pi that runs Qwen4-35B-A3B (up to 1M tokens of context), Qwen3.8, Ternary Bonsai 2.5, Inkling 2 Mini, Ornith-1.5 and DeepSeek-V4.1-Flash in its own process, on its own Metal inference engine, without Python, Node or a server. saetta.dev
Performance · Start · Models · The agent · Other agents · Build from source
saetta start code edits a 3D game: it adds six crystals along the lake shore, probes the terrain for the shoreline and checks the script. Cut for length; Qwen3.8-Flash-Next Coder on an M5 Max. The 96-second video.
Saetta Code is a C port of the pi coding agent with the model running in the same process: one 3 MB binary, no Python, no Node, no server. Its inference engine (C and hand-written Metal) is built for agent work: long shared-prefix prompts, short answers, tool calls. Any Apple Silicon Mac with 32 GB of memory or more; it picks the model that fits.
curl -fsSL https://saetta.dev/install.sh | sh # into ~/.local/bin; later: saetta update
cd ~/src/my-project && saetta start code # downloads the model that fits this Mac, then opens the agent
saetta download coder && saetta start code --pack coder # or name a packBy memory it picks qwen4-35b (Qwen4-35B-A3B, 32 GB, context up to 1M tokens) from 48 GB, 27b-turbo (20 GB) from 36 GB, 27b-4bit (16 GB) from 32 GB; later runs start on the model you used last. Inside the agent, /model downloads and switches packs. Needs macOS 26 or later. Docs: saetta.dev/docs.
All on an M5 Max with 128 GB; every number is a measured run.
Saetta Code 0.31 finishes 30 small coding tasks in 450.9 s where pi 1.5.2 on the same engine takes 741.7 s, both passing 30 of 30: it reasons in full only on the turn you start, after a failed tool call and after a repeated one (SAETTA_EFFORT=off turns it off). Running the model in the agent's process pays on restarts, forks and retries; Strata is still faster on a single edit (68.5 against 86.4 s). Engine speed:
Qwen4-35B-A3B reads long prompts at full speed (4,371 tokens/s at 78K), and since 0.41 requests that arrive together decode in one batch on the GPU: 4 at once answer at 213 tokens/s together, where 0.40 answered them one after another at 152.
Saetta reads Inkling prompts faster than Strata (2,707 against 2,602 tokens/s at 4K), and since 0.30 it gets the first token about 20% sooner than Strata v0.2.23 on Qwen3.8-Flash-Next prompts from 4K to 64K and on agent turns. M1 to M4 are not measured on real hardware yet (reports welcome). Details: Performance. What running the agent and the model in one process buys, against an agent talking to a server over HTTP (Saetta, mlx-lm, llama.cpp, Strata): Integration evaluation.
| family | Mac memory | good for | packs | published scores |
|---|---|---|---|---|
| Qwen4-35B-A3B | 48 GB | Qwen's mixture of 256 experts, 8 active per token (about 3B), the architecture of Flash-Next at a smaller size; the default from 48 GB: context up to 1M tokens where memory allows, a draft head (MTP): 175 tokens/s after a 4K prompt on an M5 Max, 136 without | qwen4-35b |
DeepSWE v1.1 61.8 |
| Qwen3.8-Flash-Next | 96 GB (coder), 128 GB (full) |
the fastest here and the highest published scores; coder keeps the 256 of 512 experts that matter for code |
coder, full |
SWE-bench Verified 82.8 (full), 79.2 (Coder) |
| Qwen3.8-27B | 32 GB (4-bit), 48 GB (8-bit) | dense, fits a 32 GB Mac; LoRA adapters on the 8-bit pack; coding fine-tunes with a draft head that answers faster | 27b-4bit, 27b-8bit, fine-tunes |
SWE-bench Pro 61.7, Terminal-Bench 2.1 73.0 |
| Ternary Bonsai 2.5 | 32 GB | prism-ml's Qwen3.8-27B trained to ternary weights: 8.6 GB, the smallest pack here | bonsai-27b |
SWE-bench Verified 75.6, Terminal-Bench 2.1 60.1 |
| Inkling 2 Mini | 32 GB | Thinking Machines' 26B mixture of experts, 3.4B active per token; context up to 1M tokens where memory allows; a pi LoRA adapter | inkling |
SWE-bench Verified 79.2, Terminal-Bench 2.1 71.6 |
| Ornith-1.5 | 32 GB (35B), 96 GB (122B) | ornith-ai's coding models on Qwen3.5: mixtures of 256 experts, 8 active per token (about 3B for the 35B); first version | ornith-35b, ornith-122b |
SWE-bench Verified 79.0 (35B), 84.5 (122B) |
| DeepSeek-V4.1-Flash | 96 GB | DeepSeek's mixture of experts as ISTA-DASLab's Coder pack: 192 of 384 experts kept for code at about 2 bits, an Engram table of 111 GB read from the SSD by row; context up to 1M tokens where memory allows | deepseek-v41-coder |
SWE-bench Verified 77.0 (Coder) |
| name | weights | on disk | Mac memory | options | SWE-bench | Terminal-Bench 2.1 |
|---|---|---|---|---|---|---|
| Qwen4 | ||||||
qwen4-35b |
Qwen4-35B-A3B, 256 experts, 8 active, 4-bit, text only, with the MTP head | 32 GB | 48 GB | draft head (MTP); 1M context | n/p (DeepSWE v1.1 61.8 ¹⁰) | n/p (4.1: 21.2 ¹⁰) |
| Qwen3.8-Flash-Next | ||||||
coder |
Flash-Next Coder, 256 experts, mixed 4/5/6/8-bit | 76 GB | 96 GB | draft head (MTP) | Verified 79.2 ¹ | n/p |
full |
Flash-Next, 512 experts, 4-bit | 105 GB | 128 GB | draft head (MTP) | Pro 62.5 ², Verified 82.8 ¹ | n/p |
| Qwen3.8-27B | ||||||
27b-4bit |
Qwen3.8-27B, 4-bit | 16 GB | 32 GB | Pro 61.7 ² | 73.0 ² | |
27b-8bit |
Qwen3.8-27B, 8-bit | 29 GB | 48 GB | LoRA adapters | Pro 61.7 ² | 73.0 ² |
27b-pi |
pi adapter (LoRA, for 27b-8bit) |
0.6 GB | trained to drive pi | Pro hard-51 64.7 ³ | 55.8 ³ | |
27b-turbo |
TURBO Fable Cold Fusion, shorter thinking, from Q4_K_M | 20 GB | 36 GB | draft head (MTP) | n/p | n/p |
27b-turbo-8bit |
the same, from Q8_0 | 30 GB | 48 GB | draft head (MTP) | n/p | n/p |
27b-coder390 |
Coder390 EfficientThink, SFT and RL on code, from Q4 | 23 GB | 48 GB | draft head (MTP) | n/p | n/p |
27b-coder390-8bit |
the same, from Q8_0 | 31 GB | 48 GB | draft head (MTP) | n/p | n/p |
27b-fable5 |
Fable-5 Coding Distilled, from imatrix Q4_K_M | 20 GB | 36 GB | draft head (MTP) | n/p | n/p |
27b-fable5-8bit |
the same, from Q8_0 | 31 GB | 48 GB | draft head (MTP) | n/p | n/p |
27b-qwopus |
Qwopus3.8-27B Coder-Flash, distilled from Qwen3.8-Flash-Max, 4-bit | 16 GB | 32 GB | n/p ⁵ | n/p ⁵ | |
27b-qwopus-8bit |
the same, 8-bit | 29 GB | 48 GB | n/p ⁵ | n/p ⁵ | |
| Ternary Bonsai 2.5 | ||||||
bonsai-27b |
Ternary Bonsai 2.5 27B, Qwen3.8-27B in ternary weights, 2-bit | 8.6 GB | 32 GB | prompt lookup | Verified 75.6 ⁹ | 60.1 ⁹ |
| Inkling 2 Mini | ||||||
inkling |
Inkling 2 Mini, dense 4-bit, experts NVFP4 / MXFP8 | 17 GB | 32 GB | prompt lookup; 1M context | Verified 79.2 ⁴ | 71.6 ⁴ |
inkling-dspark |
DSpark drafter for inkling |
0.6 GB | opt-in, SAETTA_DSPARK=1 |
|||
inkling-pi |
pi adapter (LoRA, for inkling) |
54 MB | trained to drive pi | Pro hard-51 70.6 ⁷ | 56.9 ⁷ | |
| Ornith-1.5 | ||||||
ornith-35b |
Ornith-1.5-35B-A3B, 256 experts, 8 active, 4-bit | 20 GB | 32 GB | prompt lookup | Verified 79.0 ⁶, Pro 59.6 ⁶ | 67.8 ⁶ |
ornith-122b |
Ornith-1.5-122B, 256 experts, 8 active, 4-bit | 70 GB | 96 GB | prompt lookup | Verified 84.5 ⁶, Pro 76.9 ⁶ | 81.2 ⁶ |
| DeepSeek-V4.1-Flash | ||||||
deepseek-v41-coder |
DeepSeek-V4.1-Flash Coder, 192 of 384 experts, GGUF (IQ1_M / IQ2 experts) read in place | 183 GB (72 GB of weights, 111 GB Engram table) | 96 GB | 1M context | Verified 77.0 ⁸ | n/p |
How to run each one:
# Qwen4-35B-A3B (48 GB+, the default there): context up to 1M tokens
saetta download qwen4-35b && saetta start code --pack qwen4-35b
# Qwen3.8-Flash-Next (96 GB+) and Qwen3.8-27B (32 GB+)
saetta download coder && saetta start code --pack coder
saetta download 27b-4bit && saetta start code --pack 27b-4bit
# Qwen3.8-27B coding fine-tunes (converted from their GGUF on download, with a draft head)
saetta download 27b-turbo && saetta start code --pack 27b-turbo
saetta download 27b-qwopus && saetta start code --pack 27b-qwopus
# LoRA adapters on the 27B 8-bit, in the agent's own process
saetta download 27b-8bit && saetta download 27b-pi
saetta start code --pack 27b-8bit --lora-modules qwen3.8-pi=27b-pi
# Ternary Bonsai 2.5 27B (32 GB+): Qwen3.8-27B in ternary weights, 8.6 GB; no draft head yet
saetta download bonsai-27b && saetta start code --pack bonsai-27b
# Inkling 2 Mini (32 GB+), optionally with its DSpark drafter
saetta download inkling && saetta start code --pack inkling
saetta download inkling-dspark && SAETTA_DSPARK=1 saetta start code --pack inkling
saetta download inkling-pi && saetta start code --pack inkling --lora-modules inkling-pi=inkling-pi
# Ornith-1.5: the 35B-A3B (32 GB+) or the 122B (96 GB+); no draft head in these packs
saetta download ornith-35b && saetta start code --pack ornith-35b
saetta download ornith-122b && saetta start code --pack ornith-122b
# DeepSeek-V4.1-Flash Coder (96 GB+, 190 GB of free disk for the download); its Engram table stays on the SSD
saetta download deepseek-v41-coder && saetta start code --pack deepseek-v41-coder
# Any Qwen3.8-27B GGUF, imported into a pack (the folder holds the model's config.json and tokenizer)
saetta import my-finetune.gguf ~/Models/my-finetune && saetta start code --pack ~/Models/my-finetune
# A remote OpenAI-compatible model: add it in /model, or in ~/.pi/agent/models.json, then
saetta code --model myprovider/my-modelBold: what saetta download picks by memory. The GGUF fine-tunes are converted on download (GGUF import); LoRA adapters run in process (LoRA); Inkling's DSpark drafter is opt-in (Choosing a model). A pack too big for this Mac is refused and the context is sized to the memory left (about 37K tokens with 27b-4bit on 32 GB). Every model is checked layer by layer against a numpy reference built from the same weights.
SWE-bench and Terminal-Bench are the publishers' scores for the full-precision model, each with its own harness, not measured by Saetta on these packs: ¹ ISTA-DASLab (SWE-bench Verified, xhigh reasoning; the Coder against the full model), ² Qwen (Flash-Next; SWE-bench Pro with Claude Code, Terminal-Bench 2.1 with Terminus), ³ harness-hub (the adapter under pi, SWE-bench Pro's hard 51 tasks; the base model scores 39.2 and 39.5 there). ⁴ Thinking Machines (SWE-bench Verified with bash only, Terminal-Bench 2.1 with pi). ⁵ Jackrong publishes only its own local tests (an MMLU-Pro subset of 1,500 questions, 93.87; 9 of 9 runs of a 3-task coding-agent test). ⁶ ornith-ai (122B; SWE-bench with OpenHands; Terminal-Bench 2.1 with Terminus-2 for the 35B, with Claude Code for the 122B). ⁷ harness-hub (the adapter under pi at reasoning effort high: SWE-bench Pro's hard 51 tasks, Terminal-Bench 2.1 avg@3 with 1 h per task; the base model scores 66.7 and 44.2 there, under the same setup). ⁸ ISTA-DASLab (this pack at reasoning effort 50, saetta's default for it; 81.2 for the FP8 / FP4 base model). ⁹ prism-ml (the ternary model against Qwen3.8-27B in FP16: SWE-bench Verified 75.6 against 80.6, Terminal-Bench 2.1 60.1 against 70.8, LiveCodeBench v6 83.0 against 87.6, tool-calling average 77.2 against 77.7). n/p: not published (Qwen publishes no Terminal-Bench score for Flash-Next; the fine-tunes publish none for either). ¹⁰ Qwen publishes no SWE-bench or Terminal-Bench 2.1 score: DeepSWE v1.1 61.8, and Terminal Bench 4.1 21.2 cited from Artificial Analysis. Licenses: Flash-Next Qwen Community License 1.0; Ornith-1.5 and DeepSeek-V4.1-Flash MIT; the others Apache-2.0. No weights are part of this repository.
pi 1.5.2's tools, system prompt, AGENTS.md/CLAUDE.md, skills, prompt files, prompt templates, themes, packages, sessions and terminal UI, sharing pi's ~/.pi/agent setup: each continues the other's sessions. Requests and session files match pi's byte for byte on 63 recorded scenarios, the interactive screens on 82, rpc mode on 12. Not supported: pi's TypeScript extensions, image input.
Saetta Code edits a function, shows the diff and runs the tests, with the model in the same process.
saetta code -c # continue this folder's last session
saetta code -p "fix the failing test" # print mode (--mode json, --mode rpc as pi)
saetta code --subagents # up to 3 child agents at once
# in the session: /goal make test passes (works until the condition is met)
# /plan add a --json flag (read-only, then a plan to approve)
saetta code install git:github.com/u/r # a pi package: skills, prompt templates, themes- Sessions resume instantly: the engine's state is saved with each session, so
-c,/resumeand/forkread only what is new (Sessions). - Tool output is read while the tool runs: a command's output goes into the conversation as it streams, so the answer starts sooner when the command ends (Sessions).
- Edits draft from the files: the files the agent read or changed feed the engine's speculation, so an edit that copies a block of a file is written several tokens per step (Sessions).
- Interrupted runs come back: after a crash, a kill or a closed terminal, the next start offers to resume; commands and edits that were running are never re-run without asking.
- Goals and plan mode:
/goal <condition>keeps the agent working, run after run, until a check of the conversation finds the condition met, using subagents when the work splits;/planexplores read-only and ends with a plan you approve before anything changes (Interactive mode). - Parallel agents share one loaded model (Parallel agents); MCP servers over stdio or HTTP with OAuth (MCP).
- The terminal UI is pi's, in C, with a footer showing the branch, the last turn's time and tok/s, and the model;
/monitorshows the engine live. All commands: Commands.
Coming next: commands confined to the project by macOS's Seatbelt.
The same engine serves Claude Code, pi and opencode over OpenAI- and Anthropic-compatible APIs:
saetta start claude # or: saetta start pi, saetta start opencode
saetta serve coder # any client: http://127.0.0.1:8080/v1 (OpenAI) or :8080 (Anthropic)
saetta start claude: Claude Code on the local model writes a snake game and checks it. Real time, no cloud.
Options, endpoints and environment variables: Server, HTTP API, Environment.
Needs full Xcode with the Metal Toolchain and Apple clang 21 or later (C23): make, then make test. See Build from source. src/: code*.c Saetta Code; model.c (Flash-Next, and Qwen4-35B-A3B through qwen4_35b.c), dense.c (27B, and Ornith-1.5 through ornith35b.c, ornith122b.c, Ternary Bonsai through bonsai27b.c with the kernels of bonsai.c), inkling.c (Inkling 2 Mini), dsv41.c (DeepSeek-V4.1-Flash); kernels/ Metal; server.c.
MIT. The engine adapts parts of the MIT-licensed sushi, qwental, Strata, ds4, llama.cpp and MLX; Saetta Code is a port of pi (MIT) and adapts the libraries pi builds on. Each adapted file names its source; every notice is in LICENSE.


