Instructions to use OsaurusAI/Bonsai-2-27B-Ternary-JANG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OsaurusAI/Bonsai-2-27B-Ternary-JANG with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("OsaurusAI/Bonsai-2-27B-Ternary-JANG") config = load_config("OsaurusAI/Bonsai-2-27B-Ternary-JANG") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use OsaurusAI/Bonsai-2-27B-Ternary-JANG with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Bonsai-2-27B-Ternary-JANG"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "OsaurusAI/Bonsai-2-27B-Ternary-JANG" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use OsaurusAI/Bonsai-2-27B-Ternary-JANG with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Bonsai-2-27B-Ternary-JANG"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default OsaurusAI/Bonsai-2-27B-Ternary-JANG
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use OsaurusAI/Bonsai-2-27B-Ternary-JANG with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Bonsai-2-27B-Ternary-JANG"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "OsaurusAI/Bonsai-2-27B-Ternary-JANG" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Bonsai-2-27B-Ternary-JANG
JANG-affine bundle of prism-ml/Ternary-Bonsai-2-27B-mlx-2bit, Prism ML's ternary Bonsai 2 27B (built on Qwen3.8-27B). The language model is a lossless repack of Prism's ternary weights: every 2-bit code, scale and bias is carried over unchanged after validation. This is proper affine JANG storage, not JANGTQ, MXTQ, or a codebook sidecar format.
OsaurusAI · osaurus.ai · JANG source
Bundle
| Property | Value |
|---|---|
| Architecture | Dense Qwen3.8-27B conditional-generation VLM (64 blocks: 48 GatedDeltaNet + 16 full attention) |
| JANG profile | JANG_AFFINE_TERNARY_2BIT |
| Text matrices | ternary {−s, 0, +s} in 2-bit slots, group size 128, exact |
| Weight basis | blockwise Hadamard rotation (block 1024, explicit signs), applied to activations at runtime |
| Vision linears | 6-bit affine, group size 128 |
| Norms and recurrent-state tensors | float32 passthrough (as in the source) |
| Weight shards | 7.64 GiB |
| Context | 262,144 tokens |
| Modalities | text, image, video |
| Audio | not supported |
Embeddings, the untied language-model head, full-attention projections, GatedDeltaNet projections, and MLP matrices are ternary. Bonsai is dense: it has no routed experts or router tensors. The ternary codes decode to exactly the source {−scale, 0, +scale} groups.
The bundle contains the original tokenizer, tokenizer config, the Qwen3.8 chat template (thinking, reasoning_effort, tools), image and video processor configs, the Prism hadamard.json sidecar, source license and notice. EOS metadata is normalized to <|im_end|> (248046).
Runtime
The language model is stored in a Hadamard-rotated basis. Stock mlx_lm / mlx_vlm loaders return wrong output silently because they skip the activation transform. Use Osaurus or a vMLX build with JANG Hadamard support (osaurus.json names the minimum Osaurus version); the loader applies the transform from the bundle's declared contract and refuses to load if any sign vector is missing.
vmlx serve OsaurusAI/Bonsai-2-27B-Ternary-JANG --host 127.0.0.1 --port 8000
OpenAI-compatible chat requests support text, image_url, and video_url content parts, tool definitions, and chat_template_kwargs for enable_thinking and reasoning_effort (low, medium, xhigh; default xhigh).
Sampling defaults follow the Qwen3.8 card that Prism also recommends: thinking mode temperature 1.0, top_p 0.95, top_k 20; instruct mode temperature 0.7, top_p 0.80, top_k 20, presence_penalty 1.5.
Verification
Verified on 2026-09-17 through the vMLX Python server on an Apple M5 Max with 128 GB unified memory.
| Gate | Result |
|---|---|
| Logit parity vs Prism's reference loader | PASS — argmax agreement 1.0 at every position on 4 prompts, identical greedy continuations |
| Single-turn text, thinking off | PASS — Paris |
Thinking on (reasoning_effort=medium) |
PASS — closed think block, correct 391 |
| Multi-turn | PASS — exact ORCHID-4729 recall and combination |
| Long context | PASS — buried fact recalled from a 10,655-token prompt |
| Image | PASS — red background with centered blue square; green circle plus exact OCR of overlaid text |
| Video | PASS — red frames followed by blue frames |
| Tool calling | PASS — get_weather call emitted and tool result folded into the final answer |
The conversion report is included as jang_affine_report.json; authoritative per-tensor storage metadata is in jang_config.json.
Quantization notes
- 402 language-model modules (embedding, 64 layers, untied head) are the source ternary codes, scales and biases, copied without re-quantization. There is no full-precision source for these weights, so AWQ, imatrix and GPTQ do not apply.
- 83 eligible vision linears use native 6-bit affine storage;
blocks.N.mlp.linear_fc2(input 4304) and the patch/position embeddings stay float16. - 699 norms, GatedDeltaNet state projections, convolutions, biases and incompatible vision tensors pass through in their source precision.
- No
tq_packed,tq_norms,mxtq_bits, orjangtq_runtime.safetensorsartifacts are present.
License and attribution
Apache-2.0. See LICENSE and NOTICE.txt. This repository is a repacked conversion of the linked Prism ML Bonsai 2 checkpoint; the ternary weights are Prism ML's work.
- Downloads last month
- 978
Quantized
Model tree for OsaurusAI/Bonsai-2-27B-Ternary-JANG
Base model
Qwen/Qwen3.8-27B