AI coding agents

Ternary Bonsai 2.5 27B: a 6 GB coding model and how to run it

In short

PrismML released Ternary Bonsai 2.5 27B on 24 November 2026, a ternary-compressed Qwen3.8 27B with a 5.9 GB footprint and Apache 2.0 weights. It reports 75.6 on SWE-bench Verified, up from 60.8 for Bonsai 2 and against 80.6 for the full-precision base. It runs on llama.cpp and MLX, but older llama.cpp builds silently produce garbage.

PrismML released Ternary Bonsai 2.5 27B on 24 November 2026: a compressed version of Qwen3.8 27B that keeps the previous release's 5.9 GB footprint and claims much stronger agentic coding. The weights are Apache 2.0 on Hugging Face. The interesting part for engineers is the gap it closes. Bonsai 2 lost about 20 points of SWE-bench Verified to compression; PrismML says 2.5 loses five. A 27B-class coding model that fits in 6 GB of memory changes what you can run on a consumer GPU or a laptop.

What changed from Bonsai 2

The base is Qwen3.8 27B, compressed with ternary weights. The announcement doesn't give the bit width or method and points to a whitepaper in the Bonsai-demo repository for technical details. The GGUF model card gives one figure: the PTQ1_0 file is 5.93 GB at 1.76 bits per weight.

PrismML describes 2.5 as an upgrade for agent work specifically: fewer turns and tokens per task, better handling of long tool-call sequences, and less "excessive thinking and repetitive loops" than Bonsai 2. Those are the failure modes that make small models frustrating inside an agent loop, so they matter more than a raw benchmark bump.

The reported benchmarks

These are PrismML's numbers. The model card says they were run in thinking mode at xhigh reasoning effort. We haven't seen independent reproductions yet.

BenchmarkQwen3.8 27B (full precision)Bonsai 2 27BBonsai 2.5 27B
SWE-bench Verified80.660.875.6
DeepSWE v1.1 (mini-swe-agent)30.1027
Terminal-Bench 2.170.852.860.1
AppWorld93.251.290.5
τ³-Bench72.869.173.9
BigCodeBench61.557.260.3
LiveCodeBench v687.683.883.0

How to read this:

  • Repository-level fixing recovered most. SWE-bench Verified moved from 60.8 to 75.6, and DeepSWE from 0 to 27. Bonsai 2 effectively couldn't do DeepSWE; 2.5 is close to the base model.
  • Long terminal tasks still lag. Terminal-Bench 2.1 is 10.7 points behind the base. If your agent spends long sessions in a shell, expect the gap to show.
  • Single-function coding barely moved. LiveCodeBench v6 dropped slightly, from 83.8 to 83.0. The work went into agent behaviour, not puzzle-style coding.

PrismML says the model "significantly narrows the performance gap" to the base. It doesn't claim parity, and the table shows why. For comparison, the Inkling 2 Mini release we covered last week reported 79.2 on SWE-bench Verified (bash only) at about 20 GB. The benchmark harnesses differ, so treat that as context rather than a head-to-head.

Speed and hardware

The announcement reports generation with multi-token prediction (MTP) at 291 tokens/s on an NVIDIA H100 and 204 tokens/s on an RTX 4090, with prompt processing around 3,200 and 3,060 tokens/s for a 2,000-token prompt. It says the model runs on NVIDIA and Intel GPUs through llama.cpp and on Apple devices (Mac, iPhone, iPad) through MLX.

The model card adds a practical memory note. llama.cpp's server starts four parallel slots by default, which raises VRAM use. A community report on a 10 GB RTX 3080 showed about 9.5 GB in use by default and about 7.8 GB with -np 1. If you are the only user, set it.

Context length is 262K tokens. Image input needs a separate mmproj vision file; text-only use doesn't.

How to run it, and the trap to avoid

There are three GGUF variants, and they need different runtimes:

VariantRuntimeNotes
Q2_0Stock llama.cpp, build b11556 or newerLarger file; the card lists 7.49 GB
PQ2_0PrismML's llama.cpp forkRejected by stock builds
PTQ1_0PrismML's llama.cpp fork5.93 GB, 1.76 bits per weight

