Repository navigation
Ternzip v0.3.0 · Ternary Bonsai 2 9B
Ternzip v0.3.0 · Ternary Bonsai 2 9B
Ternzip v0.3.0 packs Prism ML’s 1,997,486,976-byte Ternary Bonsai 2 9B PTQ1_0 checkpoint into 1,834,157,871 bytes (1.834 GB). It saves 163,329,105 bytes (8.18%) and restores the source GGUF byte for byte, including all 427 tensors, original scale bits, tokenizer, metadata and padding.
Size, speed and startup on Apple M4 Pro. Across eight ordinary English prompts and three fresh starts, Ternzip’s custom Metal runtime generated about 60 tokens/s. The median warm load was 17.85 s, compared with 1.29–1.53 s for Prism’s three packings. Loading took 11.7× as long as Prism’s default PQ2_0 (1.52 s) on the same drive with the files already in the OS cache.
The same Ternzip archive saves 24.11% against Prism’s PQ2_0 file and 28.26% against its Q2_0 file. Prism’s fork executes all three packings of the same ternary weights. Prism recommends PQ2_0 by default on Apple Silicon. Q2_0 also runs in upstream llama.cpp b11556 and later. Prism’s packing guide
Apple M4 Pro
The custom Metal runtime measured 60.12 tokens/s and matched the Q2_0 control on 24/24 complete token streams and next or stopping decisions. On this workload its median rate was 9.0% above Prism’s default PQ2_0 and 9.1% above Prism Q2_0. The model uses the same ternary values. Its faster token generation comes from the execution layout and Metal kernels. File compression reduces the download and adds unpacking work at startup. A separate three-start check through the packaged loader matched all 24 streams and measured 59.94 tokens/s. Taken together, the measurements support about 60 tokens/s.
| Configuration | Download (bytes) | Median output tokens/s | Median warm load | Counted weight bytes | Matches vs. Q2_0 |
|---|---|---|---|---|---|
| Prism PTQ1_0 | 1,997,486,976 | 50.42 | 1.29 s | 2,053,638,719 | 24/24 |
| Prism PQ2_0 (Mac default) | 2,416,851,840 | 55.16 | 1.52 s | 2,473,006,204 | 24/24 |
| Prism Q2_0 | 2,556,640,128 | 55.09 | 1.53 s | 2,612,781,385 | reference |
| Ternzip v0.3.0 | 1,834,157,871 | 60.12 | 17.85 s | 1,999,911,846 | 24/24 |
| Ternzip with 85 denser matrices (experiment) | 1,834,157,871 | 56.89 | 17.98 s | 1,799,371,686 | 24/24 |
One Apple M4 Pro, one greedy text stream, eight English prompts repeated across three fresh processes per configuration, up to 256 output tokens per chat. Thinking and speculation were disabled. Median output rate includes streamed detokenization and the next token or stop decision. Startup and prompt processing were timed separately. All files were on the same drive and were read once immediately before each timed load to warm the filesystem cache. Each startup median covers three starts with dependencies installed. The weight count covers model tensors, rotations and, for Ternzip, input tables, row cache and decoder reserve. Total process memory includes additional allocations. Benchmark data
The earlier three-start comparison measured 59.33 against 53.09 tokens/s for Q2_0 (11.75% higher). Median loads there were 21.00 s and 18.61 s, respectively, using different storage paths without the matched cache warm-up. The earlier 17.81 s observation was a single Ternzip start. Across prior sessions Ternzip’s 1.836 GB archive moved from 59.04 to 58.04 tokens/s and Prism Q2_0 from 52.16 to 53.09. Roughly 1 token/s of variation makes the old and new archive timings insufficient to rank those archives. Their execution weights and Metal runtime agree.
What the two-bit slots buy
The guarded decoder’s 85 matrices contain 4,278,190,080 ternary weights. Each block has 128 weights and one 16-bit scale. PTQ1_0 uses 28 bytes per block (1.75 bits/weight). PQ2_0 uses 34 bytes (2.125). We checked the conversion against every byte of both official layouts. The unused fourth slot occurred zero times in the original PQ2_0 payload. The isolated dot-product graphs used identical activations, alternated the order of the two kernels, and waited for the GPU before recording elapsed time.
| Format for the 85 matrices | Matrix payload | Dot products, one sweep | Effective payload GB/s | Billion weights/s |
|---|---|---|---|---|
| PTQ1_0 | 935,854,080 B | 9.61 ms | 97.4 | 445.2 |
| PQ2_0 | 1,136,394,240 B | 8.13 ms | 139.8 | 526.2 |
The denser format saved 200,540,160 counted bytes and took 1.48 ms longer per isolated sweep. In live chat, switching exactly those 85 matrices changed the median from 60.12 to 56.89 tokens/s, and 24/24 outputs still matched Q2_0. The ordinary mixed plan uses 86 two-bit-slot matrices. We held its additional gate matrix fixed across the two test arms. The bandwidth calculation divides logical weight bytes by elapsed time. Physical DRAM traffic was not measured. Comparing all 782,336 floating-point dot outputs, the largest numerical difference was 0.00002360. The stored weights and scales were bit-identical after conversion.
Research on prediction from an external float checkpoint
Separately, the public Qwen3.5-9B BF16 weights predicted symbols in one complete first-layer feed-forward matrix. Coding the corrections took 0.5546 bits per weight compared with the standalone 1.5605, and recovered every symbol. That figure covers one 50,331,648-weight tensor out of 202 ternary tensors. Two other matrices were sampled. The decoder for that experiment needs the external BF16 weights. The release archive is self-contained.
Archive compatibility
This archive requires Ternzip v0.3.0. The new launcher also accepts the existing 8B and v0.2.0 9B archives. With an unknown 9B size it reports an archive-version or incomplete-download error and directs the reader to the model card and checksum. Known-size files with incorrect contents fail SHA-256 verification. The v0.2.0 release is pinned to the earlier 1,860,057,576-byte 9B file.
The release CLI restored Prism’s PTQ1_0 SHA-256, 3561df7ac7d26a71ffa991ac2db740b10841c3a350aa2676ccd3ff5d428b4e8b. The research restorer also reproduced the official PQ2_0 and Q2_0 SHA-256 digests from the same archive. The v0.3.0 Metal bundle and model card both pin the matching loader version. 9B model card · Matching loader
Created using Bonsai by Prism ML. Optimatech Labs modified the distribution by recompressing the official model and supplying a loader. This is an unofficial third-party release under Apache 2.0. The model distribution includes Prism’s notice and the Qwen/Alibaba license. The Metal backend carries the llama.cpp MIT license. Prism’s notice · Metal backend license