← back to catalog · indexed 2026-10-09 17:58

3hs4n/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit-compact

3hs4n 27B multimodal second-order
Your rig guess connected
? Why do I need an app?
Reading your rig…

This is a rough estimate. Install the free app - it measures what fits your machine.

Reading your computer's memory from the app right now. The fit below is measured on this machine.

Below is the per-quantization compatibility for this model.

curl -H "Authorization: Bearer $ABL_KEY" \
     "https://abliteration.org/api/v1/models/3hs4n%2FTernary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit-compact"
Response includes
  • classification m3
  • files 25
  • author_summary 7 models
  • readme_text full
10 credits · hourly refresh · ~4 KB payload Get an API key →
Abliteration classifier · v1.0.0
M3
Primary method

Layer-wise ablation

Applied on top of direct removal inherited from the base model.
Confidence
HIGH
Inherited from base model
Why this label 2 signals
Producer identity confirmed by naming conventions, tags or the model card. This label is very unlikely to change.
  • 'heretic' in model name (Heretic-produced)
  • Heretic uses layer-wise optimization (M3) with underlying direction removal (M1)
Refusal direction extracted via
Extraction technique

Difference-of-means

Confidence
HIGH
Why we say so
name contains 'heretic'; Heretic default extraction is difference-of-means (Arditi 2024)
Downloads · lifetime
4K
2K last 30d - stable
Likes
2
Descendants
2
in 2 direct forks
Model age
6w ago
created 2026-10-09
Downloads over time
Now 3.9K → from 0 new
01.4K2.9K4.3K 0 on Oct 9 3.9K on Nov 25 OctNov
Oct 9 → Nov 25 · 48 snapshots · spans 47 days

Genealogy 2 direct forks

Full fork graph →

This model's place in the market. Above: what it was derived from. Below: the tree of everything derived from it.

Metadata

License
apache-2.0
Tags
mlx safetensors prism_hadamard_qwen35 mlx-vlm ternary 2-bit bonsai heretic uncensored conversational reasoning thinking

Related

Total size
7.84 GB
Files
25
Quantizations
none
Indexed by us
2026-10-09 17:58
Last updated on HF
2026-10-25 21:04

Files by quantization

Weights 1 file 7.83 GB
model.safetensors 7.83 GB d667a865 download
Auxiliary files 24 files 12.6 MB
tokenizer.json 12.2 MB 0997f410 download
hadamard.json 235 KB d58ba5cd download
config.json 56.8 KB dd11e6b1 download
README.md 22.0 KB 680415a6 download
serve.py 17.2 KB bfe4cddd download
requirements-py311-macos26.lock 17.1 KB c8cc7432 download
tokenizer_config.json 16.0 KB 16503190 download
validate_heretic_compact.py 15.5 KB dd030b4d download
make_heretic_compact.py 12.1 KB e9891850 download
LICENSE 9.94 KB 66a27ec5 download
chat_template.jinja 8.74 KB c0c686f9 download
compact-conversion.json 8.48 KB b3d6b38f download
heretic_fused_projections.py 6.00 KB e3e1d079 download
SHA256SUMS 4.61 KB 38c28bf0 download
reproduce.md 2.34 KB 93828b4e download
NOTICE.txt 1.70 KB 1e92d71c download
lmstudio-model.yaml 1.50 KB 6d9f1972 download
preprocessor_config.json 390 B 2ea84a43 download
video_preprocessor_config.json 385 B 3ba673a5 download
generation_config.json 221 B 36a5c010 download
.gitattributes 101 B 0fd17d2f download
requirements.txt 86.0 B f9e0a145 download
requirements-legacy.txt 85.0 B 2c1f9431 download
.gitignore 65.0 B 1f643f43 download

README latest version on record, committed 2026-10-25


license: apache-2.0
library_name: mlx
pipeline_tag: image-text-to-text
base_model:

  • 3hs4n/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit
    tags:
  • mlx
  • mlx-vlm
  • ternary
  • 2-bit
  • bonsai
  • heretic
  • uncensored
  • conversational
  • reasoning
  • thinking
  • vision
  • image-text-to-text
  • tool-calling
  • apple-silicon

