Instructions to use peppi314/Bonsai-27B-dSpark-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use peppi314/Bonsai-27B-dSpark-MLX-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("peppi314/Bonsai-27B-dSpark-MLX-4bit") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use peppi314/Bonsai-27B-dSpark-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "peppi314/Bonsai-27B-dSpark-MLX-4bit" --prompt "Once upon a time"
Bonsai 27B dSpark — MLX 4-bit sidecar
This repository contains the dSpark speculative-decoding drafter only for Prism ML's Bonsai-27B, converted to an MLX-compatible 4-bit safetensors sidecar for Higgs.
It is not a standalone language model. Pair it with
prism-ml/Bonsai-27B-mlx-1bit
as the target model.
What is included
| Property | Value |
|---|---|
| Drafter architecture | dSpark / DFlash, 6 transformer layers |
| Trained draft block | 4 positions |
| Target hidden-state taps | [1, 16, 31, 46, 61] |
| Hidden size | 5120 |
| Attention heads / KV heads | 40 / 4 |
| Markov rank | 256 |
| Vocabulary | 248,320 tokens |
| Quantization | MLX affine 4-bit, group size 32 |
| Tensor sidecar size | 814,062,178 bytes (776.35 MiB) |
This is the lean variant. It reuses the resident target model's bit-identical
Q1 token embedding and its Q1 language-model head instead of storing duplicate
copies. config.json records this as reuse_target_head: true.
Conversion provenance
The tensors were converted from
Bonsai-27B-dspark-Q4_1.gguf
at source revision
0cf7e3d21581b169b4df1de8bf01316000e2fbb7.
- Source GGUF SHA-256:
25e73f9f7ab5d1f7f1336711496dbc12da674e639ec88d579dc8683045befb1b - Converted
model.safetensorsSHA-256:ae3eeb6db71dc22bd62fea0c0e7c217263389ef44a9e33f550c665536f8e9822 config.jsonSHA-256:4a285dec60023a17df63373123d6b8b8b0d46c55e68b7d0678c6bd109d324a2f
The conversion directly and exactly repacks the source GGUF Q4_1 blocks into MLX affine Q4/group-32 storage. It does not dequantize and requantize the Q4 weights. Representative and exhaustive tensor checks matched the GGUF source after dequantization.
Usage with Higgs
Download both the target and this drafter sidecar:
hf download prism-ml/Bonsai-27B-mlx-1bit \
--local-dir ./Bonsai-27B-mlx-1bit
hf download peppi314/Bonsai-27B-dSpark-MLX-4bit \
--local-dir ./Bonsai-27B-dSpark-MLX-4bit
Point Higgs at the drafter directory and load Bonsai as the target through your normal Higgs entry point:
export HIGGS_DFLASH_PATH="$PWD/Bonsai-27B-dSpark-MLX-4bit"
The dSpark runtime validates the target hidden size, vocabulary size, and tap layers at load time. This artifact requires a Higgs build containing Bonsai Q1 and dSpark/DFlash recurrent-tape support.
Fidelity note
The lean sidecar deliberately uses the target's packed Q1 language-model head for proposals. That Q1 head is very close to, but not numerically identical to, the Q4 head shipped inside Prism ML's original dSpark GGUF. This can change which draft tokens are proposed and their acceptance rate. Higgs still verifies every proposal with the Bonsai target, so greedy generation remains target- correct; the drafter cannot substitute unverified tokens into the output.
If exact proposal fidelity to the original Prism ML Q4 head is required, use a full conversion that retains the GGUF output head instead of this lean release.
License and attribution
The source model and this converted artifact are distributed under the
Apache License 2.0. See LICENSE.txt and NOTICE.txt.
Created using Bonsai by Prism ML. Bonsai is built from Qwen3.6-27B by Alibaba
Cloud. Please see the upstream
Bonsai-27B-gguf model card
for the original model description, benchmarks, limitations, and citation.
- Downloads last month
- 270
4-bit