Inter-office memo
- To
- Everyone who wants a coding model on their own computer
- From
- Mo, Chief Executive
- Date
- November 25, 2026, 3:12 PM CST
- Re
- Ternary Bonsai 2.5 27B on your computer
Bonsai 2.5 fits a 27B coding model in 6 GB. How to run it, and where it falls short
On November 24, 2026, PrismML released Ternary Bonsai 2.5 27B, an Apache 2.0 version of Qwen3.8-27B whose ternary weights take 5.93 GB, against 53.8 GB at full precision. Its Q2_0 file runs in stock llama.cpp from build b11556, the smaller files need PrismML’s fork, Macs can also use MLX, and Ollama and LM Studio don’t list it yet. PrismML puts it at 75.6% on SWE-bench Verified, against 80.6% for the full model.
What PrismML released
On November 24, 2026, PrismML released Ternary Bonsai 2.5 27B, “an upgrade to Ternary Bonsai 2 27B with substantially stronger agentic coding, multi-turn tool use, and multi-step task execution.” It’s Qwen3.8-27B with every weight reduced to one of three values, −1, 0 or +1, and one 16-bit scale for each group of 128 weights. That comes to 1.76 bits per weight and 5.93 GB, “against 53.8 GB for the FP16 model,” by its model card. The weights are on Hugging Face under Apache 2.0, which allows commercial use.
It’s the same size as Bonsai 2 27B, released on September 17. What changed is how it holds up in an agent. PrismML says it worked on long chains of tool calls, “interpreting results, adjusting when a step fails, and maintaining the task’s objective through the whole interaction,” and on “addressing excessive thinking and repetitive loops in the previous model.” It keeps Qwen3.8-27B’s 262,144-token context, reads images through a separate vision file, and thinks before it answers.
PrismML grew out of a Caltech research team. In July, its roughly 4 GB, 1-bit Bonsai 27B was, by PrismML’s claim, the first model of its size to run on an iPhone, 9to5Mac recalled. The ternary models since Bonsai 2 are bigger, at 5.9 GB, and much closer to the full model.
Which file to download
The same model comes packed four ways, at the sizes Hugging Face lists:
| File | Size | Runs in | Best for |
|---|---|---|---|
PTQ1_0 |
5.99 GB | PrismML’s llama.cpp fork | NVIDIA GPUs: the smallest file and the fastest decoding |
PQ2_0 |
7.25 GB | PrismML’s llama.cpp fork | Macs: the format PrismML benchmarked on Apple’s Metal |
Q2_0 |
7.67 GB | Stock llama.cpp, build b11556 or later | Any recent llama.cpp, including v1.0.0 |
| MLX 2-bit pack | 8.88 GB | Python on an Apple silicon Mac | Macs without llama.cpp, more slowly |
“All three are the same ternary model,” the card says of the GGUF files; they differ in how the weights are packed. Each also comes as an -mtp file, about 0.24 GB larger, with a draft head that guesses the next few tokens for speculative decoding. PrismML measured it speeding up decoding “1.5–1.8× on NVIDIA GPUs and 1.1–2.1× on the other devices,” with output that matches decoding without it. Images need a separate mmproj file of 0.63 GB or 0.93 GB, “loaded only for image input.”
Stock llama.cpp learned to run Bonsai in pull request 29600, first released in build b11556 on October 11, 2026, so llama.cpp 1.0 runs Q2_0. Support for PTQ1_0 is in pull request 29672, still open. On an H200, PrismML found stock llama.cpp matched its own runtime’s output on Q2_0 but decoded at 109 tokens a second, against 150.
What you need to run it
PrismML doesn’t publish a minimum. Memory goes to the weights and to the context cache, which PrismML’s agent guide puts at “64 KiB/token (~6.3 GiB at 100K)” for its 27B models. At 32,768 tokens that’s 2 GiB, so the weights and a 32K cache come to about 8 to 10 GB, depending on the file, before the runtime’s own buffers. PrismML’s setup scripts size the context to your memory, from 8K tokens on small machines up to 131K on machines with more than 71 GB.
Watch the server’s slots. In automatic mode, llama-server “can start with four slots that share a unified KV cache.” On a 10 GB RTX 3080, one user measured about 9.5 GB of GPU memory in use, desktop included, and 7.8 GB after adding -np 1, which limits it to one request at a time. PrismML added that advice to the model card the same day.
How fast it writes, in tokens a second, as PrismML measured it with llama-server on sets of real prompts:
| Device | Without the draft head | With it |
|---|---|---|
| NVIDIA RTX 5090 | 174 | 305 |
| NVIDIA RTX 4090 | 111 | 204 |
Apple M4 Pro, PQ2_0 |
22.9 | 25.3 |
| Intel Core Ultra laptop, integrated GPU | 11.1 | 23.1 |
| Samsung Galaxy S26 Ultra, on its NPU | 6.34 | 8.79 |
The phone needs “a fix not yet released.” On an M5 Pro, a separate test without the draft head measured 30.2 tokens a second in llama.cpp and 21.7 in MLX. PrismML says Bonsai 2.5 runs on iPhone and iPad through MLX, but hasn’t published speeds for them.
How to run it
-
PrismML’s demo, on a Mac, Linux or Windows. Run
git clone https://github.com/PrismML-Eng/Bonsai-demo.git,cd Bonsai-demoand./setup.sh, then./scripts/start_llama_server.sh, and openhttp://localhost:8080for a chat page. In PowerShell, runSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass, then.\setup.ps1and.\scripts\start_llama_server.ps1. Setup fetches the fork’s binaries and about 7.6 GB of weights, or 6.4 GB on CUDA graphics cards, plus Open WebUI and a code interpreter, “which add a few GB more and most of the wait.” Skip those withBONSAI_OPENWEBUI=0andBONSAI_CODE_INTERPRETER=0. The server uses the draft head by default on NVIDIA GPUs and Macs. -
Stock llama.cpp, build b11556 or newer. Check yours with
llama-cli --version, then:hf download prism-ml/Ternary-Bonsai-2.5-27B-GGUF Ternary-Bonsai-2.5-27B-Q2_0.gguf --local-dir . llama-server -m Ternary-Bonsai-2.5-27B-Q2_0.gguf --alias bonsai-2.5-27b \ -ngl 99 -fa on -c 32768 -np 1 \ --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0That serves an OpenAI-compatible API and a chat page at
http://localhost:8080. The sampling settings are the model card’s, and it notes that llama.cpp appliesmin_p=0.05by default, “so pass--min-p 0explicitly.” -
PrismML’s fork, for the smaller files. Download a binary from the fork’s releases and use the same command with
PTQ1_0on an NVIDIA GPU orPQ2_0on a Mac. -
MLX, on an Apple silicon Mac. Run
hf download prism-ml/Ternary-Bonsai-2.5-27B-mlx-2bit --local-dir ./bonsai-25-mlx, installruntime/requirements.txtinto a Python virtual environment in that folder, and runpython quickstart.py "What is 2 plus 2?", as its model card shows. PrismML’s pages disagree on images: the MLX card says the pack takes text and images, while its demo calls the pack text-only.
What doesn’t have it yet, on November 25:
- Ollama. Its library has the older Bonsai 2, updated a month ago. Plain
bonsai-2is its 9B model; the 27B isollama run bonsai-2:27b, an 8.3 GB download, andollama launch opencode --model bonsai-2:27bsets up OpenCode with it. Bonsai 2 27B scored 60.8 on SWE-bench Verified, by PrismML’s numbers, to 2.5’s 75.6. - LM Studio. Its catalog lists the first Bonsai 27B, updated three months ago. PrismML says apps that bundle their own engines follow “the version and model loader they ship.”
- Hosted copies. OpenRouter serves Bonsai 2 27B, at $0.075 per million input tokens and $0.50 per million output, but not 2.5.
How good it is
PrismML compares Bonsai 2.5 with full-precision Qwen3.8-27B, the low-bit GGUF builds people already run, and its own Bonsai 2. A selection from its card:
| Benchmark | Qwen3.8-27B, full precision | GSQ-RCO IQ3_XXS build | Bonsai 2 27B | Bonsai 2.5 27B |
|---|---|---|---|---|
| Size | 53.8 GB | 10.1 GB | 5.93 GB | 5.93 GB |
| SWE-bench Verified | 80.6 | 73.2 | 60.8 | 75.6 |
| Terminal-Bench 2.1 | 70.8 | 66.3 | 52.8 | 60.1 |
| DeepSWE | 30.1 | 27.0 | 0.0 | 27.0 |
| AppWorld | 93.2 | 86.1 | 51.2 | 90.5 |
| Tool calling, average of five | 77.7 | 75.3 | 67.0 | 77.2 |
| LiveCodeBench v6 | 87.6 | 78.6 | 83.8 | 83.0 |
PrismML says it keeps “90% of FP16 on agentic coding, up from 63% for Bonsai 2,” and calls it “the strongest agentic model under 10 GB.” Every number is PrismML’s own. Its whitepaper says it ran each task once, thinking at xhigh, served through vLLM on NVIDIA H100s with the full 262,144-token context, which isn’t a laptop with a 32K context. Artificial Analysis had no page for the model on November 25.
PrismML names the gaps itself. “Terminal-Bench 2.1 is still the agentic benchmark where we are furthest from FP16,” and it hasn’t measured “workloads that run for hours across many context windows.” With a 32 GB Mac, Inkling 2 Mini is the other new choice: Thinking Machines reports 79.2% on SWE-bench Verified for it, measured by a different team with different settings, so the two scores don’t compare directly.
Problems people are hitting
- Long thinking. By November 25, users in a Hugging Face thread called Overthinker reported it spending a long time thinking, in an agent and in chat. It reasons at
xhighby default. PrismML suggestsreasoning_effort: "medium"per request, or--chat-template-kwargs '{"reasoning_effort":"medium"}'on the server, and sayslow“is not supported.” Keep the output limit at 16,384 tokens or more, or it stops mid-thought. - Gibberish. A
Q2_0file on a llama.cpp build older than b11556. Update, or use PrismML’s fork. - Unknown type errors.
PTQ1_0andPQ2_0need the fork: “Stock llama.cpp rejects them as unknown types.” - Metal errors on M5 Macs. On some macOS 26.2 and 26.3 releases,
ggml_metal_library_init_from_source: error compiling sourceand then out-of-memory errors. PrismML’s FAQ workaround is to start withGGML_METAL_TENSOR_DISABLE=1.
Use it in a coding agent
llama-server takes OpenAI-style tool calls. With its Jinja templates on, which current llama.cpp does by default, /v1/chat/completions “accepts the standard OpenAI tools array and returns structured tool_calls,” PrismML says. OpenCode finds Ollama, LM Studio and vLLM on its own, and for another OpenAI-compatible server its docs say to “use the custom provider recipe and list its models explicitly.” With the server above running, add this to opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"providers": {
"bonsai": {
"name": "Bonsai on llama.cpp",
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "http://127.0.0.1:8080/v1" },
"models": {
"bonsai-2.5-27b": { "name": "Ternary Bonsai 2.5 27B" }
}
}
}
}
Then pick it under /models. The model ID matches the server’s --alias. llama-server also answers Anthropic’s Messages API at /v1/messages, by its documentation, which is how other agents can reach it, but PrismML’s guides cover only the OpenAI-style API. Give it small, well-defined jobs, and run it where a wrong command can’t do damage.
Enjoy runs OpenCode beside Claude Code, Codex and the other labs’ agents, and its model picker lists every model OpenCode has set up, local ones included. Once Bonsai 2.5 is in OpenCode’s config, you can hand it a conversation when another agent’s plan runs low and keep going at no cost, with the code staying on your computer. It can take scheduled workflows too, which Enjoy runs only while your computer is awake and Enjoy is open.
What isn’t known yet
- Independent scores. Every benchmark above is PrismML’s.
- When Ollama and LM Studio add it, and when
PTQ1_0reaches stock llama.cpp. - How fast it runs on an iPhone or iPad, which PrismML says it supports.
- How it holds up on hours-long agent work, which PrismML hasn’t measured.
- Whether the MLX pack reads images, where PrismML’s own pages disagree.
- A hosted price. OpenRouter serves only Bonsai 2.
If your graphics card or Mac has about 10 GB of memory to spare, Bonsai 2.5 costs a 6 to 8 GB download to try on a real task. Start with the Q2_0 file on an up-to-date llama.cpp, keep the context at 32K and -np 1, and save the hard problems for a frontier model.
9.Questions.
How much memory do I need to run Bonsai 2.5?
- PrismML doesn’t publish a minimum. Its main files are 5.99 GB to 7.67 GB, and its guide puts the context cache at 64 KiB a token, 2 GiB at 32K tokens, so the weights and a 32K cache come to about 8 to 10 GB. On a 10 GB RTX 3080, one user measured 7.8 GB of GPU memory in use, desktop included, after limiting llama-server to one slot with -np 1.
Does Bonsai 2.5 work in Ollama or LM Studio?
- Not from their catalogs yet. On November 25, 2026, Ollama’s library has the older Bonsai 2, whose 27B is ollama run bonsai-2:27b, and LM Studio’s has the first Bonsai 27B. PrismML says apps that bundle their own llama.cpp need an engine from build b11556 or newer to run its Q2_0 file, and its smaller files need PrismML’s fork.
Why does Bonsai 2.5 output gibberish?
- Most likely your llama.cpp is older than build b11556, from October 11, 2026. PrismML warns that older builds “load Q2_0 without any warning and produce garbage,” so check with llama-cli --version. The PTQ1_0 and PQ2_0 files need PrismML’s own llama.cpp fork, and stock llama.cpp rejects them as unknown types.
Is Bonsai 2.5 as good as Qwen3.8-27B?
- Close, by PrismML’s numbers, at a ninth of the size. It scores 75.6% on SWE-bench Verified against 80.6% for full-precision Qwen3.8-27B, and 77.2 against 77.7 on tool calling, averaged over five benchmarks. It trails most on Terminal-Bench 2.1, 60.1 against 70.8. Nobody has published independent scores yet.
How do I use Bonsai 2.5 with OpenCode?
- Start llama-server with the model and --alias bonsai-2.5-27b, then add a custom provider to OpenCode’s config with the package @opencode/ai/providers/openai-compatible, the base URL http://127.0.0.1:8080/v1 and that model ID. OpenCode finds Ollama, LM Studio and vLLM by itself, but its docs say to add other OpenAI-compatible servers by hand.
Why does Bonsai 2.5 think for so long?
- It reasons at xhigh effort by default, the most accurate setting. PrismML suggests asking for “medium” effort, which it says thinks “noticeably less” and is “about as accurate”; low isn’t supported and behaves close to xhigh. Give it an output limit of 16,384 tokens or more, or it stops mid-thought.