Ternary Bonsai 2 27B Uncensored Heretic v2: Compact MLX 2-bit

A smaller native MLX variant of the original Heretic v2 MLX pack. All 2,057 language tensors are copied byte for byte. The size reduction comes from quantizing 22 of the 27 vision MLP expansion layers (linear_fc1) from FP16 to native MLX affine 2-bit/group-128 storage. A per-layer sensitivity sweep (evidence/vision-layer-sensitivity.json) identified the five blocks whose expansion layer matters most — 0, 1, 2, 20 and 26 — and those keep their FP16 linear_fc1, copied byte for byte. Vision attention, MLP contraction layers, the merger, positional embeddings and all other vision tensors remain unchanged.

The compact weights occupy 8,408,001,336 bytes, approximately 8.41 GB (7.83 GiB). This saves 187,477,056 bytes, approximately 187 MB or 2.18%, compared with the original weight file. Configuration and tokenizer files add a small amount to the complete download.

Vision quantization is lossy. Image understanding, screenshots and OCR can change. Use the original pack with its FP16 vision tower when preserving that vision representation matters. The language checkpoint, thinking template and tool-call format are retained.

Measured vision-feature fidelity versus the original FP16 tower on 14 images (13 public fixtures plus one chart): mean token cosine similarity 0.977 (revision 1: 0.959), worst per-token cosine 0.709 (was 0.584), mean relative L2 0.280 (was 0.442). All 20 fixture answers were unaffected, but the feature distance is real — prefer the original pack for OCR, screenshots and detail-heavy images. See evidence/vision-fidelity.json.

What changes

Item Original MLX pack Compact MLX pack
Weight file 8.60 GB 8.41 GB
Language tensors Native affine 2-bit/group-128 Identical tensors
Vision linear layers FP16 22 of 27 MLP expansion layers use native affine 2-bit/group-128; blocks 0, 1, 2, 20 and 26 stay FP16
Remaining vision tensors Original precision Identical tensors
Architecture prism_hadamard_qwen35, schema 2 Same architecture
Thinking and tool calling Supported by the language model and template Retained
Configured context limit 262,144 tokens Same limit; full-length operation was not tested

This is a real change to native inference weights, rather than a compressed download archive. A compatible runtime keeps the quantized vision weights packed, reducing the weight allocation as well as disk usage. Total RAM still includes the context cache, image activations, temporary buffers and the runtime. The weight-file size is not a minimum system-memory requirement, and the file-size saving is not a promise of an identical reduction in peak process memory.

This is not a PTQ1_0 MLX format. PQ2_0 and PTQ1_0 are GGUF packing formats. Both source conversions produced the same original MLX language weights. This compact variant gains space by changing vision precision, while retaining native MLX 2-bit language storage.

RAM requirements

The Original and Compact variants have the same suggested unified-memory tiers.

Mac RAM Guidance
8 GB Not practical for either variant
16 GB Estimated practical minimum: short text chats, small context, few other apps open
24 GB+ Recommended: more headroom for images, tools and longer conversations

These are estimates, not verified minimums. Both variants were tested on a Mac with 64 GiB unified memory; 16 GB and 24 GB configurations were not tested. Actual memory use depends on context length, image resolution, temporary buffers and other running apps. Very long contexts can require substantially more memory. These recommendations do not guarantee that the full configured 262,144-token context will fit.

Compact saves about 187 MB in stored and loaded weights, which does not change the suggested RAM tier.

LM Studio and thinking

Open the published LM Studio catalog, click Use Model in LM Studio, then choose Compact or the original pack in Download Options. Both options were verified in LM Studio 0.4.26+4. The catalog declares Thinking, Vision and Tool Use and provides a working Enable Thinking on/off control. The portable catalog definition is included for reference.

With the LM Studio CLI installed, you can also select a variant with:

