diskformer 0.0.1 → 0.3.0

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 ADDED
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ ## 0.3.0 (2026-10-07)
4
+ - `fileFetch(blob)`: ingest a GGUF that is already on disk (a `File` the user picked, e.g. from a Hugging Face or
5
+ LM Studio cache) through `ingestGguf({ fetch: fileFetch(file) })`, with no download. The store is byte-identical to a
6
+ download's, and an interrupted file ingest resumes from the same file (`test/ingest-resume.test.mjs`).
7
+ - `engines/`: `load({ localFile })` ingests the pinned GGUF from a local file, refusing a file of another size.
8
+
9
+ ## 0.2.0 (2026-10-05)
10
+ - `engines/`: reference WebGPU engines for Gemma 4 26B-A4B (`Gemma4MoeSsd`), Qwen3.6 35B-A3B (`Qwen35MoeSsd`) and
11
+ Qwen3-30B-A3B (`Qwen3MoeSsd`), copied from LocalMind with import paths rewritten (`scripts/sync-localmind.mjs`).
12
+ `gpuBudgetBytes` sizes the expert cache to fit a GPU memory budget; `root` picks the OPFS folder. Kernels ported
13
+ from gemma4-webgpu (Apache-2.0, `engines/NOTICE`).
14
+ - `examples/chat`: one page that downloads a model into OPFS and chats under a GPU budget. Gemma 4 26B-A4B (14.4 GB)
15
+ at a 2.5 GB budget: 2.02 GB on the GPU, 9/9 replies identical to llama.cpp b9830 Metal.
16
+ - `ingestGguf` resumes an interrupted ingest from its last 1 GiB checkpoint, only into the same source (header, size,
17
+ ETag) and output layout, and closes every file when it fails. Progress events carry `resumedFrom`.
18
+ - `examples/run-demo.mjs`: a `chat` gate (`--budget`, `--models`, `--site` for a deployed copy), browser test pages,
19
+ local GGUF serving with HTTP Range (416 / 400 / symlink-confined).
20
+ - Tests: `test/ingest-resume.test.mjs` (fake OPFS: abort twice, changed source, failures);
21
+ `test/browser/ingest-resume.html` (real OPFS, every byte vs a clean ingest); `test/browser/server.html`.
22
+ - `scripts/build-space.mjs` and a Hugging Face Space: https://huggingface.co/spaces/naklitechie/diskformer-chat
23
+
24
+ ## 0.1.0 (2026-10-05)
25
+ - Store: `OpfsReaderPool`, `OpfsWriter` and OPFS helpers (byte-identical to LocalMind's `opfs-reader.js`); `ingestGguf`
26
+ with `root` and `format` options (extracted from LocalMind's `qwen3_moe_ssd.js`; output byte-identical on an 8 GB
27
+ Gemma 4 GGUF); `parseGguf`, `tensorBytes`, `splitQ8`, `splitQ4`; `measure()` (new).
28
+ - Residency: `ExpertStreamer` / `RecordPool` (byte-identical to LocalMind's `moe-expert-stream.js`); `RowFile`,
29
+ `RowCache`, `fingerprint` with a `root` option (from LocalMind's `ple-opfs.js`, Gemma helpers left in LocalMind).
30
+ - Tests: Node unit tests (`npm test`); a headless-Chrome demo that checks every resident row on the GPU.
31
+
32
+ ## 0.0.1 (2026-10-04)
33
+ - Name placeholder on npm (README and LICENSE only).
package/README.md CHANGED
@@ -1,44 +1,120 @@
1
1
  <h1 align="center">diskformer.js</h1>
2
2
 
3
- **Keep model weights on disk in the browser, and page into WebGPU only what each step needs.**
4
- A disk tier for in-browser inference — not another engine.
3
+ **Run a model larger than your GPU memory in a browser tab.** The weights stay on disk in the browser's private
4
+ storage (OPFS); WebGPU holds only what each step needs. A disk tier for in-browser inference, with two reference
5
+ engines that use it.
5
6
 
6
- Plain ES modules. Chromium with WebGPU. No server, no build step, no telemetry.
7
+ Plain ES modules, no dependencies, no build step. Chromium with WebGPU. Weights stay in the user's own browser storage.
7
8
 
8
- > **Status: pre-release.** The code runs today inside [LocalMind](https://github.com/NakliTechie/LocalMind).
9
- > v0.1 extracts it here with no behaviour change. `0.0.x` on npm is a name placeholder.
9
+ [![npm](https://img.shields.io/npm/v/diskformer?style=flat-square&color=555)](https://www.npmjs.com/package/diskformer)
10
+ [![license](https://img.shields.io/badge/license-MIT-555?style=flat-square)](LICENSE)
11
+ [![dependencies](https://img.shields.io/badge/dependencies-none-555?style=flat-square)](package.json)
10
12
 
11
13
  ## Install
12
14
 
13
15
  | How | Command |
14
16
  |---|---|
15
- | npm | `npm install diskformer` *(from v0.1)* |
16
- | CDN | `import { … } from 'https://cdn.jsdelivr.net/npm/diskformer/+esm'` *(from v0.1)* |
17
+ | npm | `npm install diskformer` |
18
+ | CDN | `import { Gemma4MoeSsd } from 'https://cdn.jsdelivr.net/npm/diskformer@0.3/engines/gemma4_moe_ssd.js'` |
19
+ | Copy | `src/`, `engines/` and `index.js`; nothing else is needed |
17
20
 
18
- TODO(v0.1): the first call — copy a weights file into OPFS once, open a GPU row cache or expert pool on your
19
- `GPUDevice`, and read what a step needs.
21
+ ## Try it: a 14.4 GB model in 2.5 GB of GPU memory
22
+
23
+ Open [diskformer.naklitechie.com](https://diskformer.naklitechie.com/) (also on a [Hugging Face Space](https://huggingface.co/spaces/naklitechie/diskformer-chat)), or serve `examples/chat` yourself.
24
+ Pick a model and a GPU memory budget. The page downloads the model once into OPFS, resumably, then chats.
25
+
26
+ ```bash
27
+ python3 -m http.server 8000 # then open http://localhost:8000/examples/chat/
28
+ ```
29
+
30
+ Measured on a MacBook M4 Pro with 24 GB, Chrome 154, on 2026-10-05:
31
+
32
+ | Model | On disk | GPU budget | GPU memory used | Decode | Output |
33
+ |---|---|---|---|---|---|
34
+ | Gemma 4 26B-A4B, QAT Q4_0 | 14.4 GB | 2.5 GB | 2.02 GB | 12.4 tok/s | 9/9 replies identical to llama.cpp |
35
+ | Gemma 4 26B-A4B, QAT Q4_0 | 14.4 GB | 4.3 GB | 3.93 GB | 14.2 tok/s | 9/9 |
36
+ | Gemma 4 26B-A4B, QAT Q4_0 | 14.4 GB | 7 GB | 6.63 GB | 17.9 tok/s | 9/9 |
37
+ | Qwen3.6 35B-A3B, Q8_0 | 36.9 GB | 4 GB | 3.52 GB | 9.2 tok/s | not compared |
38
+
39
+ "Identical" means the reply text matches llama.cpp b9830's Metal path character for character, on the same GGUF.
40
+ llama-server echoes Gemma's empty thought-channel marker before each reply; the gate removes that marker first. The
41
+ test covers 9 conversations, greedy decoding, up to 64 tokens each. Qwen3.6 has no llama.cpp comparison: its Metal path cannot
42
+ hold 36.9 GB on this Mac.
43
+
44
+ Each row is `node examples/run-demo.mjs chat --budget <GB>`; decode is the median over the 9 replies. A larger budget
45
+ caches more experts. Only Apple silicon is tested; discrete GPUs and 8–16 GB machines are not.
46
+
47
+ In your own page:
48
+
49
+ ```js
50
+ import { Gemma4MoeSsd } from 'diskformer/engines/gemma4_moe_ssd.js';
51
+
52
+ const engine = await Gemma4MoeSsd.load(null, { gpuBudgetBytes: 3e9, onProgress: console.log });
53
+ for await (const { text } of engine.generate([{ role: 'user', content: 'Hello' }], { maxNewTokens: 128 })) show(text);
54
+ ```
55
+
56
+ The first load downloads the GGUF from Hugging Face and copies it into OPFS in the engine's layout. Later loads take
57
+ seconds.
20
58
 
21
59
  ## Why
22
60
 
23
61
  Your model does not fit on the GPU, or it fits only by crowding out everything else. Browser engines load every
24
- weight onto the GPU at load time, including the ones a step never touches: Gemma 4's per-layer embedding table is
25
- read one row per token, and a mixture-of-experts model uses under a tenth of its weights per token.
62
+ weight onto the GPU at load time, including the ones a step never touches. A mixture-of-experts model uses under a
63
+ tenth of its weights per token. Gemma 4's per-layer embedding table is read one row per token.
64
+
65
+ diskformer keeps those weights in OPFS, read through sync access handles in workers. Only what each step needs
66
+ moves into a GPU cache. The core is the store and the residency layer: your engine keeps its own kernels and decides
67
+ what a step needs. `engines/` shows two complete engines built on it.
68
+
69
+ ## The engines
70
+
71
+ `engines/gemma4_moe_ssd.js` runs Gemma 4 26B-A4B. `engines/qwen35_moe_ssd.js` runs Qwen3.6 35B-A3B, and
72
+ `engines/qwen3_moe_ssd.js` runs Qwen3-30B-A3B as their base. They are from-scratch WebGPU engines. The dense layers and
73
+ KV cache live on the GPU. The experts stream from OPFS into a GPU cache, sized by `gpuBudgetBytes`. A budget that
74
+ cannot hold the dense part and two tokens' experts is refused with the numbers. Decoding is greedy. The kernels are
75
+ ported from gemma4-webgpu (Apache-2.0, `engines/NOTICE`). The engine files are LocalMind's, kept in step by
76
+ `scripts/sync-localmind.mjs`.
77
+
78
+ ## A table on disk
79
+
80
+ `RowFile` holds fixed-size rows in one OPFS file with a manifest, written once and validated by a fingerprint.
81
+ `RowCache` keeps `slots` rows on the GPU, split into planes when a row's parts live in different buffers, with an
82
+ O(1) LRU and an optional GPU id→slot map that kernels can read. `examples/embedding` is the whole loop in one page.
83
+
84
+ ## Experts on disk
85
+
86
+ `ingestGguf({ url, key, plan })` streams a GGUF over HTTP ranges into OPFS in your engine's layout: `plan.layout` says
87
+ where each tensor goes, `plan.units` the byte ranges to copy or split (Q8_0 and Q4_0 blocks become a value plane and an
88
+ f16-scale plane, bit-exact). It resumes from its last 1 GiB checkpoint. For a GGUF already on disk, pass a picked `File`
89
+ as `fetch: fileFetch(file)`: no download, same store. `ExpertStreamer` (also `RecordPool`) keeps a fixed GPU slot pool
90
+ of expert records: `ensure(layer, ids)` returns pinned slots, `prefetch(layer, guesses)` never blocks, and uploads go
91
+ through a mapped staging ring.
92
+
93
+ `measure({ path, recordBytes })` reports sequential MB/s and random record reads; OPFS speed varies by machine.
94
+
95
+ ## Commands
26
96
 
27
- diskformer.js keeps those weights in OPFS — the browser's private file system, read through sync access handles in
28
- workers — and pages into a GPU cache only what each step needs. What it does today, inside LocalMind:
97
+ ```bash
98
+ npm test # Node unit tests: record pool, row cache, GGUF parse and splits, ingest helpers
99
+ node examples/run-demo.mjs rows # headless Chrome: a 64 MB table on disk, 2,048 rows on the GPU, every byte checked
100
+ node examples/run-demo.mjs embedding # lookup → slots → a WGSL gather kernel, every output value checked
101
+ node examples/run-demo.mjs chat --budget 2.5 # downloads Gemma once (14.4 GB) to a fixed profile, replays 9 llama.cpp replies, fails on any difference
102
+ node examples/run-demo.mjs test/browser/ingest-resume.html --models <dir> --file <gguf> # abort, resume, compare bytes
103
+ node examples/run-demo.mjs test/browser/server.html --models <dir> --file <any file> # the runner's file server rejects bad requests
104
+ npm run sync # the files shared with LocalMind match their sources
105
+ ```
29
106
 
30
- - **Gemma 4 E2B:** the 1.2 GB per-layer embedding table on disk; Chrome's GPU process drops from 4.27 GB to 2.07 GB on
31
- the live site, with identical output.
32
- - **Qwen3.6-35B-A3B (36.9 GB), experimental:** experts paged from OPFS on a 24 GB Mac; greedy output matches
33
- llama.cpp's Metal backend 8/8 on 4- and 16-layer cuts of the same GGUF.
107
+ ## Verify it yourself
34
108
 
35
- ## Context
109
+ `node examples/run-demo.mjs chat` runs the chat page in headless Chrome under a GPU budget and replays
110
+ `examples/chat/refs/gemma.json` (llama.cpp's replies); any differing reply exits 1. `--models <dir>` serves a local
111
+ GGUF instead of downloading it; `--site <url>` gates a deployed copy, such as the Space.
36
112
 
37
- Extracted from LocalMind's SSD-streaming work (2026-10-02 to 2026-10-04): `opfs-reader.js` (OPFS reader pool and
38
- writer), `moe-expert-stream.js` (GPU slot pool with eviction, pins, prefetch and mapped staging-ring uploads) and
39
- `ple-opfs.js` (row file and GPU row cache). v0.1 scope is those two layers — store and residency — moved here with no
40
- behaviour change and verified by LocalMind's existing gates.
113
+ The code runs in [LocalMind](https://github.com/NakliTechie/LocalMind) on its live site. `src/` (all but `measure.js`)
114
+ and `engines/` are byte-identical to LocalMind's copies, apart from the engines' import paths.
41
115
 
42
116
  ## License
43
117
 
44
- MIT · LocalMind: [github.com/NakliTechie/LocalMind](https://github.com/NakliTechie/LocalMind)
118
+ MIT. `engines/` contains kernels ported from Apache-2.0 code: see `engines/NOTICE`. Model weights are not
119
+ distributed; each model is downloaded under its own terms. Pointers:
120
+ [LocalMind](https://github.com/NakliTechie/LocalMind) · `CHANGELOG.md`.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Tyler Straub
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/engines/NOTICE ADDED
@@ -0,0 +1,17 @@
1
+ diskformer.js — engines/
2
+
3
+ The WGSL kernels in these engines are ports of browser-big-fast-lab's custom-kernels engine, an Apache-2.0
4
+ fork of gemma4-webgpu:
5
+
6
+ gemma4-webgpu
7
+ Copyright 2026 Tyler Straub
8
+ Licensed under the Apache License, Version 2.0 (engines/LICENSE-APACHE)
9
+ https://github.com/tylerstraub/gemma4-webgpu
10
+
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
13
+ this folder is MIT (../LICENSE), Copyright (c) 2026 Chirag Patnaik.
14
+
15
+ The engine files are copies of LocalMind's (https://github.com/NakliTechie/LocalMind), kept in step by
16
+ 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).