MTPLX/Models/Bonsai 2 27B

The fastest way to run Ternary Bonsai 2 27B on a Mac.

Ternary Bonsai 2 27B runs on a Mac with MTPLX at 64.4 tok/s after a 4,061-token prompt on an M5 Max. In the same session the 4-bit Qwen 3.8 27B ran 52.6 tok/s, so Bonsai is faster in half the memory. Prism ML built it from Qwen3.8-27B with ternary weights. It reads images, and its 8.85 GB pack runs on Macs with 16 GB of memory. MTPLX 2.12.0 added two GPU kernels written for this pack and made it the first suggestion on M3, M4 and M5 Macs with 16 to 31 GB.

The pack

Prism ML's Ternary Bonsai 2 27B is Qwen3.8-27B rebuilt with ternary weights, and it reads images. Prism ML stores every weight of the language model as -1, 0 or +1 with one scale per group, so the 27B language model takes 7.67 GB. Prism ML reports that it keeps 98.2 percent of the full model's benchmark average.

The MTPLX pack, Youssofal/Ternary-Bonsai-2-27B-MTPLX-Optimized-Speed, is 8.85 GB. It carries Prism ML's language model and vision tower unchanged (8.60 GB) and adds the Qwen3.8-27B draft head (0.24 GB). In the Mac app it is called Bonsai 2 27B Optimized Speed, and the served id is mtplx-bonsai-2-27b-optimized-speed. The base model is Prism ML's Ternary-Bonsai-2-27B-mlx-2bit. Full credit for the model goes to Prism ML, and the pack carries their license and notice.

Measured speeds

MacBook Pro M5 Max with 128 GB, MTPLX 2.12.0, measured 22 September 2026. Alternating boots of 2.12.0 without and with the new kernels, one model loaded at a time, the model's own sampling (temperature 1.0, top-p 0.95, top-k 20), thinking off, 512-token answers. The Qwen 3.8 27B ran in the same session.

Run4,061-token prompt16,350-token prompt
Bonsai 2 27B, MTPLX 2.12.064.4 tok/s (+28%)57.1 tok/s (+26%)
Bonsai before the new kernels50.4 tok/s45.2 tok/s
Qwen 3.8 27B Optimized Speed52.6 tok/s51.0 tok/s
Peak memory, Bonsai11.4 GB14.6 GB
Peak memory, Qwen 3.8 27B23.9 GB27.0 GB

Bonsai is faster than the 4-bit Qwen 3.8 27B at both prompt lengths, in half the memory. The draft head comes from Qwen3.8-27B and accepts 75 percent of its drafts on Bonsai. It runs at depth 1 by default. With the new kernels, depth 3 was 14 percent slower than depth 1 over a 3,000-token answer. The two kernels also make Bonsai read prompts 7 to 8 percent faster. They run on every Mac from M1 to M5, and only the M5 Max has measured their speed.

Prism ML's own figure. Prism ML's announcement of 17 September 2026 gives 46.8 tok/s for Bonsai 2 27B on an Apple M5 Max with MLX, and it does not state a context length. MTPLX's figure is 64.4 tok/s on an M5 Max after a 4,061-token prompt.

Which Mac

In MTPLX 2.12.0 the app and the CLI read one catalog with the same recommendation rule. The first recommendation on M3, M4 and M5 Macs:

Mac memoryFirst recommendation
Below 16 GBQwen 3.5 4B Optimized Speed
16 to 31 GBTernary Bonsai 2 27B, with MiMo V2.6 Qwen 9B second
32 to 255 GBQwen 3.8 27B Optimized Speed
256 GB and aboveFlash-Next Optimized Speed
  • 16 GB: Bonsai gets an 8,192-token context window and no warm cache in RAM, so restores come from the SSD.
  • Agent clients: the pack card recommends 18 GB or more for agent clients such as OpenCode.
  • 32 GB or more: the app suggests Qwen 3.8 27B first, or Flash-Next from 256 GB. Bonsai still runs there, with a context window of up to 262,144 tokens.
  • M1 and M2: the app keeps its FP16 recommendations. The Bonsai kernels run on every Mac from M1 to M5 and are tested against the stock operations on each load. A kernel that fails is switched off until the engine restarts, the stock path takes over, and /health says so.
  • Existing choice: a model you already picked stays selected.

Memory and download

ItemFigure
Download8.85 GB: the language model and vision tower (8.60 GB) plus the draft head (0.24 GB)
Language model7.67 GB, ternary weights with one scale per group
Peak while serving, M5 Max11.4 GB after a 4,061-token prompt, 14.6 GB after a 16,350-token prompt
Context window8,192 tokens on 16 GB, 20,480 on 18 GB, 94,208 on 24 GB, up to 262,144
Recommended Macs16 GB or more of unified memory, 18 GB or more for agent clients such as OpenCode

MTPLX 2.12.0 changed the memory planner so that Bonsai runs on 16 GB Macs. The figures below were measured by limiting a 128 GB M5 Max to each class's memory budget, with the draft head and the vision tower loaded.

Mac memoryEngine budgetContext windowPeak with prompts up to 8KPeak with a 16K prompt
16 GB12.0 GiB8,192 tokens, no warm cache in RAM11.55 to 11.80 GiB12.11 GiB, over the budget
18 GB13.5 GiB20,480 tokens (36,864 with 8-bit KV)11.55 to 11.78 GiB12.28 GiB
24 GB18.0 GiB94,208 tokens (167,936 with 8-bit KV)11.55 to 11.78 GiB12.28 GiB