lms get ehs4n/ternary-bonsai-2-27b-uncensored-heretic-v2-mlx --select

LM Studio 0.4.26 global search combines Hugging Face results with Staff Picks and does not index every personal Hub entry. Use the catalog link or CLI command above to reach this entry. A raw Hugging Face repository still offers one native MLX download and displays only Vision and Tool Use badges in that view; the missing Thinking badge is a display limitation. The catalog is under LM Studio account ehs4n, while both weight repositories remain under Hugging Face account 3hs4n. Keep the virtual catalog definition separate from the concrete weight folder.

Use LM Studio on Apple Silicon with an MLX runtime that supports native prism_hadamard_qwen35 schema 2 and its Hadamard transforms. A generic MLX loader that omits the transforms can produce incorrect output.

This remains a thinking model. The language tensors and thinking chat template are unchanged. A model can generate thinking tokens even when a model browser does not display a Thinking badge. LM Studio's capability badges and download-option grouping depend on its own model catalog and runtime metadata; the Hugging Face thinking and reasoning tags do not guarantee either UI behavior.

For Python serving, thinking can be enabled with the command below and selected per request with enable_thinking. The short CLI example deliberately uses the native CLI default of thinking disabled. Reasoning quality has not been benchmarked for this compact release.

A Compact pack loaded successfully in LM Studio 0.4.26+4 with its installed native MLX backend. Catalog thinking on/off, an OpenAI native tool call, a mock-result tool round trip, and OCR of the public 32-pixel-font fixture all passed. The check was first run on revision 1 weights (evidence) and re-run against revision 2 (evidence).

Unsloth Studio

Reported to work well in Unsloth Studio on Apple Silicon. This note is based on user feedback.

Run with Python

Use native mlx-vlm 0.7.10 with MLX 0.32.4. The tested runtime profile is CPython 3.11.15 on macOS 27.0.1 (the locked wheels require macOS 26 or newer); Transformers 5.14.1, NumPy 2.4.6 and huggingface-hub 1.33.0 remain unchanged. Keep the weight, configuration, tokenizer, processor and hadamard.json files together. The repository is intended for Apple Silicon Macs with sufficient unified memory and a macOS/Python build compatible with the runtime. It does not require a particular Mac model or machine-specific port.

Create an environment, install the included dependencies and download the complete repository:

python3.11 -m venv .venv-heretic
source .venv-heretic/bin/activate
python -m pip install huggingface-hub==1.33.0
hf download 3hs4n/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit-compact \
  --local-dir bonsai-heretic-mlx-compact
cd bonsai-heretic-mlx-compact
python -m pip install -r requirements.txt
python -m mlx_vlm.generate \
  --model . \
  --prompt "What is the capital of France? Answer with only the city name." \
  --max-tokens 64 \
  --temperature 0

The primary requirements pin the compatible runtime. The current pins are:

mlx==0.32.4
mlx-vlm==0.7.10
transformers==5.14.1
numpy==2.4.6
huggingface-hub==1.33.0

For an OpenAI-compatible API with a fixed public model ID:

python serve.py \
  --model . \
  --model-id Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit-compact \
  --host 127.0.0.1 \
  --enable-thinking

The default API address is http://127.0.0.1:8080/v1. Use --port to choose another free port if needed. Read /v1/models to obtain the public model ID. The helper uses the native mlx-vlm inference engine; LM Studio uses its own engine and does not need this Python server.

Tested runtime profiles and performance

This update keeps the same revision 2 weight file. Both the previous profile (MLX 0.32.2 / mlx-vlm 0.7.2) and the current profile (MLX 0.32.4 / mlx-vlm 0.7.10) passed 20/20 fixed synthetic checks, with 20/20 answers identical, including text, thinking, a mock tool round trip, vision and OCR. Both used CPython 3.11.15, Transformers 5.14.1, NumPy 2.4.6 and huggingface-hub 1.33.0. These are targeted regression checks, not a general accuracy percentage. Verification evidence

