/ Модель

Характеристики

Контекст
262 144 токена
Лицензия
Apache 2.0
Архитектура
prism_hadamard_qwen35 · dense
Библиотека
mlx
Опубликована
9 окт 2026

Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-mlx-2bit

Изображение и текст → текст8 профессий
1 619скачиваний за 30 дней3лайкавеса обновлены14 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Мультимодальная модель Ternary Bonsai 2 27B для локальных диалогов, рассуждений и работы с изображениями и инструментами на Apple Silicon через MLX.

Ternary Bonsai 2 27B Uncensored Heretic v2 MLX 2-bit — конверсия сообщества модели OS-Software/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-GGUF для запуска на Apple Silicon с MLX. Это плотная мультимодальная архитектура семейства prism_hadamard_qwen35: она принимает текст и изображения, поддерживает диалог, рассуждения и интерфейс вызова инструментов. В репозитории находятся веса Safetensors объёмом около 8,60 ГБ; язык модели использует ternary-веса, сохранённые в формате MLX affine 2-bit/group-128, а башня зрения — FP16. Для корректной работы нужны MLX и mlx-vlm с поддержкой prism_hadamard_qwen35 и соответствующих преобразований Hadamard; конфигурацию, токенизатор, процессор и Hadamard-файлы следует использовать вместе с весами.

Модель предназначена для локальных текстовых и визуальных диалогов, ответов по изображениям, OCR-проверок, рассуждений и работы с инструментами. README рекомендует не менее 16 ГБ объединённой памяти для коротких текстовых диалогов и 24 ГБ или больше для большего запаса при работе с изображениями, инструментами и длинными беседами; полный контекст в 262 144 токена не гарантированно помещается в память. Модель создана на основе Heretic v2 — производной с пониженным уровнем защитного выравнивания. Выводы могут быть неточными, предвзятыми, оскорбительными или вредоносными; безопасность зрения всесторонне не оценивалась. Лицензия — Apache-2.0.

Сценарии применения

  • локальные диалоги с моделью на Mac с Apple Silicon
  • ответы на вопросы по изображениям
  • распознавание и разбор текста на изображениях
  • рассуждения с выводом итогового ответа
  • вызов инструментов в диалоговом сценарии

Ограничения

Для корректного вывода требуется mlx-vlm с поддержкой prism_hadamard_qwen35; обычные загрузчики, не применяющие нужные преобразования Hadamard, могут давать неверные результаты. Безопасность зрения всесторонне не оценивалась, а полный контекст в 262 144 токена может не поместиться в доступную память.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит8

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

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

Community MLX conversion of OS-Software/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-GGUF, with the unchanged vision tower from Prism ML's Bonsai 2 MLX pack. The Safetensors weights occupy 8,595,478,392 bytes, approximately 8.60 GB (8.01 GiB), including vision.

The published language weights were repacked from Heretic v2 PQ2_0 into MLX affine 2-bit/group-128 storage without additional quantization or training. This repository also documents conversion from the source model's denser PTQ1_0 packing. Both conversion paths produce native MLX 2-bit/group-128 storage; converting PTQ1_0 does not create a 1.75-bit MLX format. The original developers are credited below.

Model and format

ItemThis pack
VariantTernary Bonsai 2 27B Uncensored Heretic v2
RuntimeApple Silicon macOS, MLX and native Hadamard-aware mlx-vlm
Model typeprism_hadamard_qwen35, schema version 2
Language storageAffine 2-bit, groups of 128
VisionUnchanged FP16 vision tower reused from the Prism MLX base
Configured context limit262,144 tokens; full-length operation was not tested for this conversion
LicenseApache 2.0; see LICENSE and retained attribution in NOTICE.txt

“2-bit” describes the MLX storage format. The underlying low-bit language weights remain ternary. Metadata, group scales, biases, higher-precision state tensors, and the FP16 vision tower also take space.

Runtime requirement

Use mlx-vlm 0.7.2 with native prism_hadamard_qwen35 support. This model stores its language weights in a rotated basis. The loader must apply the matching Hadamard activation transforms and embedding lookup. Generic MLX or Transformers loaders that omit these operations can produce incorrect output. Keep config.json, hadamard.json, tokenizer and processor files together with the weights.

The model files are intended for Apple Silicon Macs (M1 or later) with sufficient unified memory and a macOS/Python build supported by the pinned runtime. They are not specific to M1 hardware. This conversion was created and tested on an Apple M1 Max with 64 GiB unified memory; other Mac models have not been tested for this release. Merely being able to run MLX is insufficient: the loader must support this model's Hadamard-aware architecture. See the MLX installation requirements and the pinned versions below. Memory use depends on context length, image resolution and workload; the weight-file size alone is not a RAM requirement.

The tested environment used Python 3.11 on Apple Silicon with:

mlx==0.32.2
mlx-vlm==0.7.2
transformers==5.14.1

Newer versions may work, but were not validated for this release. The older runtime/ helper bundled with the original Prism pack is not required by this schema 2 native pack.

