
Swift Bonsai 2 27B — MLX pack
Swift Bonsai 2 is UkisAI's reasoning-efficient derivative of Prism ML's Ternary Bonsai 2 27B. This pack repackages the Swift trunk as a text-only MLX build for Apple Silicon; a small patched Prism loader ships at runtime/.
This is a local community build, not an official ukisai or Prism ML release. For speculative decoding via the Qwen3.8 MTP head see EngineeringWithJay/Swift-Bonsai-2-MTPLX.
What is inside
model.safetensors— Swift trunk, PQ2_0-family ternary 2-bit, re-encoded into MLX affine 2-bit. SHA256f82bb8b5971c7cc6860d84a27eead799444ed8d01a756964b57faeef730c1a0a.runtime/— patched Prism loader and encoder (ternary PQ2_0/PTQ1_0 → MLX affine 2-bit; seeruntime/requirements.txt).reload-validation.json— greedy logits vs ukisai GGUF (max abs diff 0.0), argmax identical, PONG identical.- No MTP sidecar.
Architecture
| Field | Value |
|---|---|
| Backbone | Qwen3.8-27B (GQA, head_dim 256, 24 Q heads, 4 KV heads) |
| Trunk | Ternary weights (one scale per signed 128-block), hadamard-signed 2-bit |
| Attention | Hybrid Gated DeltaNet linear attention + full attention every 4th layer |
| Hidden | 5,120 |
| Layers | 64 |
| Context | 262,144 native |
Performance
Swift's own benchmark suite is upstream; this pack does not re-measure. From ukisai's published results, vs base Ternary Bonsai 2: GPQA-Diamond 84.34% (vs 84.18%), C-Eval 81.47% (vs 81.37%), IFBench 82.60% (vs 82.13%), AIME 2025 93.33% (vs 92.00%). Greedy decoding equivalence to the ukisai GGUF source is verified (reload-validation.json); text quality is preserved bit-exact.
How to use
MLX does not load this pack directly; the prism_hadamard_qwen35 model type needs the bundled patched loader.
import sys
from pathlib import Path
sys.path.insert(0, str(Path("runtime").resolve()))
from artifact import load_model
model = load_model(Path(".").resolve())
# ... then drive generation from the runtime module
Sampling (ukisai's Swift settings): temperature 1.0, top-p 0.95, top-k 20, min-p 0.0. Do not add repetition penalties.
Memory
~7.2 GB weights on disk. KV cache grows with context; keep ≲ 16K ctx on a 16 GB host (use 96K only on 24+ GB unified memory).
Limitations
- Experimental research release. Swift is uneven on instruction following, tool use, and open-ended coding.
- Not valid for stock
mlx_lmpaths — needs the patched loader inruntime/. - MLX pack is text-only; no vision, no MTP. Reconstruction artifacts aside from ukisai's GGUF source are not distributed here.
License & attribution
Apache-2.0. Created using Bonsai by Prism ML. Swift weights by UkisAI. See NOTICE.txt and LICENSE.
Citation
@misc{swift-bonsai-2-mlx,
title = {Swift Bonsai 2 27B — MLX pack},
author = {EngineeringWithJay},
year = {2026},
url = {https://huggingface.co/EngineeringWithJay/Swift-Bonsai-2-MLX}
}