With the draft head active under the 16 GB budget, a 7,006-token prompt and a 1,024-token answer peaked at 11.54 GiB of GPU memory and 12.79 GiB for the whole process, with no swap growth. In every run the peak sat about 3.1 GiB above the weights and the KV cache, which is what the planner sets aside. The SSD session cache defaults to 16 GiB on Macs with 16 GB of RAM or less and 24 GiB on Macs with up to 32 GB.

How to run it

Mac app: download MTPLX and pick "Bonsai 2 27B Optimized Speed". It needs MTPLX 2.12.0 or later.

Command line, with pip:

pip install mtplx
mtplx serve --model Youssofal/Ternary-Bonsai-2-27B-MTPLX-Optimized-Speed

Or with Homebrew:

brew install youssofal/mtplx/mtplx
mtplx serve --model Youssofal/Ternary-Bonsai-2-27B-MTPLX-Optimized-Speed

The serving contract ships inside mtplx_runtime.json, and MTPLX reads it on load. Sampling is temperature 1.0, top-p 0.95, top-k 20.

Bonsai supports two reasoning efforts, medium and xhigh. medium is the default in the app, the CLI and every connected client, and Prism ML states that low is not supported. On a stopwatch coding task, xhigh spent 577 s and 21,848 reasoning tokens without reaching an answer, while medium finished the task and a follow-up correction.

Siblings: Qwen 3.8 27B, the 4-bit 27B for Macs with 32 GB or more, and MiMo V2.6 Qwen 9B, the MTPLX pack of Xiaomi's MiMo-V2.6-Distill-Qwen-9B. The full list of changes is in the MTPLX 2.12.0 release notes.

How it is built

  • Ternary weights. Prism ML stores every weight of the language model as -1, 0 or +1 with one scale per group. MTPLX runs those weights natively.
  • A rotation kernel. One GPU kernel applies Prism ML's Hadamard rotation in a single step and returns the same bits as the four operations it replaces.
  • A ternary matrix multiply kernel. The other runs the ternary matrix multiply for decoding. It is as close to Prism ML's own float32 reference as the stock kernel (mean KL 2.92e-6 against 3.02e-6 over 1,630 positions of code, prose and reasoning), and greedy output is identical with the kernels on and off.
  • A check on every load. Each load tests both kernels on that Mac's GPU against the stock operations before it uses them.
  • Compiled verification. Bonsai uses the compiled verifier, which matched eager verification in all 613 rounds checked.
  • Draft head. The Qwen3.8-27B multi-token-prediction head drafts ahead, and the full model verifies its drafts in one pass.
  • Pack checks. MTPLX applies Prism ML's Hadamard rotation while it runs the model, and it refuses a pack whose rotation metadata or vision tower is missing.

Speculation in MTPLX is exact. Drafts are accepted with the probability-ratio rule plus residual resampling, so the output follows the model's own distribution at any temperature.

Questions

Can a 16 GB Mac run Bonsai 2 27B?

Yes, MTPLX 2.12.0 runs Ternary Bonsai 2 27B on 16 GB Macs with an 8,192-token context window and no warm cache in RAM. With a 128 GB M5 Max limited to the 16 GB budget of 12.0 GiB, prompts up to 8K tokens peaked at 11.55 to 11.80 GiB, and a 16K prompt reached 12.11 GiB, over the budget. The pack card recommends 18 GB or more for agent clients such as OpenCode.

Can a 16 GB Mac run a 27B model?

Yes, with Ternary Bonsai 2 27B, which is Qwen3.8-27B rebuilt with ternary weights. After a 4,061-token prompt on an M5 Max it peaked at 11.4 GB of memory, against 23.9 GB for the 4-bit Qwen 3.8 27B. MTPLX 2.12.0 suggests it first on M3, M4 and M5 Macs with 16 to 31 GB, and Prism ML reports that it keeps 98.2 percent of the full model's benchmark average.

How fast is Bonsai 2 27B on a Mac?

On a MacBook Pro M5 Max with 128 GB, MTPLX 2.12.0 runs Ternary Bonsai 2 27B at 64.4 tok/s after a 4,061-token prompt and 57.1 tok/s after a 16,350-token prompt, at temperature 1.0, top-p 0.95 and top-k 20 with thinking off and 512-token answers. The 4-bit Qwen 3.8 27B ran 52.6 and 51.0 tok/s in the same session. Prism ML's announcement gives 46.8 tok/s on an Apple M5 Max with MLX and does not state a context length.

How do I run Bonsai 2 27B on a Mac?

Download the MTPLX Mac app at mtplx.com/download and pick "Bonsai 2 27B Optimized Speed". From the command line, run pip install mtplx or brew install youssofal/mtplx/mtplx, then mtplx serve --model Youssofal/Ternary-Bonsai-2-27B-MTPLX-Optimized-Speed. Both routes need MTPLX 2.12.0 or later.

Does Bonsai 2 27B read images on a Mac?

Yes. The MTPLX pack carries Prism ML's vision tower unchanged next to the language model, and MTPLX refuses a Bonsai pack whose vision tower is missing. The 16 GB memory figures on this page were measured with the vision tower loaded.

Does speculative decoding change Bonsai 2 27B's output?

No. Drafts are accepted with the probability-ratio rule plus residual resampling, so the output follows the model's own distribution at any temperature. MTPLX's ternary decode kernel is as close to Prism ML's own float32 reference as the stock kernel (mean KL 2.92e-6 against 3.02e-6 over 1,630 positions of code, prose and reasoning), and greedy output is identical with the kernels on and off.

Credit. Created using Bonsai by Prism ML. The pack is Apache 2.0 and carries Prism ML's LICENSE and NOTICE.txt. Base model: prism-ml/Ternary-Bonsai-2-27B-mlx-2bit, built from Qwen/Qwen3.8-27B.