Jorge Turbica / blog · Blog ← All articles ES · Leer en español
AI

A 27B model in 5.9 GB solves 75.6% of SWE-bench Verified: Ternary Bonsai 2.5

PrismML squeezes Qwen3.8 27B into ternary weights: 5.93 GB, Apache 2.0 and near-FP16 agent scores. Runs on an RTX 4090 with llama.cpp.

A 27-billion-parameter model that fits in 5.93 GB and solves 75.6% of SWE-bench Verified. That is Ternary Bonsai 2.5 27B, released by PrismML on November 24, 2026 under Apache 2.0: the same Qwen3.8-27B that weighs 53.8 GB in FP16, squeezed into weights that can only be −1, 0 or +1. It fits on an RTX 4090 with room to spare and, according to its authors, calls tools almost as well as the original.

What's new in 2.5

The format is unchanged from Bonsai 2 (1.76 bits per weight, one FP16 scale per group of 128 weights, in a Hadamard-rotated basis). What changed is the training, aimed at long agent tasks: fewer turns, fewer tokens and fewer reasoning loops. The jump shows mostly in agentic coding, where Bonsai 2 lagged badly:

BenchmarkQwen3.8 27B FP16Bonsai 2 27BBonsai 2.5 27B
SWE-bench Verified80.660.875.6
Terminal-Bench 2.170.852.860.1
DeepSWE30.10.027.0
AppWorld93.251.290.5
Average of 5 tool-calling benchmarks77.767.077.2

On tool calling (τ²-Bench, τ³-Bench, BFCL v3 and v4, AppWorld) the average lands half a point from the full model. On coding it keeps 90% of the FP16 score, up from 63% for the previous release. It keeps a 262K-token context, defaults to xhigh reasoning effort and ships an optional vision tower in a separate mmproj file.

Versus quantizing it yourself

The usual way to fit a 27B model on a consumer GPU is a conventional GGUF quantization of the same base model. PrismML compares against several, and that table is the most useful part of the release:

BuildSizeTool-calling avgCoding avg
Qwen3.8 FP1653.8 GB77.760.5
GSQ-RCO IQ3_XXS10.1 GB75.355.5
GSQ-RCO IQ2_S9.3 GB74.152.5
Unsloth UD-IQ2_XS7.6 GB75.347.8
Ternary Bonsai 2.55.93 GB77.254.2

Only IQ3_XXS, at 1.7 times the size, beats it on the coding average, thanks to its Terminal-Bench score. The detail I find most telling is elsewhere: GSQ-RCO IQ2_XS scores 79.5 on τ²-Bench but collapses to 46.5 on AppWorld, because in about one task in five it writes a script that guesses every API call and declares the task done before seeing any output. Aggressive quantization can look fine on one benchmark and fall apart on another; for agents, test with long tasks, not one-shot prompts.

On speed, with the PTQ1_0 file and plain decoding, PrismML measures 112 tokens/s on an RTX 4090 and 186 on an H100. With the multi-token prediction (MTP) head and speculative decoding, the 4090 reaches 204 tokens/s.

How to try it

There are three packings of the same model. PTQ1_0 (5.99 GB on disk) and PQ2_0 need PrismML's llama.cpp fork; Q2_0 runs on stock llama.cpp from release b11556 onward. With the fork on an NVIDIA GPU:

bash
hf download prism-ml/Ternary-Bonsai-2.5-27B-GGUF \
  Ternary-Bonsai-2.5-27B-PTQ1_0.gguf --local-dir .

./bin/llama-cli -m Ternary-Bonsai-2.5-27B-PTQ1_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

On stock llama.cpp, run the same command with Ternary-Bonsai-2.5-27B-Q2_0.gguf (7.67 GB). Three tips from the model card that save time:

  • --min-p 0 matters because llama.cpp defaults to 0.05, and the benchmarks were run without it.
  • -n 16384 leaves room for the thinking trace: with a small cap, generation stops before the answer.
  • On llama-server with limited VRAM, -np 1 restricts the server to one request; one user measured total GPU memory on a 10 GB RTX 3080 dropping from about 9.5 GB to 7.8 GB.

For serving with tools and MTP, the Bonsai-demo repository has the scripts and is the reference PrismML keeps up to date.

Before you put it to work

The caveat that matters: a llama.cpp build older than b11556 loads the Q2_0 file without any warning and produces garbage, because it lacks the Hadamard activation runtime. The same goes for apps that bundle their own llama.cpp. Check llama-cli --version before blaming the model.

To validate it for your use case:

  1. Pin the llama.cpp build (the fork, or stock ≥ b11556) and record it next to the GGUF file.
  2. Replay a handful of real agent tasks, not just one-off prompts, and compare with the model you use today.
  3. Measure memory at your real context size: 5.93 GB is the weights; the KV cache grows with -c.
  4. If you enable MTP, use the published presets for your backend and check that prefill doesn't regress on your GPU (on NVIDIA it drops by 9–23% without the kernels still in testing).

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