Fixed 20-case suite Previous profile Current profile
Passed 20/20 20/20
Validation wall time 84.98 s 73.61 s
Process lifetime physical-footprint peak 12.555 GiB 12.548 GiB
Maximum per-case MLX allocator peak 10.688 GiB 10.688 GiB

The validation totals are single observations and include setup; the previous-profile total also includes an additional weight-checksum pass. They do not establish a speedup. Process footprint and MLX allocator peaks overlap; do not add them. All measurements here used an Apple M1 Max with 64 GiB unified memory on macOS 27.0.1.

Upgrading alone did not establish a reliable speed gain. The longer old/new speed probes ran under changing thermal and background-load conditions, and one interrupted arm was repeated after power returned. Their per-workload timings, memory, output parity and limitations are in the benchmark evidence.

A separate within-model comparison on the current profile alternated plain and shared projections in ABBA / BAAB order, with four timed samples per mode for each workload after warmup:

Probe Plain Shared rotations Observed change
Code 18.84 tokens/s 19.37 tokens/s +2.8%
Math 18.52 tokens/s 18.96 tokens/s +2.4%

All 10 matched pairs (20 generations total) across code and math had identical token IDs and output hashes. Rates measure effective streamed tokens after the first token through stream completion, including final synchronization; the capped-output summary duplicate is removed. This small two-workload result is hardware- and profile-specific. Crossover evidence

To try the shared-rotation option, add --fused-projections shared to serve.py. The default remains off. The included helper shares one Hadamard rotation across sibling language projections; it leaves the vision tower unchanged. Separate kernel checks verified bit-identical shared logits. The fused option also concatenates quantized matmuls, changes logits slightly, and used more peak memory in the recorded probes; it remains experimental. The older +1.2% shared / +4% fused figures describe the previous runtime and should not be applied to the current profile.

The primary requirements.txt pins the current profile. The previous profile is preserved in requirements-legacy.txt for comparison or rollback. For a fully resolved CPython 3.11 Apple Silicon installation, the optional hash-locked profile pins 73 public wheels, requiring macOS 26 or newer:

python3.11 -m venv .venv-heretic-locked
.venv-heretic-locked/bin/python -m pip install \
  --require-hashes -r requirements-py311-macos26.lock

The clean current environment took 54.62 s to prepare, including 33.86 s for installation, and occupied 1.02 GB in this test. That is runtime-environment storage, separate from the model download.

Prefix caching

serve.py enables mlx-vlm's automatic prefix cache by default (--prefix-cache on). Chat turns and tool-loop steps that share a prefix reuse its KV instead of re-prefilling. The documented profile uses memory-only caching with APC_DISK_ENABLED=0. This is a default: a caller's pre-existing APC_DISK_ENABLED value is respected, like the other user-set APC_* settings. The resident budget defaults to 10% of physical RAM clamped to 1–4 GiB (--prefix-cache-gb); an explicit value or any user-set APC_* environment variable wins. On this hybrid model, full-attention KV is restored pageable per block and the GDN recurrent state is replayed from checkpoints. Greedy correctness checks were byte-identical across a multi-turn text chat, a tool round trip, an image conversation and a thinking case — see evidence/prefix-cache-verification.json. Historical measurements on the previous runtime, on an Apple M1 Max under heavy background load with a ~4.2k-token conversation: turn-2 time-to-first-token dropped from 85.4 s to 1.8 s and turn-3 from 87.9 s to 2.2 s. --prefix-cache off disables it.

The refreshed profiles also passed 22/22 HTTP checks each, including expected HTTP 400 rejection checks and cache/privacy plumbing: text, bounded thinking, image OCR, a native tool call and mock round trip, streaming, fixed model selection, metadata privacy and cache handling. The long synthetic prefix contained 7,822 prompt tokens. On the current profile, the same turn-two request took 1.38 s cached versus 99.19 s after resetting the cache, with identical output. These are total request times from one pair, not first-token latencies or a general speed ratio. Peak process physical footprint for the longer API sequence was 16.66 GiB previous / 16.67 GiB current, with a 4 GiB memory-only cache budget. HTTP verification