RAM requirements

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

Mac RAMGuidance
8 GBNot practical for either variant
16 GBEstimated 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.

Thinking and LM Studio download options

This is a thinking model. The template supports enable_thinking, and native tests produced reasoning followed by the correct final answer. The original and Compact variant retain the same language tensors and thinking/tool-call template. Compact reduces selected vision weights and saves about 187 MB; its vision quantization is lossy.

Open the published LM Studio catalog, click Use Model in LM Studio, then choose the original or Compact 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 a virtual model.yaml separate from the concrete weight folder.

Unsloth Studio

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

Run locally

Download this repository into a directory named bonsai-heretic-mlx, including the weights and all configuration, tokenizer, processor, and Hadamard files. Change into that folder and create a Python environment:

cd bonsai-heretic-mlx
python3.11 -m venv .venv-heretic
source .venv-heretic/bin/activate
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

That short command uses the native CLI's default of thinking disabled. For serving, use the included serve.py helper:

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

The helper exposes an OpenAI-compatible API at http://127.0.0.1:8080/v1, with the fixed public model ID shown above. Read /v1/models to obtain that ID. The native server default is port 8080; use --port to choose another free port and update your client URL accordingly. The helper uses the native mlx-vlm loader and generation engine behind an HTTP boundary that translates model identity and limits model selection. Its public ID does not depend on your directory name.

The helper accepts an optional --fused-projections {off,shared,fused} flag (default off), implemented by the included heretic_fused_projections.py. Sibling projections that read the same input share an identical Hadamard rotation. shared rotates the input once per group; fused additionally runs one concatenated quantized matmul per group. Measured on an Apple M1 Max with 64 GiB under background load: shared gives bit-identical logits and about +1.2% decode; fused gives about +4% decode with the same greedy tokens and a maximum logit difference of 2.8e-5 in a 64-token test. The option patches the language model only; the vision tower is never touched.

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 cache is memory-only (APC_DISK_ENABLED=0): conversation KV is never written to disk. 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. Measured on an Apple M1 Max under heavy background load on 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.

For a short text request, run this in another terminal with Python available:

import json
from urllib.request import Request, urlopen

base = "http://127.0.0.1:8080/v1"
with urlopen(base + "/models") as response:
    models = json.load(response)["data"]
model_id = models[0]["id"]
payload = {
    "model": model_id,
    "messages": [{"role": "user", "content": "Explain ternary model weights briefly."}],
    "max_tokens": 256,
    "temperature": 0.7,
    "top_p": 0.8,
    "top_k": 20,
    "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"])

For image input, use an OpenAI image_url content part; data URLs are supported. For tool use, send an OpenAI tools array, execute the returned function in your application, and send its result back as a tool message with the matching tool_call_id. Thinking can be selected per request with enable_thinking; the sample disables it for a short answer. Model loading and image processing require additional memory beyond the weight-file size.

Recommended sampling

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

Modetemperaturetop_ptop_kmin_ppresence_penalty
Thinking enabled1.00.95200.050.0
Thinking disabled0.70.80200.01.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 provenance

Both source packings are from the same pinned source revision:

Repository: OS-Software/Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-GGUF
Revision:   6db27547a8f25667cdb43a28d15cc5d33937b7dc
Source fileSize in bytesSHA256
Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-PQ2_0.gguf7,206,168,9289ba04345402584cf7f581ff72c00ea8925a35f3d78ccd34ca3eb195fe552393c
Ternary-Bonsai-2-27B-Uncensored-Heretic-v2-PTQ1_0.gguf5,946,648,928c30f3862e4809db58366aab0b97a50e0a144dd010061d931a61c000adaf50683

PQ2_0 uses two-bit slots in GGUF, while PTQ1_0 packs ternary values more densely. The converter decodes each source packing and preserves its ternary codes and group scales when repacking into MLX affine storage. MLX codes 0, 1, and 2 represent -s, 0, and +s through scale=s and bias=-s. Hadamard signs and transforms are preserved. No additional quantization or training is applied by either conversion path.

A complete conversion from the real PTQ1_0 file reproduced all 2,057 language tensors bit for bit against the PQ2_0-derived pack. The resulting entire 2,390-tensor Safetensors file also has the same size and SHA256: e56ba66424066818c7c89f0f1ba74111705b9062367905228736013a48aaf08d. The loading configurations matched, and a native CLI check of the separately converted PTQ1_0 pack returned Paris. Both source routes therefore produce the same published MLX weights; one shared model.safetensors serves both. See the full PTQ1_0 comparison and the independent codec checks.

The SSM A_log tensors are reconstructed as FP32 log(-stored GGUF SSM A), following the Prism runtime convention. Thus “lossless repacking” refers to the ternary codes and scales; it does not claim that this logarithmic reconstruction is a bit-exact inverse of an unavailable pre-GGUF checkpoint.

