welcoma commited on
Commit
6dae760
·
verified ·
1 Parent(s): f35a0c8

Improve Bonsai 1.7B MLC model card

Browse files
Files changed (1) hide show
  1. README.md +65 -34
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
- Experimental MLC/WebLLM artifact for `prism-ml/Bonsai-1.7B-unpacked`.
 
 
 
19
 
20
- This is the native Bonsai q1 MLC conversion, not a GGUF, MLX, or ONNX mirror.
21
- Linear layers, embeddings, and tied lm-head weights are stored in the local
22
- `bonsai_q1_f32` format: one-bit signs packed into `uint32` words with one FP32
23
- scale per 128-wide group.
24
 
25
- ## Status
26
 
27
- - Source checkpoint: `prism-ml/Bonsai-1.7B-unpacked`
28
- - Model type: `qwen3`
29
- - Quantization: `bonsai_q1_f32`
30
- - Conversation template: `qwen3_nothink`
31
- - Context window in config: `32768`
32
- - Prefill chunk in config: `2048`
33
- - Parameter shards: 8
34
- - Model artifact size: about 254 MB
35
- - WebGPU library: `libs/bonsai-q1-1.7b-bonsai_q1_f32-webgpu.wasm`
 
 
 
36
 
37
  ## Runtime Requirement
38
 
39
- This artifact requires a Bonsai q1-capable MLC/WebLLM runtime. It is not expected
40
- to work with an unmodified upstream WebLLM release until the Bonsai q1
41
- quantization/runtime support is upstreamed.
42
 
43
- Validated smoke path used a patched local MLC/WebLLM checkout and loaded the
44
- model through WebLLM on WebGPU.
45
 
46
- ## WebLLM App Config
47
 
48
  ```js
49
  const appConfig = {
@@ -62,24 +69,48 @@ const appConfig = {
62
  };
63
  ```
64
 
65
- ## Validation Snapshot
 
 
66
 
67
- The 1.7B pilot artifact has passed:
68
 
69
- - q1 ONNX payload parity probing for sampled matmul blocks
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
- Smoke prompt: `Say only: ready`
 
 
 
 
76
 
77
- Observed reply: `I'm ready.`
78
 
79
- ## Attribution
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  Original model by Prism ML:
82
 
83
- - `prism-ml/Bonsai-1.7B-unpacked`
84
- - `https://prismml.com/`
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`.