For a short request, run this in another terminal:

import json
from urllib.request import Request, urlopen

base = "http://127.0.0.1:8080/v1"
with urlopen(base + "/models") as response:
    model_id = json.load(response)["data"][0]["id"]
payload = {
    "model": model_id,
    "messages": [{"role": "user", "content": "Explain ternary model weights briefly."}],
    "max_tokens": 256,
    "temperature": 0.7,
    "enable_thinking": False,
    "stream": False,
}
request = Request(
    base + "/chat/completions",
    data=json.dumps(payload).encode(),
    headers={"Content-Type": "application/json"},
)
with urlopen(request) as response:
    result = json.load(response)
print(result["choices"][0]["message"]["content"])

Image requests use OpenAI image_url content parts. Tool requests use an OpenAI tools array; your application executes a returned function and sends its result as a tool message with the matching tool_call_id.

Recommended sampling

Following Prism ML's Bonsai 2 27B best practices:

Mode temperature top_p top_k min_p presence_penalty
Thinking enabled 1.0 0.95 20 0.05 0.0
Thinking disabled 0.7 0.80 20 0.0 1.5

The included serve.py applies min_p 0.05 when a request omits min_p — native mlx-vlm otherwise defaults it to 0.0. An explicitly supplied min_p, including 0.0, is always respected, and --default-min-p 0 disables the default entirely. The LM Studio catalog sets the same sampling values in the app.

Conversion and verification

The source is the original Heretic v2 MLX release at revision 866836d7b57012fa964aee462e60bf053e67084d. Its language weights originate from OS-Software's Heretic v2 GGUF release, and its vision tower originates from Prism ML's Bonsai 2 MLX pack.

File SHA256
Source model.safetensors e56ba66424066818c7c89f0f1ba74111705b9062367905228736013a48aaf08d
Compact model.safetensors d667a865dd15a1f926c2495c751fbe6e16ee6e372fc61eb59c439445c97da8fb

The compact file contains 2,434 tensors. The 22 quantized vision layers add scale and bias tensors, and the five FP16-kept expansion layers add none, accounting for the increase from the original 2,390 tensors. All 2,057 language tensors matched the source byte for byte, and 2,368 tensors in total were copied unchanged. See reproduction instructions, the included conversion/evaluation scripts, and compact-conversion.json for the pinned source, quantization method and per-layer error measurements.

On 2026-10-09, the original and conservative Compact packs each passed all 20 targeted synthetic checks: text, two bounded thinking cases, a native weather tool call and mock-result round trip, colors, spatial questions, counting, five OCR font sizes, and a bar chart. Their generated answers were identical on these fixtures. On 2026-10-14 the revision 2 weights also passed all 20, with answers identical to the original pack. On revision 2, the loaded parameter allocation decreased from 8,595,174,880 to 8,407,692,640 bytes, saving 187,482,240 bytes (2.18%). MLX active allocations after clearing the cache were 8,414,706,152 bytes for Compact. These counters exclude Python/process RSS and cached buffers; they are not total RAM requirements. See the comparison, baseline evaluation, Compact evaluation and independent tensor equivalence.

A more aggressive 83-layer vision prototype regressed on one OCR fixture and was not selected for publication. The published variant quantizes only MLP expansion layers: 22 of the 27, with the five most sensitive blocks kept FP16.

The conversion checks establish unchanged language tensors and native quantization structure. Quantization error statistics do not establish image or OCR accuracy. Broader vision accuracy, long-context reliability and reasoning quality have not been benchmarked for this compact release. Functional evidence for the original pack is available in its model card; those results should not be treated as measurements of this quantized vision tower.

Portable metadata

Published configuration and conversion metadata use public repository IDs, pinned revisions, file basenames and hashes. Personal model paths, credentials, machine logs and local caches are excluded. No machine-specific launch tuning is prescribed.

