Text Generation
MLX
Safetensors
prism_hadamard_qwen35
ternary
2-bit
prismml
bonsai
mtp
speculative-decoding
vision
vlm
qwen3_5
reasoning
experimental
conversational
Instructions to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX"
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": "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX 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 "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX"
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 EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX"
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 "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX" \ --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"
Download mtplx_runtime.json from EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX: direct link, hf CLI and curl.
- Browser
- Download file 4.57 kB
-
https://huggingface.co/EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX/resolve/main/mtplx_runtime.json
- Command line
-
hf download hf://EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX/mtplx_runtime.json
-
curl -L -o mtplx_runtime.json https://huggingface.co/EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX/resolve/main/mtplx_runtime.json
4.57 kB
| { | |
| "arch_id": "qwen3-next-mtp", | |
| "artifact_role": "mtplx-pack", | |
| "base_trunk": "prism-ml/Ternary-Bonsai-2-9B-mlx-2bit", | |
| "source_repo": "prism-ml/Ternary-Bonsai-2-9B-mlx-2bit (Prism ML official pack)", | |
| "public_model_id": "ternary-bonsai-2-9b-mtplx-speed-local", | |
| "mtplx_version": "2.12.3", | |
| "precision_variant": "fp16", | |
| "capabilities": { | |
| "vision": true, | |
| "mtp": true | |
| }, | |
| "sampler": { | |
| "temperature": 1.0, | |
| "top_p": 0.95, | |
| "top_k": 20 | |
| }, | |
| "recommended_draft_sampler": { | |
| "temperature": 1.0, | |
| "top_p": 0.95, | |
| "top_k": 20 | |
| }, | |
| "recommended_profile": "sustained", | |
| "mtp_depth_default": 1, | |
| "mtp_depth_max": 3, | |
| "mtp_sidecar": "int4-g64-prequantized", | |
| "mtp_contract": { | |
| "base_hidden_variant": "post_norm", | |
| "concat_order": "embedding_hidden", | |
| "hidden_variant": "post_norm", | |
| "mtp_position_mode": "local", | |
| "mtp_quant_bits": 4, | |
| "mtp_quant_group_size": 64, | |
| "mtp_quant_mode": "affine", | |
| "mtp_quant_policy": "all", | |
| "mtp_prequantized": true | |
| }, | |
| "verified_on": { | |
| "hardware": "unverified on this machine yet", | |
| "timestamp": "2026-11-12T04:47:10-0800" | |
| }, | |
| "forge_provenance": { | |
| "builder": "local_mtplx_repack", | |
| "built_at": "2026-11-12T04:47:10-0800", | |
| "mtp_head": { | |
| "action": "copy", | |
| "cast_from": null | |
| }, | |
| "mtp_head_from": "prism-ml/Ternary-Bonsai-2-9B-mlx-2bit (mtp/model.safetensors, qwen3_5_mtp, 4-bit g64)", | |
| "requantized": false, | |
| "source_model_bytes": 3462149260, | |
| "source_model_sha256": "b8ebd13459dcd53504432a4a0a797287c3a4c00d80835466dbb499f05b7512bb", | |
| "mtp_bytes": 136884309, | |
| "mtp_sha256": "8968d94855ba38809a4ff5b6e20f4856757b64fdbbbd84511e4bea371764faba", | |
| "note": "Repackaged by EngineeringWithJay from Prism ML's official Ternary-Bonsai-2-9B-mlx-2bit into the MTPLX pack contract: mtp/model.safetensors moved to mtp.safetensors at pack root, components.mtp set true, mtplx_runtime.json written. No weight bytes were modified, dequantized or requantized." | |
| }, | |
| "speed_evidence": { | |
| "status": "unmeasured on this machine", | |
| "base_pack_evidence": { | |
| "status": "measured", | |
| "measured_at": "2026-09-22", | |
| "engine": "MTPLX release candidate def3894d", | |
| "conditions": "M5 Max 128 GB, 512 generated tokens, thinking disabled, temperature 1.0, top-p 0.95, top-k 20", | |
| "rows": [ | |
| { | |
| "hardware": "M5 Max 128 GB, MTP depth 1", | |
| "context_tokens": 4061, | |
| "ar_tokens_per_second": 38.75, | |
| "mtp_tokens_per_second": 50.01, | |
| "accepted_tokens_per_step": 0.747, | |
| "peak_memory_gb": 11.6, | |
| "note": "this row is the 27B Bonsai-2 base pack, not the 9B" | |
| } | |
| ] | |
| } | |
| }, | |
| "memory_evidence": { | |
| "status": "unmeasured on this machine" | |
| }, | |
| "recommended_generation_mode": "mtp", | |
| "recommended_generation_mode_evidence": { | |
| "status": "unmeasured", | |
| "measured_at": "", | |
| "rows": [] | |
| }, | |
| "pack_name": "Ternary-Bonsai-2-9B-MTPLX-Speed", | |
| "hf_repo": "EngineeringWithJay/Ternary-Bonsai-2-9B-MTPLX", | |
| "model_family": "qwen3_5", | |
| "min_engine_version": "2.12.0", | |
| "quantization": { | |
| "format": "prism_hadamard_qwen35", | |
| "bits": 2, | |
| "group_size": 128, | |
| "mode": "affine", | |
| "weight_values": "ternary" | |
| }, | |
| "restamp_provenance": { | |
| "restamped_at": "2026-11-12T04:47:10-0800", | |
| "source_repo": "prism-ml/Ternary-Bonsai-2-9B-mlx-2bit", | |
| "weights_changed": false, | |
| "note": "Only packaging and identity metadata changed. Trunk sha256 recorded above so the byte-identity of the redistribution is checkable." | |
| }, | |
| "exactness_baseline": { | |
| "criterion": "mean KL and top-1 parity vs a float32 reference at float32 precision", | |
| "status": "base pack verified by Prism ML; the MTPLX repack is byte-identical in the trunk", | |
| "mtp_exact_by_construction": "MTP decoding passes through the target model; rejection sampling with residual resampling at any temperature yields the trunk's distribution regardless.", | |
| "base_pack_evidence": { | |
| "reference": "Prism ML bundled runtime (runtime/artifact.py, mlx-vlm 0.6.3) as shipped with the 9B pack", | |
| "method": "reload check of the packed 2-bit modules plus a tokenizer round-trip", | |
| "criterion": "all 248320 logits exact after reload; 202 packed modules; vocabulary ids and BPE merges match", | |
| "status": "passed", | |
| "measured": { | |
| "measured_at": "2026-09 (published with the pack)", | |
| "engine": "Prism ML bundled runtime", | |
| "reload_logits_exact": true, | |
| "checked_logits": 248320, | |
| "packed_modules": 202, | |
| "vocabulary_ids_match": true, | |
| "bpe_merges_match": true, | |
| "summary": "Prism ML reports exact logits across all 248320 vocabulary entries after reloading the packed modules, with tokenizer ids and BPE merges matching." | |
| } | |
| } | |
| } | |
| } |