Downloads · 30 days
2.8K
25% of all-time downloads
nathansutton/Qwen3.8-27B-Ternary-Bonsai-2-DFlash2-MLX
Qwen3.8-27B-Ternary-Bonsai-2-DFlash2-MLX is a text generation model from nathansutton. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
Prism ML's ternary Ternary-Bonsai-2-27B build of Qwen/Qwen3.8-27B, repacked for chad, a Claude-Code-style local coding agent for Apple Silicon, with its speculative decoder bundled in. This is chad's default model.
Downloads · 30 days
2.8K
25% of all-time downloads
All-time downloads
11.2K
Public
Parameters
26.9B
8.8 GB on disk
Likes
11
Public
Click a slice to open those files.
.safetensors8.8 GB · 100%
How the weights are stored.
U3226.9B · 100%
From the Hugging Face model README
Prism ML's ternary Ternary-Bonsai-2-27B
build of Qwen/Qwen3.8-27B, repacked for
chad, a Claude-Code-style local coding agent for
Apple Silicon, with its speculative decoder bundled in. This is chad's default model.
Created using Bonsai by Prism ML.
One download gets both halves: the ternary target model and the block drafter it decodes with, already quantized. Nothing is built on first run.
Every projection of Qwen3.8-27B (a dense qwen3_5 hybrid: 64 layers, 48 GatedDeltaNet +
16 full attention) is stored in a Hadamard-rotated basis: multiplied by a fixed sign
vector and put through a blockwise Walsh-Hadamard transform offline, then quantized to
2-bit affine group-128 whose three levels reproduce the ternary set {−s, 0, +s}. The
rotation costs no extra bits and no extra weight traffic, but the matching transform must be
applied to the activations at runtime and inverted after the embedding lookup. An
ordinary MLX affine loader finds tensors of exactly the right shapes, skips both transforms,
and produces plausible garbage without raising. chad routes the pack on its model_type
(prism_hadamard_qwen35) to a loader that does the rotation; mlx-lm alone will not run it
correctly.
config.json says so
(components.vision: false). The language-model tensors, sign vectors and
hadamard.json are byte-identical to the source revision recorded in the safetensors
header (source_revision).tokenizer.json has the
same vocabulary and added tokens but different merges and pre-tokenizer, which trips
transformers' regex warning on every load and diverges on combining marks. This repo
ships the base tokenizer, and the chat template with reasoning_effort defaulting to
medium (the pack's says xhigh; upstream Qwen's says xhigh). Pass
reasoning_effort explicitly to override it.config.json carries the base checkpoint's transformers_version. Without it,
transformers' Mistral-regex heuristic treats any checkpoint as a legacy Mistral
tokenizer and warns on every load that tokenization is wrong; the key is what the base
Qwen3.8-27B config carries, and the tokenizer files here are that checkpoint's.sys.path.insert; chad
reimplements the forward and does not import code out of a model download.dflash/: the DFlash2 block drafter, identical to the one bundled with
nathansutton/Qwen3.8-27B-UD-Q3_K_XL-DFlash2-MLX.dflash/)A 1.9B model that reads the target's residual stream at five tapped layers and proposes a whole block of tokens in one forward, quantized to 4-bit group-64 in MLX format. A drafter reads the residual stream, which the weight quantization only perturbs, so the drafter trained against the bf16 base transfers to the ternary target unchanged. chad verifies the block in one batched target forward and accepts by exact rejection sampling, so greedy output is token-identical to unspeculated decoding (to kernel rounding) and sampled output keeps the model's true distribution at any temperature.
It is deliberately in a subdirectory: mlx-lm globs model*.safetensors at the repo root,
so dflash/model.safetensors is invisible to the base loader.
The drafter weights are converted from the DFlash2 release for this model
(z-lab/Qwen3.8-27B-DFlash2); the
method is Chen et al., DFlash: Block Diffusion for Flash Speculative Decoding
(arXiv:2602.06036). Only the quantization and the MLX layout are ours; please honor the
original release's license and citation terms.
uvx chad-code # this is the default model; first run downloads it (~8 GB)
Apache-2.0. The ternary weights are copyright Prism ML, Inc., built from Qwen3.8-27B
(copyright Alibaba Cloud, Apache-2.0); LICENSE and NOTICE.txt are the pack's own.
Created using Bonsai by Prism ML.