license: apache-2.0
library_name: mlx
pipeline_tag: image-text-to-text
base_model:
- prism-ml/Ternary-Bonsai-2.5-27B-mlx-2bit
- AtomicChat/Ternary-Bonsai-2.5-27B-Uncensored-GGUF
tags: - mlx
- apple-silicon
- 2-bit
- ternary
- bonsai
- prismml
- qwen3.8
- uncensored
- abliterated
- vision
Ternary Bonsai 2.5 27B Uncensored MLX 2-bit
This is PrismML's official MLX pack of Ternary Bonsai 2.5 27B with the uncensored edit from AtomicChat's
Ternary-Bonsai-2.5-27B-Uncensored-GGUF.
The language weights are the same as in AtomicChat's PTQ1_0 file. The vision tower, MTP draft head, tokenizer, chat
template and loader are unchanged from the
official pack.
Sibling: barozp/Ternary-Bonsai-2.5-27B-Uncensored-MTPLX-2bit
holds the same weights laid out for MTPLX, with Prism ML's draft head wired
up for speculative decoding.
Uncensored. AtomicChat removed the model's refusal direction. It will answer requests the original Ternary
Bonsai 2.5 27B refuses. Use it responsibly and in line with your local laws and the license. No content filter is
applied beyond what is in the weights.
How it was made
AtomicChat removed a refusal direction from the residual stream. They projected it out of the 36 matrices that write
into the residual stream in layers 27–44 (ffn_down, ssm_out, attn_output) and stored the result back in the
ternary codes. The model stays exactly ternary. According to AtomicChat, 12,461,746 codes changed, every FP16 block
scale stayed the same, and every other byte matches PrismML's PTQ1_0 file.
PrismML exported its MLX pack from the same ternary weights. Its runtime/codec.py describes a lossless mapping from
PTQ1_0 blocks to MLX affine 2-bit, group-128 tensors: the scale is the block scale and the bias is minus the scale.
This pack uses that mapping. The 36 changed matrices were downloaded from AtomicChat's GGUF, converted, and written
over the same weight tensors in the official model.safetensors. No other tensor was touched.
build_uncensored.py in this repository rebuilds the pack from the pinned source revisions listed inuncensored-provenance.json.
Checks made during the build
- The official pack's files matched the sha256 values in its
files.json. - In all 36 matrices, AtomicChat's FP16 scales were bit-identical to the official MLX scales, the biases were minus
the scales, and every code was ternary. - The number of changed codes was exactly 12,461,746, matching AtomicChat's report.
- The new
model.safetensorsmatches the official file byte for byte outside the 36weighttensors, and its
safetensors header did not change. The codes inside those tensors match AtomicChat's codes.
Results reported by AtomicChat (not re-measured here)
| Official | Uncensored | |
|---|---|---|
| Refusals on 24 held-out harmful prompts | 24/24 | 0/24 |
| Refusals on 24 ordinary prompts | 0/24 | 0/24 |
| MMLU, 500 questions | 401 (80.2%) | 406 (81.2%) |
The MMLU difference is not significant (exact McNemar p = 0.30). The refusal screen uses English prompts, a 48-token
answer budget and a prefix classifier. Long-context behaviour and tool calling were not evaluated.
Run
The weights need the bundled Hadamard-aware loader, so mlx_lm.load() and stock mlx-vlm loaders cannot open this
pack. Install the pinned runtime and run from the pack directory:
hf download barozp/Ternary-Bonsai-2.5-27B-Uncensored-MLX-2bit --local-dir ./bonsai-25-uncensored-mlx
cd ./bonsai-25-uncensored-mlx
python -m pip install -r runtime/requirements.txt
python quickstart.py "What is 2 plus 2?"
From Python, load_vl_model in runtime/vision_artifact.py returns the model and processor for mlx-vlm'sgenerate, and load_mtp_head in runtime/mtp_artifact.py loads the optional MTP draft head. The official pack's
README has the full image and MTP examples; they work unchanged here.
The language weights take 7.67 GB and the FP16 vision tower 0.92 GB. The KV cache takes 64 KB per token, because 16
of the 64 layers use full attention. PrismML measured the official MLX pack, which has the same size and layout, at
21.7 tokens/s decode and 348 tokens/s prefill (512-token prompt) on an Apple M5 Pro.
License
Apache 2.0, like both sources. See NOTICE.txt. Created using Bonsai by Prism ML; built from Qwen3.8-27B by Alibaba
Cloud; uncensored edit by AtomicChat.