Instructions to use welcoma/Bonsai-1.7B-bonsai_q1_f32-MLC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLC-LLM
How to use welcoma/Bonsai-1.7B-bonsai_q1_f32-MLC with MLC-LLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Improve Bonsai 1.7B MLC model card
Browse files
README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: prism-ml/Bonsai-1.7B-unpacked
|
| 4 |
library_name: mlc-llm
|
|
|
|
| 5 |
tags:
|
| 6 |
- mlc-llm
|
| 7 |
- web-llm
|
|
@@ -10,40 +11,46 @@ tags:
|
|
| 10 |
- bonsai
|
| 11 |
- prismml
|
| 12 |
- 1-bit
|
|
|
|
| 13 |
- experimental
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# Bonsai-1.7B `bonsai_q1_f32` MLC/WebLLM
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
scale per 128-wide group.
|
| 24 |
|
| 25 |
-
##
|
| 26 |
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
## Runtime Requirement
|
| 38 |
|
| 39 |
-
This artifact requires
|
| 40 |
-
to
|
| 41 |
-
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
|
| 46 |
-
## WebLLM
|
| 47 |
|
| 48 |
```js
|
| 49 |
const appConfig = {
|
|
@@ -62,24 +69,48 @@ const appConfig = {
|
|
| 62 |
};
|
| 63 |
```
|
| 64 |
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
-
- TVM-free q1 reference checks
|
| 71 |
-
- MLC q1 weight-packing verification
|
| 72 |
-
- Qwen3-shaped q1 graph export and WebGPU compile
|
| 73 |
-
- WebLLM/WebGPU smoke generation on an NVIDIA L4 runtime
|
| 74 |
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
Original model by Prism ML:
|
| 82 |
|
| 83 |
-
-
|
| 84 |
-
-
|
| 85 |
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
base_model: prism-ml/Bonsai-1.7B-unpacked
|
| 4 |
library_name: mlc-llm
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- mlc-llm
|
| 8 |
- web-llm
|
|
|
|
| 11 |
- bonsai
|
| 12 |
- prismml
|
| 13 |
- 1-bit
|
| 14 |
+
- quantized
|
| 15 |
- experimental
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Bonsai-1.7B `bonsai_q1_f32` for MLC/WebLLM
|
| 19 |
|
| 20 |
+
This repository contains an experimental MLC/WebLLM conversion of
|
| 21 |
+
[`prism-ml/Bonsai-1.7B-unpacked`](https://huggingface.co/prism-ml/Bonsai-1.7B-unpacked).
|
| 22 |
+
It is a browser-runtime artifact, not a new model, fine-tune, GGUF, MLX, or ONNX
|
| 23 |
+
mirror.
|
| 24 |
|
| 25 |
+
The weights use the local `bonsai_q1_f32` format: binary signs packed into
|
| 26 |
+
`uint32` words with one FP32 scale per 128-wide group. Linear layers,
|
| 27 |
+
embeddings, and the final lm head are stored in this format.
|
|
|
|
| 28 |
|
| 29 |
+
## Artifact Summary
|
| 30 |
|
| 31 |
+
| Field | Value |
|
| 32 |
+
| --- | --- |
|
| 33 |
+
| Source checkpoint | `prism-ml/Bonsai-1.7B-unpacked` |
|
| 34 |
+
| Architecture | Qwen3-shaped decoder |
|
| 35 |
+
| MLC model type | `qwen3` |
|
| 36 |
+
| Quantization | `bonsai_q1_f32` |
|
| 37 |
+
| Conversation template | `qwen3_nothink` |
|
| 38 |
+
| Context window in config | `32768` |
|
| 39 |
+
| Prefill chunk in config | `2048` |
|
| 40 |
+
| Artifact size | about 254 MB |
|
| 41 |
+
| WebGPU library | `libs/bonsai-q1-1.7b-bonsai_q1_f32-webgpu.wasm` |
|
| 42 |
+
| WebGPU wasm size | 7,864,665 bytes |
|
| 43 |
|
| 44 |
## Runtime Requirement
|
| 45 |
|
| 46 |
+
This artifact requires an MLC/WebLLM runtime with Bonsai q1 support. It is not
|
| 47 |
+
expected to load in an unmodified upstream WebLLM build until the Bonsai q1
|
| 48 |
+
runtime path is upstreamed.
|
| 49 |
|
| 50 |
+
Use this repository when you control the WebLLM runtime and want to test
|
| 51 |
+
browser-local Bonsai inference through WebGPU.
|
| 52 |
|
| 53 |
+
## WebLLM Configuration
|
| 54 |
|
| 55 |
```js
|
| 56 |
const appConfig = {
|
|
|
|
| 69 |
};
|
| 70 |
```
|
| 71 |
|
| 72 |
+
The smaller override values above are intended for local browser smoke tests.
|
| 73 |
+
Increase them only after measuring browser memory and cache behavior on the
|
| 74 |
+
target device.
|
| 75 |
|
| 76 |
+
## Validation
|
| 77 |
|
| 78 |
+
The 1.7B pilot passed the following checks in the patched MLC/WebLLM workspace:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
+
- ONNX payload parity probes for sampled q1 matmul blocks.
|
| 81 |
+
- TVM-free q1 reference checks for the packed layout.
|
| 82 |
+
- Conversion-time MLC weight-packing verification.
|
| 83 |
+
- Qwen3-shaped q1 graph export and WebGPU compilation.
|
| 84 |
+
- WebLLM/WebGPU smoke generation on a controlled browser runtime.
|
| 85 |
|
| 86 |
+
Smoke prompt:
|
| 87 |
|
| 88 |
+
```text
|
| 89 |
+
Say only: ready
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
Observed response:
|
| 93 |
+
|
| 94 |
+
```text
|
| 95 |
+
I'm ready.
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
## Limitations
|
| 99 |
+
|
| 100 |
+
- This is an experimental runtime artifact, not a general `transformers` model
|
| 101 |
+
checkpoint.
|
| 102 |
+
- Quality evaluation is limited to conversion/runtime smoke checks; no benchmark
|
| 103 |
+
score is claimed by this repository.
|
| 104 |
+
- Browser success depends on WebGPU support, available GPU memory, cache quota,
|
| 105 |
+
and a compatible patched WebLLM runtime.
|
| 106 |
+
- The ternary Bonsai family is not represented by this q1 format. Ternary
|
| 107 |
+
models need a separate 2-bit/ternary MLC path.
|
| 108 |
+
|
| 109 |
+
## Provenance
|
| 110 |
|
| 111 |
Original model by Prism ML:
|
| 112 |
|
| 113 |
+
- [prism-ml/Bonsai-1.7B-unpacked](https://huggingface.co/prism-ml/Bonsai-1.7B-unpacked)
|
| 114 |
+
- [prismml.com](https://prismml.com/)
|
| 115 |
|
| 116 |
+
MLC/WebLLM conversion by `welcoma`.
|