The included serve.py exposes a fixed model ID and limits model discovery and selection. It replaces known model, home and working-directory paths in runtime metadata, response headers and error responses. Local filesystem paths are still required internally by the loader. This handling does not remove private content supplied in user prompts, generated answers or tool results, and it does not control LM Studio's own logs or API behavior.

Intended use, credits and license

OS-Software describes Heretic v2 as a decensored derivative with an OT-Ridge LoRA merged into the ternary language weights. Its publisher recommends research and experimentation and advises against public end-user service deployment. The compact conversion does not change the source language weights or restore safety alignment. Outputs can be inaccurate, biased, offensive or harmful; the word "uncensored" does not establish universal refusal-free behavior.

  • OS-Software: Heretic v2 language-weight modification and source GGUF publication.
  • Prism ML: Bonsai 2 ternary model, Hadamard-aware representation, original MLX vision pack and compatible runtime work. Created using Bonsai by Prism ML.
  • Qwen / Alibaba Cloud: underlying Qwen lineage, identified by the retained notice as Qwen3.8-27B.
  • p-e-w: Heretic, acknowledged by the source publisher.
  • Bonsai demo: conversion and runtime reference project.
  • 3hs4n: community native MLX packaging and this compact vision quantization.

Distributed under Apache 2.0. The original LICENSE and attribution in NOTICE.txt are retained. Changes for this variant are quantization of 22 of the 27 vision MLP expansion layers with the five most sensitive blocks kept FP16, matching native quantization configuration, and compact-release documentation and provenance. The original MLX release's packaging and server-helper changes are retained. Source-publisher use guidance is attributed above; redistribution terms are governed by the license.

Updates

  • 2026-10-25: validated the Python 3.11 runtime with MLX 0.32.4 / mlx-vlm 0.7.10; added current/legacy installation profiles, a 73-wheel hash lock, and correctness, API, cache and performance evidence. Each runtime passed 20/20 targeted fixture checks and 22/22 HTTP checks. Within the refreshed runtime, shared projections measured +2.4–2.8% throughput in the code and math crossover probes. Weights and licenses are unchanged; revision 2 remains in use.
  • 2026-10-14: runtime, configuration and model-card update, and a weights revision. serve.py gains the min_p default, optional fused sibling projections and memory-only automatic prefix caching (on by default); generation_config.json, lmstudio-model.yaml and this card document the recommended sampling values and a measured vision-fidelity note. Revision 2 keeps the five most sensitive vision expansion blocks FP16 for higher vision fidelity. model.safetensors SHA256 is now d667a865dd15a1f926c2495c751fbe6e16ee6e372fc61eb59c439445c97da8fb.

README history 10 versions

The author's README evolved over time. Click a version to see its content at that point.

  1. 2026-10-25 Record the October 25 runtime update in model-card history 063acec 22 KB
    Loading...
  2. 2026-10-25 Validate refreshed Compact runtime and publish measured performance a3349da 21.6 KB
    Loading...
  3. 2026-10-15 Card: describe Compact revision 2 vision quantization (22 of 27 layers) 750d3e0 17.5 KB
    Loading...
  4. 2026-10-14 Add LM Studio verification of revision 2 9979ca2 17.4 KB
    Loading...
  5. 2026-10-14 Revision 2: keep the five most sensitive vision expansion blocks FP16 (vision... 496ddac 17.3 KB
    Loading...
  6. 2026-10-14 Add min_p default, optional fused projections, sampling presets and card upda... dc37f10 15.7 KB
    Loading...
  7. 2026-10-10 Add user-reported Unsloth Studio compatibility note 472e2e2 13.6 KB
    Loading...
  8. 2026-10-10 Document estimated 16 GB minimum and recommended 24 GB RAM 96ed8e9 13.4 KB
    Loading...
  9. 2026-10-09 Link the published LM Studio catalog and variant selector 4dc8b50 12.6 KB
    Loading...
  10. 2026-10-09 Add conservative compact MLX variant with tested thinking, tools and OCR 6fe9658 11.8 KB
    Loading...
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every GGUF model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration