diskformer 0.5.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.6 (2026-10-24)
4
+ - The chat demo (`ggml/chat.html`) lists Ling 3.0 Flash 124B (2 parts, 77 GB, 6 GB budget) and downloads a model
5
+ published in parts part by part, each under its own name; stop and resume work across parts, and Remove deletes every
6
+ part. Checked in the browser: the download starts on part 1 of 2 from Hugging Face, a stop shows 0.34 GB of 77.0 GB
7
+ stored with Resume, and Remove leaves no file in the page's OPFS.
8
+
9
+ ## 0.6.5 (2026-10-24)
10
+ - The browser build loads a split GGUF (`name-00001-of-0000n.gguf`, as published): the worker opens every part from
11
+ OPFS and mounts them together, `df_read_file_batch` and `df_upload_batch_js` read experts from the part that holds
12
+ them, and `df_plan` sums the paged bytes over all parts. `gate.html` and `scripts/chrome-gate.mjs` take every part.
13
+ Ling 3.0 Flash (124B-A5B, `bailingmoe3`, 2 parts, 77 GB) in Chrome at a 6 GB budget: copied into OPFS in 126 s,
14
+ loaded in 60 s (22 slots), 4.1-4.9 tok/s; 6/9 replies match llama.cpp on the CPU (4 identical, 2 where the CPU reply
15
+ is a prefix of Chrome's), the other 3 are coherent and differ where two words score almost the same. Paging exact
16
+ natively, 9/9 at 8 vs 32 slots; Granite 4.0 H Tiny rechecked 9/9 in Chrome.
17
+ - Native `df-chat <gguf> <slots> --record <refs.json> <out.json>` renders each gate conversation with the model's own
18
+ template and records 64-token replies, for models whose reference cannot come from llama-server on Metal.
19
+ - `scripts/record-refs.mjs`: CPU references (`--ngl 0`) keep the weights memory-mapped and unrepacked
20
+ (`-lm mmap --no-repack`), so a model larger than RAM loads; a server killed by a signal now stops the run instead of
21
+ leaving it waiting for 30 minutes.
22
+
23
+ ## 0.6.4 (2026-10-23)
24
+ - `engines/lfm2_5.js` (LFM2.5 230M/1.2B, `Lfm2Mobile`), `engines/gemma-4-e2b.js` (Gemma 4 E2B/E4B, `Gemma4Mobile`) and
25
+ `engines/ternary_bonsai_2_27b.js` (`TernaryBonsai2`), from LocalMind main a02f06e. Held back in 0.6.0 because their
26
+ webml-community Spaces showed no license; Chirag wrote them and released them under MIT (2026-10-23). All three
27
+ import in Node; their GPU checks are LocalMind's (`scripts/bench-engines.mjs`), not rerun here. With these,
28
+ diskformer holds every LocalMind engine.
29
+
30
+ ## 0.6.3 (2026-10-23)
31
+ - `LingMoeSsd.load` reads the two parts' headers (20 MB from Hugging Face) only when an ingest follows; a complete
32
+ store loads without them (found by LocalMind's live check through anyformer). Verified in a real browser by LocalMind
33
+ (after a 77 GB ingest through anyformer v0.2.5, a reload made no requests to the part URLs; answers correct before and
34
+ after). `qwen3_moe_ssd.js` exports `STORE_FORMAT` and `STORE_ROOT`.
35
+ - `scripts/sync-localmind.mjs` runs diskformer → LocalMind for every file now, engines included (imports rewritten
36
+ from `../src/` to `./`); `--ref` is gone, since LocalMind no longer writes engines.
37
+ - Native driver reads a split GGUF (`name-0000k-of-0000n.gguf`, as published) part by part, so it is never merged.
38
+ Ling 3.0 Flash (124B-A5B, 2 parts, 77 GB) on the llama.cpp path natively: replies identical at 8 and 32 slots on 3
39
+ prompts, 32 tokens. The browser build refuses a split GGUF with a message for now. Rebuilt browser build rechecked:
40
+ Granite 4.0 H Tiny 9/9 in Chrome.
41
+
42
+ ## 0.6.2 (2026-10-23)
43
+ - `engines/ling_moe_ssd.js`: the Ling 3.0 Flash engine (inclusionAI, 124B-A5B, `bailingmoe3`: KDA linear attention +
44
+ MLA, 512 experts), handed over by LocalMind (d210986); the first engine diskformer adopts rather than mirrors.
45
+ `splitFetch` ingests the two-part GGUF as one file. `engines/iq_quants.js` gains Q6_K and Q5_0. LocalMind's gate:
46
+ 6-layer cut 8/8 vs llama.cpp Metal; full model 5/8 vs llama.cpp CPU over 32 tokens, layer 0 within 5 decimals of a
47
+ float64 reference (CPU is 1-3% off); decode 5.53 tok/s, GPU 2.51 GB dense + 4.29 GB pool (M4 Pro). Here: imports in
48
+ Node, LocalMind's no-GPU test (`test-ling.mjs`) passes on this copy; the GPU gate was not rerun here.
49
+
50
+ ## 0.6.1 (2026-10-22)
51
+ - `Llama.chat(messages, { thinking: false })` renders the chat template with reasoning off (llama.cpp's
52
+ `enable_thinking`), for models that reason first: Qwen3.6 35B-A3B natively answers directly instead of opening with a
53
+ thinking process. Default unchanged (the template's own choice). Asked for by anyformer, whose other engines pass
54
+ `enableThinking: false`. Native driver: `df-chat model slots prompt n --no-think`. In Chrome (through anyformer's
55
+ diskformer-llama): Gemma 4 26B's explain-tcp chat with `thinking: false` is identical to `gemma.json`'s reply.
56
+
57
+ ## 0.6.0 (2026-10-22)
58
+ - `engines/` is the one home of LocalMind's hand-written engines (Chirag 2026-10-22: diskformer holds every custom
59
+ engine; anyformer routes; LocalMind loads through anyformer). New: `lfm2_moe_ssd.js`, `hy_v3_moe_ssd.js`,
60
+ `flint_moe_ssd.js`, `iq_quants.js`, `qwen35_dense.js`, `ple-opfs.js`, `flashmap_drafter.js`,
61
+ `ternary_bonsai_2_dflash.js`, `ternary_bonsai_2_mtp.js`, copied from LocalMind main b5c289d with imports rewritten;
62
+ each was gated in LocalMind and imports cleanly here (Node). Not copied: `lfm2_5.js`, `gemma-4-e2b.js` and
63
+ `ternary_bonsai_2_27b.js`, vendored from webml-community Spaces that publish no license.
64
+ - `scripts/sync-localmind.mjs --ref <commit>` reads LocalMind's engines from a commit instead of its working tree.
65
+ - `scripts/chrome-gate.mjs --env K=V,…` passes driver settings to the gate page.
66
+
3
67
  ## 0.5.4 (2026-10-22)
4
68
  - `diskformer/llama`: the GPU budget plan picks the physical batch size (llama.cpp's `n_ubatch`) as the largest of
5
69
  512, 256, 128 and 64 that leaves room for one token's experts. The compute buffers scale with it (Gemma 4 26B-A4B:
package/README.md CHANGED
@@ -5,7 +5,7 @@ WebGPU in a worker; the GGUF stays on disk in the browser's private storage (OPF
5
5
  needs are paged into GPU memory. 17 architectures are checked against llama.cpp, from Qwen3.6 35B to gpt-oss 20B.
6
6
 
7
7
  Plain ES modules, no dependencies, no build step. Chrome or Edge with WebGPU, on any origin (CDN or self-hosted).
8
- Weights stay in the user's own browser storage. The disk tier underneath (`src/`) also runs two hand-written engines.
8
+ Weights stay in the user's own browser storage. The disk tier underneath (`src/`) also runs hand-written engines.
9
9
 
10
10
  [![npm](https://img.shields.io/npm/v/diskformer?style=flat-square&color=555)](https://www.npmjs.com/package/diskformer)
11
11
  [![license](https://img.shields.io/badge/license-MIT-555?style=flat-square)](LICENSE)
@@ -18,7 +18,7 @@ Weights stay in the user's own browser storage. The disk tier underneath (`src/`
18
18
  | How | Command |
19
19
  |---|---|
20
20
  | npm | `npm install diskformer` |
21
- | CDN | `import { Llama } from 'https://cdn.jsdelivr.net/npm/diskformer@0.5.2/ggml/llama.js'` |
21
+ | CDN | `import { Llama } from 'https://cdn.jsdelivr.net/npm/diskformer@0.6.4/ggml/llama.js'` |
22
22
  | Copy | `src/`, `engines/` and `index.js`; nothing else is needed |
23
23
 
24
24
  ## Quick start
@@ -27,7 +27,7 @@ Paste into any page served over http(s), in Chrome or Edge. The first run downlo
27
27
  OPFS (resumable); later loads take seconds. Any MoE GGUF on a [checked architecture](docs/coverage.md) loads the same way.
28
28
  ```html
29
29
  <script type="module">
30
- import { Llama } from 'https://cdn.jsdelivr.net/npm/diskformer@0.5.2/ggml/llama.js';
30
+ import { Llama } from 'https://cdn.jsdelivr.net/npm/diskformer@0.6.4/ggml/llama.js';
31
31
  const llama = new Llama();
32
32
  const name = 'granite-4.0-h-tiny-Q4_K_M.gguf';
33
33
  await llama.download({ name, size: 4230976352,
@@ -64,8 +64,9 @@ weights in OPFS, read through sync access handles in workers, and moves only wha
64
64
 
65
65
  ## The engines
66
66
 
67
- The disk tier also stands alone: your engine keeps its own kernels and decides what a step needs. `engines/` holds three
68
- from-scratch WebGPU engines on it: Gemma 4 26B-A4B, Qwen3.6 35B-A3B and Qwen3-30B-A3B (at
67
+ The disk tier also stands alone: your engine keeps its own kernels and decides what a step needs. `engines/` is the home of
68
+ LocalMind's hand-written WebGPU engines (since 0.6.0): LFM2 MoE, Hunyuan v3 MoE, Flint, Ling 3.0 Flash, a dense Qwen3.5 layer streamer,
69
+ LFM2.5, Gemma 4 E2B, Ternary Bonsai 2 27B and speculative drafters, each gated in LocalMind; and Gemma 4 26B-A4B, Qwen3.6 35B-A3B and Qwen3-30B-A3B (at
69
70
  [/classic/](https://diskformer.naklitechie.com/classic/); `Gemma4MoeSsd.load(null, { gpuBudgetBytes })`). A budget that
70
71
  cannot hold the dense part and two tokens' experts is refused with the numbers. Kernels: gemma4-webgpu (Apache-2.0,
71
72
  `engines/NOTICE`). Measured on a MacBook M4 Pro, 24 GB, Chrome 154, 2026-10-05, decode the median of
package/engines/NOTICE CHANGED
@@ -9,9 +9,10 @@ fork of gemma4-webgpu:
9
9
  https://github.com/tylerstraub/gemma4-webgpu
10
10
 
11
11
  Changes from the original: rewritten for mixture-of-experts models whose experts stream from OPFS (Q8_0 and Q4_0
12
- split planes, slot-indexed expert GEMVs, GPU router top-k, chunked prefill, Q6_K head planes). Everything else in
12
+ split planes, slot-indexed expert GEMVs, GPU router top-k, chunked prefill, Q6_K head planes). `ternary_bonsai_2_dflash.js` is built from NakliTechie/dflash-mlx-bonsai2 (Apache-2.0). `lfm2_5.js`,
13
+ `gemma-4-e2b.js` and `ternary_bonsai_2_27b.js` are built from webml-community Hugging Face Spaces by the same author, MIT. Everything else in
13
14
  this folder is MIT (../LICENSE), Copyright (c) 2026 Chirag Patnaik.
14
15
 
15
16
  The engine files are copies of LocalMind's (https://github.com/NakliTechie/LocalMind), kept in step by
16
17
  scripts/sync-localmind.mjs. Model weights are not distributed: each model is downloaded by the user under its own
17
- terms (Gemma: https://ai.google.dev/gemma/terms; Qwen3.6: Apache-2.0).
18
+ terms (Gemma: https://ai.google.dev/gemma/terms; Qwen3.6: Apache-2.0; each other model under its own license).