ChengRang

Ternary Bonsai 2.5 27B

AI Models Open Source

Ternary-quantized model released 2026/11/25 by PrismML, built on Qwen3.8-27B with every weight reduced to -1, 0 or +1, shrinking the footprint from 54GB to 5.9GB. SWE-bench Verified rises from 60.8% on the previous generation to 75.6% against 80.6% for the full-precision base, and AppWorld rises from 51.2% to 90.5%. Runs at 204 tokens per second on an RTX 4090, with llama.cpp covering Nvidia and Intel GPUs and MLX covering Mac, iPhone and iPad. Open weights under Apache 2.0

Ternary QuantizationOn-DeviceCode GenerationOpen WeightsPrismML
Visit Ternary Bonsai 2.5 27B

Disclaimer: Review content represents our editorial team's views and experience, not commercial recommendation or investment advice. Product info and pricing may change; refer to official sources.

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

Use Cases

Pros

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

Category
AI Models
Pricing
Open Source
Tags
Ternary Quantization · On-Device · Code Generation
Website

Related Tools