The trap is in the first row. The model card warns that stock llama.cpp builds older than b11556 "load Q2_0 without any warning and produce garbage." If you see nonsense output, check the build before blaming the model:

bash
llama-cli --version

With a current stock build, the card's commands are:

bash
hf download prism-ml/Ternary-Bonsai-2.5-27B-gguf Ternary-Bonsai-2.5-27B-Q2_0.gguf --local-dir .
llama-cli -m Ternary-Bonsai-2.5-27B-Q2_0.gguf \
    -ngl 99 -fa on -c 32768 \
    --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 \
    -p "Explain quantum computing in simple terms." -n 16384

For the smallest PTQ1_0 file, build PrismML's fork first:

bash
git clone https://github.com/PrismML-Eng/llama.cpp && cd llama.cpp
cmake -B build -DGGML_CUDA=ON && cmake --build build -j

Drop -DGGML_CUDA=ON on macOS. On Apple Silicon, the MLX 2-bit pack in the same collection is the other route.

A few settings from the card that are easy to get wrong:

  • --min-p 0. llama.cpp defaults to 0.05; the recommended value is 0.
  • Leave room for thinking. It is a reasoning model that thinks by default. A small -n cap can end generation before any answer appears, which is why the example uses 16384.
  • Reasoning effort. The default is xhigh. medium gives shorter responses. The card says low is not supported and behaves close to xhigh.
  • Sampling. Thinking mode: temperature 1.0, top_p 0.95, top_k 20. Non-thinking: temperature 0.7, top_p 0.80, top_k 20, presence penalty 1.5.

The model card doesn't document a tool-calling template. It refers to the Bonsai-demo repository for server, tool-calling and reasoning-budget setup, and says that repository is the source of truth if the two disagree. Wire it into an agent only after checking that tool calls parse correctly in your client.

Where it fits

A model this small is most useful where sending code to a hosted API is the problem: air-gapped environments, regulated codebases, offline work, or high-volume background tasks where per-token cost adds up. It is less obviously useful as a replacement for a frontier model on hard multi-file changes. The 5-point SWE-bench gap and the 10-point Terminal-Bench gap to the base are real, and the base itself isn't a frontier model.

A sensible evaluation is a dozen closed issues from your own repository, run with the agent you already use, comparing pass rate, turns and wall-clock time against your current model. Benchmarks measure someone else's code; your issues measure yours. Our post on the eight steps of an agentic evaluation is a reasonable template.

Open questions remain. PrismML points to its whitepaper for how the compression and evaluation were done, but we haven't seen an independent reproduction of the scores yet, and the speed figures are vendor-reported with MTP speculative decoding, which the card says still needs some unreleased builds.

Sources

FAQ

How much memory does Ternary Bonsai 2.5 27B need?

The smallest file, PTQ1_0, is 5.93 GB at 1.76 bits per weight. The Q2_0 file for stock llama.cpp is larger, listed at 7.49 GB. Add memory for context and parallel slots; one report on a 10 GB RTX 3080 showed about 7.8 GB in use with -np 1.

Why does Bonsai 2.5 produce garbage output in llama.cpp?

Most likely your llama.cpp build is older than b11556. The model card warns that older stock builds load the Q2_0 file without any warning and produce garbage. The PTQ1_0 and PQ2_0 files need PrismML's llama.cpp fork and are rejected by stock builds.

How good is Ternary Bonsai 2.5 at coding?

PrismML reports 75.6 on SWE-bench Verified, against 80.6 for the full-precision Qwen3.8 27B and 60.8 for Bonsai 2. It also reports 60.1 on Terminal-Bench 2.1 and 83.0 on LiveCodeBench v6. These are vendor numbers run in thinking mode at xhigh effort.

What license is Ternary Bonsai 2.5 27B released under?

The model weights are available under the Apache 2.0 license, according to PrismML's announcement and the model card.

Written by the CodeBeast Team with AI assistance. Spotted a mistake? Email support@codebeast.ai.