Overview
A 27B model normally needs about 54GB of memory just to hold its weights at 16-bit precision. Ternary Bonsai 2.5 from PrismML fits the same parameter count into 5.9GB and still scores 75.6% on SWE-bench Verified. That is not a precision trade-off in a quantization table. Every weight is cut down to three possible values.
The rule is simple: each weight is either -1, 0 or +1. Replacing 16-bit floats with three values drops the information per weight from 16 bits to roughly 1.58 bits, a theoretical compression near 10x. The measured 54GB to 5.9GB is 9.2x, which lines up. What you store is no longer an approximation but a sign plus sparsity.
The hard part is training, not inference. A three-valued weight has a derivative of nearly zero almost everywhere, so gradients cannot flow back normally. The field generally gets around this with straight-through estimators that pass gradients through unchanged and relies on training to pull weights toward the three values. Papers on this date back a decade; getting it to hold 90 percent of capability at 27B scale is where few teams have landed. PrismML started with Bonsai 27B in July and iterated for about eighteen months to reach 2.5.
Read the scoreboard in two columns. SWE-bench Verified rose from 60.8 on the previous generation to 75.6, against 80.6 for the full-precision Qwen3.8-27B it is built on, so about 93.8 percent is retained. AppWorld, a multi-step tool use benchmark, jumped from 51.2 to 90.5, almost touching the base model. Both numbers point the same way: this generation was retrained specifically for long-horizon agent work.
LiveCodeBench v6, however, came in below the previous generation. That regression explains more than the gains. SWE-bench is about editing a repository and AppWorld is about chaining tool calls, and both reward fewer turns, fewer tokens and no loops. A single competitive programming problem wants one clean pass, which is exactly where ternary weights lose information. The trade-off was made deliberately: give up a little on algorithm puzzles to lift agent tasks.
The local numbers give 5.9GB a concrete meaning. It runs at about 204 tokens per second on an RTX 4090 using multi-token prediction. Two inference paths exist: llama.cpp covers Nvidia and Intel GPUs, MLX covers Mac, iPhone and iPad. A 27B coding model inside a phone was a paper result two years ago.
PrismML grew out of a research group at Caltech and is backed by Khosla Ventures, Google and Samsung. The earlier Bonsai 27B had a smallest variant under 4GB, and 2.5 keeps the same compression approach while shifting the training objective from general capability to agent tasks. Weights sit under the prism-ml organization on Hugging Face under Apache 2.0.
Be clear about the limits. Ternary is not lossless; the five points between 75.6 and 80.6 are the price, and on specific tasks that can mean a class of edge case it cannot handle. The 5.9GB covers weights only, so KV cache and context come on top, and a full long context still eats memory. The base is Alibaba's Qwen3.8-27B rather than an in-house foundation, so the ceiling tracks Qwen.
The fit is specific. A local coding agent running long tasks, offline completion on an iPhone or iPad, or a machine without a discrete GPU that still needs to edit a repository. If the workload is heavy on standalone algorithm problems, the full-precision version remains the safer choice.
Key Features
- Three-valued weights: Every weight is -1, 0 or +1 instead of a 16-bit float, giving close to 10x compression
- 5.9 GB footprint: A 27B model normally needs about 54GB at full precision; the ternary build fits on a laptop
- 93.8% capability retained: SWE-bench Verified at 75.6% against 80.6% for full-precision Qwen3.8-27B
- Retrained for agents: AppWorld rose from 51.2 to 90.5, with fewer turns and tokens needed to finish a task
- 204 tokens per second: Measured on an RTX 4090 with multi-token prediction, fast enough for interactive local use
- Two inference paths: llama.cpp for Nvidia and Intel GPUs, MLX for Mac, iPhone and iPad
Use Cases
- Running an offline coding agent that reads and edits files on an iPhone or iPad
- Repository-level edits on a workstation with under 64GB of memory
- Powering long-horizon tool calling for a local toolchain
- Offline code completion and refactoring in privacy-sensitive settings
- Benchmarking local throughput with llama.cpp on Intel GPUs
Pros
- Keeps 93.8% of its SWE-bench Verified score at 5.9GB
- AppWorld rose from 51.2 to 90.5, nearly matching the full-precision base
- Apache 2.0 license with weights and inference paths both open
- Runs at 204 tokens per second on a single RTX 4090
- MLX support covers Mac, iPhone and iPad
Pricing
Weights are free to download on Hugging Face under Apache 2.0. Inference cost depends on local hardware, and there is no official per-token API.
Summary
A 27B model with every weight reduced to three values, shrinking from 54GB to 5.9GB while keeping 93.8% of its SWE-bench score, small enough to run on an iPhone or an RTX 4090.
Version History
- Ternary Bonsai 2.5 27B (2026-11-25): Ternary model retrained from Qwen3.8-27B at 5.9GB, SWE-bench Verified up from 60.8 to 75.6, AppWorld up from 51.2 to 90.5, weights released under Apache 2.0