welcoma commited on
Commit
c72db3b
·
verified ·
1 Parent(s): e2363d9

Add professional Ternary Bonsai 1.7B MLC model card

Browse files
Files changed (1) hide show
  1. README.md +115 -0
README.md ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: prism-ml/Ternary-Bonsai-1.7B-unpacked
4
+ library_name: mlc-llm
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - mlc-llm
8
+ - web-llm
9
+ - webgpu
10
+ - qwen3
11
+ - bonsai
12
+ - ternary
13
+ - prismml
14
+ - 2-bit
15
+ - quantized
16
+ - experimental
17
+ ---
18
+
19
+ # Ternary-Bonsai-1.7B `bonsai_tq_f32` for MLC/WebLLM
20
+
21
+ This repository contains an experimental MLC/WebLLM conversion of
22
+ [`prism-ml/Ternary-Bonsai-1.7B-unpacked`](https://huggingface.co/prism-ml/Ternary-Bonsai-1.7B-unpacked).
23
+ It is a browser-runtime artifact, not a new model, fine-tune, GGUF, MLX, or ONNX
24
+ mirror.
25
+
26
+ The source checkpoint is Prism ML's unpacked FP16 Ternary Bonsai model. This
27
+ conversion uses a local MLC `bonsai_tq_f32` profile: symmetric 2-bit group
28
+ quantization with `uint32` storage, group size 128, and FP32 scales. The encoded
29
+ values represent the ternary lane `-scale`, `0`, and `+scale`.
30
+
31
+ ## Artifact Summary
32
+
33
+ | Field | Value |
34
+ | --- | --- |
35
+ | Source checkpoint | `prism-ml/Ternary-Bonsai-1.7B-unpacked` |
36
+ | Architecture | Qwen3-shaped decoder |
37
+ | MLC model type | `qwen3` |
38
+ | Quantization | `bonsai_tq_f32` |
39
+ | Quantized storage | 2-bit symmetric group quantization in `uint32` |
40
+ | Conversation template | `qwen3_nothink` |
41
+ | Context window in config | `32768` |
42
+ | Prefill chunk in config | `2048` |
43
+ | Total parameters | 1,720,028,160 |
44
+ | Quantized parameter size | 0.451 GB |
45
+ | Bits per parameter | 2.252 |
46
+ | Parameter shards | 13 |
47
+ | Artifact size | about 460 MB |
48
+ | WebGPU library | `libs/ternary-bonsai-1.7b-bonsai_tq_f32-webgpu.wasm` |
49
+
50
+ ## Runtime Requirement
51
+
52
+ This artifact requires an MLC/WebLLM runtime with the local `bonsai_tq_f32`
53
+ quantization profile registered. It is not expected to load in an unmodified
54
+ upstream WebLLM build until this profile is upstreamed or otherwise carried in
55
+ the runtime.
56
+
57
+ This first ternary path uses MLC's group-quantized graph path. It is a compact
58
+ WebGPU artifact and a correctness/release milestone, but it is not yet a custom
59
+ fused ternary matmul kernel. Benchmark it before making speed claims.
60
+
61
+ ## WebLLM Configuration
62
+
63
+ ```js
64
+ const appConfig = {
65
+ model_list: [
66
+ {
67
+ model: "https://huggingface.co/welcoma/Ternary-Bonsai-1.7B-bonsai_tq_f32-MLC/resolve/main/",
68
+ model_id: "Ternary-Bonsai-1.7B-tq-MLC",
69
+ model_lib:
70
+ "https://huggingface.co/welcoma/Ternary-Bonsai-1.7B-bonsai_tq_f32-MLC/resolve/main/libs/ternary-bonsai-1.7b-bonsai_tq_f32-webgpu.wasm",
71
+ overrides: {
72
+ context_window_size: 4096,
73
+ prefill_chunk_size: 512,
74
+ },
75
+ },
76
+ ],
77
+ };
78
+ ```
79
+
80
+ The smaller override values above are intended for local browser smoke tests.
81
+ Increase them only after measuring browser memory and cache behavior on the
82
+ target device.
83
+
84
+ ## Validation
85
+
86
+ The artifact was converted and WebGPU-compiled on the GCP MLC/WebLLM builder VM,
87
+ not on a local laptop.
88
+
89
+ - Source: `prism-ml/Ternary-Bonsai-1.7B-unpacked`
90
+ - Quantization: `bonsai_tq_f32`
91
+ - Quantization profile: `int2` values, `uint32` packed storage, FP32 scales
92
+ - Conversion peak RAM: 3.204 GB on CPU
93
+ - WebGPU compile completed successfully
94
+ - Compile estimate without KV cache: 1886.70 MB
95
+ - Compile estimate with 4K KV cache: 2782.70 MB
96
+
97
+ ## Limitations
98
+
99
+ - This is an experimental runtime artifact, not a general `transformers` model
100
+ checkpoint.
101
+ - This repo does not claim the same runtime performance as Prism ML's native MLX
102
+ 2-bit release.
103
+ - Quality evaluation is limited to conversion and WebGPU compile checks; no
104
+ benchmark score is claimed by this repository.
105
+ - Browser success depends on WebGPU support, available GPU memory, cache quota,
106
+ and a compatible patched WebLLM runtime.
107
+
108
+ ## Provenance
109
+
110
+ Original model by Prism ML:
111
+
112
+ - [prism-ml/Ternary-Bonsai-1.7B-unpacked](https://huggingface.co/prism-ml/Ternary-Bonsai-1.7B-unpacked)
113
+ - [prismml.com](https://prismml.com/)
114
+
115
+ MLC/WebLLM conversion by `welcoma`.