The output contains 2,390 tensors, of which 2,057 are language tensors. Tokenizer IDs and BPE merge ranks matched the source. The converter was validated against an already installed original Bonsai 2 GGUF/MLX pair: all 2,057 reconstructed language tensors matched that official MLX pack bit for bit.

The Heretic and original GGUF projectors had identical SHA256 hashes, permitting reuse of the original MLX vision tower and processor files unchanged. The Prism base MLX template revision is fcba37d2117a7077eac6b613b2668d14d9779edd. Its Safetensors SHA256 was 130de5925082c168b7866b2e91b52e44abbafc99017e3ca352b77b5b55a269ed; the corresponding GGUF projector SHA256 was 6807ede61d570bb86ba34b756a0fa109edc33668604de867c6ea6d8f1d631903.

See conversion.json for the original PQ2_0 provenance, conversion-PTQ1_0.json for the PTQ1_0 conversion, reproduce.md for conversion instructions, and SHA256SUMS for publication-file checksums. The original-pair validation is preserved in evidence/mlx-base-conversion-validation.json.

Portable metadata and local paths

The published model configuration and conversion metadata contain no personal filesystem paths or credentials. Provenance records public source and template repository IDs, pinned revisions, file basenames, and content hashes. The configuration omits _name_or_path; your local checkout location is not embedded as model identity.

The native loader still needs filesystem paths internally on your machine. The included serve.py keeps those paths local at the documented HTTP boundary: it publishes one fixed model ID, replaces known model, home, and working-directory paths in runtime metadata, response headers, and error responses, and disables arbitrary local model selection and discovery. See evidence/privacy-runtime-verification.json for the checked API behavior.

This handling applies to model identity and runtime metadata. User messages, generated answers, and tool arguments remain unchanged. It does not remove private content that an application or user supplies in a prompt or tool result. Running the native server directly can expose local model paths through its IDs and discovery responses; the serve.py command above is the recommended serving entry point for this repository.

Verification

Initial functional smoke checks completed on 2026-10-09, on an Apple M1 Max with 64 GiB unified memory, using the tested stack above and the Bonsai demo's model-ID adapter around the native server:

CheckResult
Text: capital of FranceParis
Vision: solid red 128 × 128 imageRed
Native function callget_weather with city set to Vienna, and finish_reason: "tool_calls"
Tool round tripUsed the supplied mock result: sunny, 17°C

The weather response was supplied by the test harness; the model did not fetch live weather. These tests used temperature 0, thinking disabled, and a maximum of 192 output tokens. They verify basic text, image, and tool plumbing. They do not constitute a benchmark or measure OCR, broad vision accuracy, long-context reliability, reasoning quality, or refusal rates. Results published for the original Bonsai model or the source GGUF are not presented as measurements of this MLX conversion.

The original requests, responses, and checks are retained in evidence/mlx-verification.json. The revised fixed-ID server passed the same four checks, plus streaming and private-path boundary checks; see evidence/privacy-runtime-verification.json and evidence/privacy-boundary-verification.json.

Additional native checks on 2026-10-09 covered 20 synthetic text, thinking, tool, image and OCR cases. The original and conservative Compact variants each passed all 20 and produced identical answers on these fixtures. See the original evaluation and comparison. These remain targeted checks, rather than a general benchmark. The shared catalog's thinking on/off control and the final Compact pack's native tools and OCR also passed through LM Studio; see LM Studio verification.

Intended use and limitations

OS-Software describes Heretic v2 as a decensored derivative with an OT-Ridge LoRA merged into the ternary language weights. The source publisher recommends research and experimentation, including alignment evaluation and red-teaming, and advises against public end-user service deployment.

This conversion carries the source model's reduced safety alignment. Outputs can be inaccurate, biased, offensive, or harmful and should be checked before use. The label “uncensored” does not establish universal refusal-free behavior. The publisher reports that vision was not evaluated for its release; this conversion has passed the initial image smoke check and the targeted synthetic image/OCR checks documented in the Compact comparison. A comprehensive independent evaluation of the converted Heretic model has not been performed.

Credits and license

  • 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: the underlying Qwen model lineage, identified by the retained upstream notice as Qwen3.8-27B.
  • p-e-w: Heretic, acknowledged by the source publisher.
  • Bonsai demo: conversion and runtime reference project.

The model is distributed under Apache 2.0. The original LICENSE and attribution notice are retained. Changes made for this distribution are the GGUF-to-MLX repack, native schema 2 packaging, reconstructed SSM A_log tensors, publication documentation and provenance metadata, and the public-model-ID server helper. The source-model use guidance above is attributed to its publisher; the governing redistribution terms are in LICENSE.

Updates

  • 2026-10-14: runtime, configuration and model-card update. 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. The weights are unchanged: model.safetensors SHA256 remains e56ba66424066818c7c89f0f1ba74111705b9062367905228736013a48aaf08d.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · mlx

Нельзя запустить

MLX-модели работают только на Apple Silicon.

Ревизия весов
b3fb59a

0 моделей