Downloads · 30 days
28
10% of all-time downloads
rahulrachuri/ternary-bonsai-2-27b-coreai
ternary-bonsai-2-27b-coreai is a text generation model from rahulrachuri. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A Core AI export of Bonsai 2 27B, PrismML's ternary build of Qwen3.8-27B. The bundle runs on an Apple silicon Mac through the native bonsai-swift host with no Python in the generation loop.
Downloads · 30 days
28
10% of all-time downloads
All-time downloads
285
Public
Repo size
14.5 GB
Likes
0
Public
Click a slice to open those files.
.bin7.3 GB · 50%
From the Hugging Face model README
A Core AI export of Bonsai 2 27B,
PrismML's ternary build of Qwen3.8-27B. The bundle runs on an Apple silicon Mac through the native
bonsai-swift host with no Python in the generation
loop.
The repository contains:
.aimodel with 64-token and 16-token prefill functions plus single-token
decode;h16s ahead-of-time compile for the M4 Pro;SHA256SUMS.bonsai-swiftThe published measurements used an M4 Pro, macOS 27.0 build 26A428, Xcode 27.0 build
27A5237l, and Apple Swift 6.4. The included h16s asset is specific to the M4 Pro. Other Apple
silicon architectures require an AOT compile produced from the portable .aimodel.
hf download rahulrachuri/ternary-bonsai-2-27b-coreai \
--local-dir bonsai2_27b_decode_pq2_0_pf64
git clone https://github.com/RahulRachuri/bonsai-swift.git
cd bonsai-swift
swift build -c release
export BONSAI_BUNDLE="$PWD/../bonsai2_27b_decode_pq2_0_pf64"
.build/release/bonsai-swift chat --prompt "The capital of France is" --new 64
The host does not download model artifacts implicitly. Applications must provide the bundle path
through --bundle or BONSAI_BUNDLE.
main input_ids [1,1] position_ids [1,?] -> logits [1,1,V]
prefill input_ids [1,64] position_ids [1,?] -> logits [1,64,V]
prefill16 input_ids [1,16] position_ids [1,?] -> logits [1,16,V]
states keyCache, valueCache, convState, recState
The exported context limit is 4,096 tokens. The host allocates a KV capacity between the traced minimum of 2,048 and that limit. Generation is greedy.
The bundle was teacher-forced against greedy reference decodes from PrismML's MLX runtime. The host uses the same 64-token, 16-token, and single-token planner for validation and generation.
| reference prompt | prefill | argmax positions | continuation |
|---|---|---|---|
| "The capital of France is", 24 new | 16+16+16, 9 walked | 77/80 | 24/24 identical |
| train-time arithmetic, 48 new | 64+16, 3 walked | 127/130 | 48/48 identical |
| lighthouse passage, 40 new | 64+16+16+16, 13 walked | 161/164 | 40/40 identical |
| lighthouse passage, S=1 prompt walk | walk | 161/164 | 40/40 identical |
The three position mismatches occur inside the chat template's system prompt where the MLX reference has fp16-scale top-two margins of 0.002 to 0.024. Graph-provided and host-computed argmax agreed on all 134 walked fixture steps.
A separate ten-prompt battery covered 4,405 positions across prose, code, numbers, newlines, CJK, mixed scripts, emoji, and repeated-token stress cases. Chunked prefill and an S=1 walk agreed at 4,347 positions and produced 80/80 identical continuation tokens. Each case ran in a fresh process; resident memory remained near 7.5 GB without additional swap growth.
M4 Pro, release build, Python-free generation loop:
| workload | result |
|---|---|
| decode | 23.6 tok/s |
| 114-token prompt, end to end | 48 tok/s |
| S=64 prefill chunk | 59 tok/s |
| S=1 prompt walk | 23.6 tok/s |
prism-ml/Ternary-Bonsai-2-27B-gguf, revision
6ed5e12bf84b7a63069882c91dd9e9218647d17b, file
Ternary-Bonsai-2-27B-PQ2_0.ggufQwen/Qwen3.8-27B, revision
1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0coreai-core 1.0.0b2coreai-build-3600.82.1c9e9e6bThe conversion and validation source is maintained in the
community Core AI model zoo. The portable graph
was exported on 2026-09-18. The full file manifest is recorded in SHA256SUMS.
bonsai-swift is greedy.Apache License 2.0. The converted artifact inherits the Apache-2.0 terms of the PrismML and Qwen
sources. See NOTICE for attribution. Created using Bonsai by Prism ML.