Spaces:
Running
Running
NakliTechie commited on
Commit ·
b17e86d
1
Parent(s): f5a958f
Sync from GitHub 2026-10-24T09:23:34Z
Browse files- index.html +50 -12
index.html
CHANGED
|
@@ -2689,6 +2689,7 @@
|
|
| 2689 |
<li><strong>LFM2.5 24B-A2B · SSD-streamed (experimental)</strong> (~13.6 GB) — text, reasoning-only. Liquid AI's LFM2.5-24B-A2B (released 2026-10-13): a 24B mixture-of-experts (64 experts, 4 active per token, about 2.4B parameters per token) with short-convolution and attention layers, from Liquid's own 4-bit GGUF. Short-convolution and attention layers, routers and KV cache stay on the GPU while the 2,432 routed experts stream from on-device storage (OPFS) as the router picks them. The first load copies the model into this browser's storage once (~13.6 GB of disk). About 16 tokens/s on an M4 Pro with 24 GB, and prompts are read in chunks at about 50 tokens/s. Greedy output matches llama.cpp (8 of 8 prompts). It always reasons before it answers, so every reply opens with its reasoning. It can use tools (calculator, time, memory, reminders): it called the right tool on 6 of 6 test prompts and answered 5 of 5 plain questions without one.</li>
|
| 2690 |
<li><strong>Flint 40B-A2.5B · SSD-streamed (experimental)</strong> (~26 GB) — text, coding, reasoning. Recursive's Flint (released 2026-10-21, Apache-2.0): a 39.8B mixture-of-experts coding model (256 experts, 6 active per token, about 2.5B parameters per token), from Recursive's own 4-bit (Q4_1) GGUF, whose card asks for 48 GB of memory under llama.cpp. Attention, routers, the token table and KV cache stay on the GPU while the 12,032 routed experts stream from on-device storage (OPFS) as the router picks them. The first load copies the model into this browser's storage once (~26 GB of disk). About 8.7 tokens/s on an M4 Pro with 24 GB, and prompts are read at about 27 tokens/s. Its output stays as close to llama.cpp's Metal backend as llama.cpp's own CPU backend does. It reasons before it answers, so replies open with its reasoning. Tools are off for now.</li>
|
| 2691 |
<li><strong>Ling 3.0 Flash 124B-A5B · via anyformer (experimental)</strong> (~81 GB) — text, reasoning. inclusionAI's Ling 3.0 Flash (released 2026-08-02, MIT): a 124B mixture-of-experts (512 experts, 8 active per token, about 5.1B parameters per token) whose layers mix linear attention (KDA) and latent attention (MLA), from inclusionAI's own 4-bit Q4_K_M GGUF (77 GB in two parts). anyformer loads it on diskformer's engine for it, which keeps the attention, routers and caches on the GPU (about 2.5 GB plus a 4 GB expert cache; it needs about 7 GB of GPU memory) and streams the 20,480 routed experts from on-device storage (OPFS). The first load copies the model into this browser's storage once (~81 GB of disk). About 5.5 tokens/s on an M4 Pro with 24 GB, and prompts are read at about 5 tokens/s. Flip <strong>Show reasoning</strong> for its thinking. Tools are off for now.</li>
|
|
|
|
| 2692 |
<li><strong>GLM-4.7-Flash 30B-A3B · via anyformer (experimental)</strong> (~18 GB) — text, reasoning. Z.ai's GLM-4.7-Flash, a 30B mixture-of-experts with about 3B parameters per token, from unsloth's 4-bit GGUF (18.3 GB). LocalMind has no engine of its own for it: anyformer picks diskformer's llama.cpp path, which runs llama.cpp's WebGPU build in a worker and pages the experts in from on-device storage (OPFS). The first load copies the file into this browser's storage once. Flip <strong>Show reasoning</strong> for its thinking. Tools are off for now.</li>
|
| 2693 |
<li><strong>Qwen3 4B · FlashMap speculative (experimental)</strong> (~5.2 GB) — text, reasoning. Qwen's Qwen3-4B (Q8_0 GGUF, 4.3 GB) with FlashMap, a speculative-decoding drafter by Shen et al. (arXiv:2610.24365; 0.95 GB) that proposes 16 tokens in one step for the model to check in one pass. You get exactly the tokens the model would write on its own, sooner: on an M4 Pro about 2.1–2.2× on maths and 1.2–1.5× on code. Chat text drafts poorly, so there it falls back to plain decoding (about 0.7–1.1×). Both files are copied into this browser's storage once. Tools are off for now.</li>
|
| 2694 |
</ul>
|
|
@@ -3008,6 +3009,7 @@
|
|
| 3008 |
<option value="lfm25-24b-a2b-ssd">LFM2.5 24B-A2B · SSD-streamed, experimental (~13.6 GB)</option>
|
| 3009 |
<option value="flint-40b-a2b-ssd">Flint 40B-A2.5B · SSD-streamed, experimental, coding (~26 GB)</option>
|
| 3010 |
<option value="ling-3-flash-anyformer">Ling 3.0 Flash 124B-A5B · via anyformer, experimental (~81 GB)</option>
|
|
|
|
| 3011 |
<option value="glm-4.7-flash-anyformer">GLM-4.7-Flash 30B-A3B · via anyformer, experimental (~18 GB)</option>
|
| 3012 |
<option value="qwen3-4b-flashmap">Qwen3 4B · FlashMap speculative decoding, experimental (~5.2 GB)</option>
|
| 3013 |
</select>
|
|
@@ -8017,7 +8019,7 @@ const engineFetch = async (url, init = {}) => {
|
|
| 8017 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy
|
| 8018 |
// of the engine (Gemma4Mobile) and, with ple, builds the OPFS per-layer-embedding table itself. The worker then drives
|
| 8019 |
// session.engine exactly as it drove its own engine. Pinned to the same anyformer as anyformer_models.js.
|
| 8020 |
-
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/
|
| 8021 |
|
| 8022 |
let anyformerLoad = null;
|
| 8023 |
let session = null;
|
|
@@ -8162,7 +8164,7 @@ self.onmessage = async (e) => {
|
|
| 8162 |
// rolled-in module URLs (moduleUrl()).
|
| 8163 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
|
| 8164 |
// the engine (TernaryBonsai2); the worker drives session.engine as before and attaches DFlash / MTP itself.
|
| 8165 |
-
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/
|
| 8166 |
const DFLASH_URL = '__TERNARY_BONSAI2_DFLASH_URL__';
|
| 8167 |
const MTP_URL = '__TERNARY_BONSAI2_MTP_URL__';
|
| 8168 |
// MTP speculative decoding (Settings → Models, default OFF; posted as `mtp` + `mtpDepth` on the
|
|
@@ -9428,6 +9430,20 @@ self.addEventListener('message', async (e) => {
|
|
| 9428 |
contextSize: 4096,
|
| 9429 |
genConfig: { max_new_tokens: 2048 },
|
| 9430 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9431 |
'glm-4.7-flash-anyformer': {
|
| 9432 |
id: 'unsloth/GLM-4.7-Flash-GGUF',
|
| 9433 |
label: 'GLM-4.7-Flash 30B-A3B · via anyformer (experimental)',
|
|
@@ -17795,6 +17811,7 @@ self.addEventListener('message', async (e) => {
|
|
| 17795 |
'anyformer-qwen36': { engine: 'anyformer_models.js', exportName: 'Qwen36', label: 'Qwen3.6 35B-A3B (Q8_0, via anyformer)' },
|
| 17796 |
'anyformer-ling3flash': { engine: 'anyformer_models.js', exportName: 'Ling3Flash', label: 'Ling 3.0 Flash (Q4_K_M, via anyformer)' },
|
| 17797 |
'anyformer-glm47flash': { engine: 'anyformer_models.js', exportName: 'Glm47Flash', label: 'GLM-4.7-Flash (Q4_K_M, via anyformer)' },
|
|
|
|
| 17798 |
'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
|
| 17799 |
'hyv3-ssd': { engine: 'hy_v3_moe_ssd.js', exportName: 'HyV3MoeSsd', label: 'Hy-Memory 30B-A3B (Q8_0)' }, // the memory writer only (WRITER_MODELS)
|
| 17800 |
'qwen35dense': { engine: 'qwen35_dense.js', exportName: 'Qwen35Dense', label: 'Underdog Saluki 27B (IQ2-mix)' },
|
|
@@ -19406,7 +19423,7 @@ self.addEventListener('message', async (e) => {
|
|
| 19406 |
const ENGINE_STORES = {
|
| 19407 |
'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
|
| 19408 |
'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
|
| 19409 |
-
'qwen35moe-ssd': ['on disk (OPFS)'], 'minicpmv-ssd': ['on disk (OPFS)'], 'gemma4moe-ssd': ['on disk (OPFS)'], 'lfm2moe-ssd': ['on disk (OPFS)'], 'flint-ssd': ['on disk (OPFS)'], 'anyformer-glm47flash': ['on disk (OPFS)'], 'anyformer-ling3flash': ['on disk (OPFS)'], 'anyformer-qwen36': ['on disk (OPFS)'], 'anyformer-flint': ['on disk (OPFS)'], 'anyformer-lfm25-24b': ['on disk (OPFS)'], 'anyformer-gemma26b': ['on disk (OPFS)'], 'qwen3dense': ['on disk (OPFS)'], 'qwen35dense': ['on disk (OPFS)'],
|
| 19410 |
};
|
| 19411 |
function parseSizeBytes(size) {
|
| 19412 |
const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
|
|
@@ -24042,32 +24059,45 @@ self.addEventListener('message', async (e) => {
|
|
| 24042 |
*/
|
| 24043 |
const THINK_CLOSE = -2;
|
| 24044 |
|
| 24045 |
-
export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/
|
| 24046 |
|
| 24047 |
// anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
|
| 24048 |
// into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
|
| 24049 |
-
// bytes while it ingests and with kind 'tensors' while it uploads, and 'init'
|
| 24050 |
-
//
|
| 24051 |
-
|
|
|
|
|
|
|
| 24052 |
if (!e) return null;
|
| 24053 |
if (e.status === 'download') return { status: 'weights', loaded: e.loaded, total: e.total };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24054 |
if (e.status === 'weights') return { status: 'weights', kind: e.kind, loaded: e.loaded, total: e.total };
|
| 24055 |
if (e.status === 'load' || e.status === 'plan' || e.status === 'init') return { status: 'init' };
|
| 24056 |
return null;
|
| 24057 |
}
|
| 24058 |
|
| 24059 |
export class AnyformerModel {
|
|
|
|
|
|
|
|
|
|
| 24060 |
static repo = null;
|
| 24061 |
static file = undefined; // a GGUF in the repo; undefined lets anyformer pick (the file diskformer checked)
|
| 24062 |
static budget = 4e9; // GPU bytes: the llama.cpp path plans its expert slots from it; for a hand engine, the fit check
|
| 24063 |
static poolBytes = undefined; // a hand engine's expert cache (LocalMind's own engines ran with 4 GiB)
|
| 24064 |
|
| 24065 |
static async load(_id, opts = {}) {
|
| 24066 |
-
const { load } = await import(ANYFORMER_URL);
|
| 24067 |
-
const
|
| 24068 |
-
|
|
|
|
|
|
|
| 24069 |
...(this.poolBytes ? { poolBytes: this.poolBytes } : {}), ...(opts.localFile ? { localFile: opts.localFile } : {}),
|
| 24070 |
-
onProgress: (e) => { const ev = toEngineProgress(e); if (ev && opts.onProgress) opts.onProgress(ev); },
|
| 24071 |
});
|
| 24072 |
return new this(session);
|
| 24073 |
}
|
|
@@ -24150,6 +24180,14 @@ export class Flint40B extends AnyformerModel {
|
|
| 24150 |
static poolBytes = 4 * 2 ** 30;
|
| 24151 |
}
|
| 24152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24153 |
// LFM2.5 24B-A2B: Liquid AI's QAD-Q4_0 GGUF (13.6 GB) on diskformer's Lfm2MoeSsd hand engine (anyformer v0.4.2+). It
|
| 24154 |
// always reasons; session.think carries the markers. A 4 GiB expert cache as before.
|
| 24155 |
export class Lfm25_24B extends AnyformerModel {
|
|
@@ -32388,7 +32426,7 @@ const GGUF_FILE = 'LFM2.5-230M-Q4_0.gguf';
|
|
| 32388 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
|
| 32389 |
// the LFM2.5 engine (Lfm2Mobile) and returns a session with the same generate / reset / dispose. Pinned to an exact
|
| 32390 |
// version; LocalMind's anyformer_models.js pins the same one.
|
| 32391 |
-
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/
|
| 32392 |
|
| 32393 |
let anyformerLoad = null;
|
| 32394 |
let model = null;
|
|
|
|
| 2689 |
<li><strong>LFM2.5 24B-A2B · SSD-streamed (experimental)</strong> (~13.6 GB) — text, reasoning-only. Liquid AI's LFM2.5-24B-A2B (released 2026-10-13): a 24B mixture-of-experts (64 experts, 4 active per token, about 2.4B parameters per token) with short-convolution and attention layers, from Liquid's own 4-bit GGUF. Short-convolution and attention layers, routers and KV cache stay on the GPU while the 2,432 routed experts stream from on-device storage (OPFS) as the router picks them. The first load copies the model into this browser's storage once (~13.6 GB of disk). About 16 tokens/s on an M4 Pro with 24 GB, and prompts are read in chunks at about 50 tokens/s. Greedy output matches llama.cpp (8 of 8 prompts). It always reasons before it answers, so every reply opens with its reasoning. It can use tools (calculator, time, memory, reminders): it called the right tool on 6 of 6 test prompts and answered 5 of 5 plain questions without one.</li>
|
| 2690 |
<li><strong>Flint 40B-A2.5B · SSD-streamed (experimental)</strong> (~26 GB) — text, coding, reasoning. Recursive's Flint (released 2026-10-21, Apache-2.0): a 39.8B mixture-of-experts coding model (256 experts, 6 active per token, about 2.5B parameters per token), from Recursive's own 4-bit (Q4_1) GGUF, whose card asks for 48 GB of memory under llama.cpp. Attention, routers, the token table and KV cache stay on the GPU while the 12,032 routed experts stream from on-device storage (OPFS) as the router picks them. The first load copies the model into this browser's storage once (~26 GB of disk). About 8.7 tokens/s on an M4 Pro with 24 GB, and prompts are read at about 27 tokens/s. Its output stays as close to llama.cpp's Metal backend as llama.cpp's own CPU backend does. It reasons before it answers, so replies open with its reasoning. Tools are off for now.</li>
|
| 2691 |
<li><strong>Ling 3.0 Flash 124B-A5B · via anyformer (experimental)</strong> (~81 GB) — text, reasoning. inclusionAI's Ling 3.0 Flash (released 2026-08-02, MIT): a 124B mixture-of-experts (512 experts, 8 active per token, about 5.1B parameters per token) whose layers mix linear attention (KDA) and latent attention (MLA), from inclusionAI's own 4-bit Q4_K_M GGUF (77 GB in two parts). anyformer loads it on diskformer's engine for it, which keeps the attention, routers and caches on the GPU (about 2.5 GB plus a 4 GB expert cache; it needs about 7 GB of GPU memory) and streams the 20,480 routed experts from on-device storage (OPFS). The first load copies the model into this browser's storage once (~81 GB of disk). About 5.5 tokens/s on an M4 Pro with 24 GB, and prompts are read at about 5 tokens/s. Flip <strong>Show reasoning</strong> for its thinking. Tools are off for now.</li>
|
| 2692 |
+
<li><strong>Nemotron 3.5 Bolt E4B · via anyformer (experimental)</strong> (~4.9 GB) — text. NVIDIA's Nemotron 3.5 Bolt E4B, a dense model with about 4B effective parameters, post-trained from Google's Gemma 4 E4B. It runs on Transformers.js through anyformer, from a community 4-bit ONNX conversion (text only), at about 35 tokens a second on an M4 Pro. Reasoning and tools are off for now.</li>
|
| 2693 |
<li><strong>GLM-4.7-Flash 30B-A3B · via anyformer (experimental)</strong> (~18 GB) — text, reasoning. Z.ai's GLM-4.7-Flash, a 30B mixture-of-experts with about 3B parameters per token, from unsloth's 4-bit GGUF (18.3 GB). LocalMind has no engine of its own for it: anyformer picks diskformer's llama.cpp path, which runs llama.cpp's WebGPU build in a worker and pages the experts in from on-device storage (OPFS). The first load copies the file into this browser's storage once. Flip <strong>Show reasoning</strong> for its thinking. Tools are off for now.</li>
|
| 2694 |
<li><strong>Qwen3 4B · FlashMap speculative (experimental)</strong> (~5.2 GB) — text, reasoning. Qwen's Qwen3-4B (Q8_0 GGUF, 4.3 GB) with FlashMap, a speculative-decoding drafter by Shen et al. (arXiv:2610.24365; 0.95 GB) that proposes 16 tokens in one step for the model to check in one pass. You get exactly the tokens the model would write on its own, sooner: on an M4 Pro about 2.1–2.2× on maths and 1.2–1.5× on code. Chat text drafts poorly, so there it falls back to plain decoding (about 0.7–1.1×). Both files are copied into this browser's storage once. Tools are off for now.</li>
|
| 2695 |
</ul>
|
|
|
|
| 3009 |
<option value="lfm25-24b-a2b-ssd">LFM2.5 24B-A2B · SSD-streamed, experimental (~13.6 GB)</option>
|
| 3010 |
<option value="flint-40b-a2b-ssd">Flint 40B-A2.5B · SSD-streamed, experimental, coding (~26 GB)</option>
|
| 3011 |
<option value="ling-3-flash-anyformer">Ling 3.0 Flash 124B-A5B · via anyformer, experimental (~81 GB)</option>
|
| 3012 |
+
<option value="nemotron-bolt-e4b-anyformer">Nemotron 3.5 Bolt E4B · via anyformer, experimental (~4.9 GB)</option>
|
| 3013 |
<option value="glm-4.7-flash-anyformer">GLM-4.7-Flash 30B-A3B · via anyformer, experimental (~18 GB)</option>
|
| 3014 |
<option value="qwen3-4b-flashmap">Qwen3 4B · FlashMap speculative decoding, experimental (~5.2 GB)</option>
|
| 3015 |
</select>
|
|
|
|
| 8019 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy
|
| 8020 |
// of the engine (Gemma4Mobile) and, with ple, builds the OPFS per-layer-embedding table itself. The worker then drives
|
| 8021 |
// session.engine exactly as it drove its own engine. Pinned to the same anyformer as anyformer_models.js.
|
| 8022 |
+
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.6/index.js';
|
| 8023 |
|
| 8024 |
let anyformerLoad = null;
|
| 8025 |
let session = null;
|
|
|
|
| 8164 |
// rolled-in module URLs (moduleUrl()).
|
| 8165 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
|
| 8166 |
// the engine (TernaryBonsai2); the worker drives session.engine as before and attaches DFlash / MTP itself.
|
| 8167 |
+
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.6/index.js';
|
| 8168 |
const DFLASH_URL = '__TERNARY_BONSAI2_DFLASH_URL__';
|
| 8169 |
const MTP_URL = '__TERNARY_BONSAI2_MTP_URL__';
|
| 8170 |
// MTP speculative decoding (Settings → Models, default OFF; posted as `mtp` + `mtpDepth` on the
|
|
|
|
| 9430 |
contextSize: 4096,
|
| 9431 |
genConfig: { max_new_tokens: 2048 },
|
| 9432 |
},
|
| 9433 |
+
// backend:'anyformer-bolt-e4b' → NVIDIA's Nemotron 3.5 Bolt E4B through anyformer, which sends it to transformers.js
|
| 9434 |
+
// (a community q4f16 ONNX, text only). Reasoning off: anyformer's text-only Gemma 4 path renders the template without it.
|
| 9435 |
+
'nemotron-bolt-e4b-anyformer': {
|
| 9436 |
+
id: 'danyalmalik/NVIDIA-Nemotron-3.5-Bolt-E4B-ONNX-WebGPU',
|
| 9437 |
+
label: 'Nemotron 3.5 Bolt E4B · via anyformer (experimental)',
|
| 9438 |
+
backend: 'anyformer-bolt-e4b',
|
| 9439 |
+
size: '~4.9 GB',
|
| 9440 |
+
type: 'causal',
|
| 9441 |
+
multimodal: false,
|
| 9442 |
+
agentCapable: false,
|
| 9443 |
+
thinking: false,
|
| 9444 |
+
contextSize: 4096,
|
| 9445 |
+
genConfig: { max_new_tokens: 2048 },
|
| 9446 |
+
},
|
| 9447 |
'glm-4.7-flash-anyformer': {
|
| 9448 |
id: 'unsloth/GLM-4.7-Flash-GGUF',
|
| 9449 |
label: 'GLM-4.7-Flash 30B-A3B · via anyformer (experimental)',
|
|
|
|
| 17811 |
'anyformer-qwen36': { engine: 'anyformer_models.js', exportName: 'Qwen36', label: 'Qwen3.6 35B-A3B (Q8_0, via anyformer)' },
|
| 17812 |
'anyformer-ling3flash': { engine: 'anyformer_models.js', exportName: 'Ling3Flash', label: 'Ling 3.0 Flash (Q4_K_M, via anyformer)' },
|
| 17813 |
'anyformer-glm47flash': { engine: 'anyformer_models.js', exportName: 'Glm47Flash', label: 'GLM-4.7-Flash (Q4_K_M, via anyformer)' },
|
| 17814 |
+
'anyformer-bolt-e4b': { engine: 'anyformer_models.js', exportName: 'NemotronBoltE4B', label: 'Nemotron 3.5 Bolt E4B (q4f16 ONNX, via anyformer)' },
|
| 17815 |
'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
|
| 17816 |
'hyv3-ssd': { engine: 'hy_v3_moe_ssd.js', exportName: 'HyV3MoeSsd', label: 'Hy-Memory 30B-A3B (Q8_0)' }, // the memory writer only (WRITER_MODELS)
|
| 17817 |
'qwen35dense': { engine: 'qwen35_dense.js', exportName: 'Qwen35Dense', label: 'Underdog Saluki 27B (IQ2-mix)' },
|
|
|
|
| 19423 |
const ENGINE_STORES = {
|
| 19424 |
'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
|
| 19425 |
'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
|
| 19426 |
+
'qwen35moe-ssd': ['on disk (OPFS)'], 'minicpmv-ssd': ['on disk (OPFS)'], 'gemma4moe-ssd': ['on disk (OPFS)'], 'lfm2moe-ssd': ['on disk (OPFS)'], 'flint-ssd': ['on disk (OPFS)'], 'anyformer-glm47flash': ['on disk (OPFS)'], 'anyformer-bolt-e4b': ['transformers-cache'], 'anyformer-ling3flash': ['on disk (OPFS)'], 'anyformer-qwen36': ['on disk (OPFS)'], 'anyformer-flint': ['on disk (OPFS)'], 'anyformer-lfm25-24b': ['on disk (OPFS)'], 'anyformer-gemma26b': ['on disk (OPFS)'], 'qwen3dense': ['on disk (OPFS)'], 'qwen35dense': ['on disk (OPFS)'],
|
| 19427 |
};
|
| 19428 |
function parseSizeBytes(size) {
|
| 19429 |
const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
|
|
|
|
| 24059 |
*/
|
| 24060 |
const THINK_CLOSE = -2;
|
| 24061 |
|
| 24062 |
+
export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.6/index.js';
|
| 24063 |
|
| 24064 |
// anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
|
| 24065 |
// into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
|
| 24066 |
+
// bytes while it ingests and with kind 'tensors' while it uploads, and 'init'; the transformers.js back end reports
|
| 24067 |
+
// transformers.js's own per-file 'progress', summed here over the files seen so far (`files`, one per load) so the
|
| 24068 |
+
// bar does not restart at each file. Every byte event must reach the worker: the page's load watchdog ends a load
|
| 24069 |
+
// that reports no progress for 3 minutes (the Ling production check, 2026-10-23).
|
| 24070 |
+
function toEngineProgress(e, files) {
|
| 24071 |
if (!e) return null;
|
| 24072 |
if (e.status === 'download') return { status: 'weights', loaded: e.loaded, total: e.total };
|
| 24073 |
+
if (e.status === 'progress' && e.file) {
|
| 24074 |
+
files.set(e.file, [e.loaded || 0, e.total || 0]);
|
| 24075 |
+
let loaded = 0, total = 0;
|
| 24076 |
+
for (const [l, t] of files.values()) { loaded += l; total += t; }
|
| 24077 |
+
return { status: 'weights', loaded, total };
|
| 24078 |
+
}
|
| 24079 |
if (e.status === 'weights') return { status: 'weights', kind: e.kind, loaded: e.loaded, total: e.total };
|
| 24080 |
if (e.status === 'load' || e.status === 'plan' || e.status === 'init') return { status: 'init' };
|
| 24081 |
return null;
|
| 24082 |
}
|
| 24083 |
|
| 24084 |
export class AnyformerModel {
|
| 24085 |
+
// A key of anyformer's MODELS.chat: anyformer's catalog then names the repo, the back end and the budget, so a
|
| 24086 |
+
// model moves between back ends with an anyformer release alone. repo / file / budget are for models not in it.
|
| 24087 |
+
static entry = null;
|
| 24088 |
static repo = null;
|
| 24089 |
static file = undefined; // a GGUF in the repo; undefined lets anyformer pick (the file diskformer checked)
|
| 24090 |
static budget = 4e9; // GPU bytes: the llama.cpp path plans its expert slots from it; for a hand engine, the fit check
|
| 24091 |
static poolBytes = undefined; // a hand engine's expert cache (LocalMind's own engines ran with 4 GiB)
|
| 24092 |
|
| 24093 |
static async load(_id, opts = {}) {
|
| 24094 |
+
const { load, MODELS } = await import(ANYFORMER_URL);
|
| 24095 |
+
const entry = this.entry && MODELS.chat[this.entry], files = new Map();
|
| 24096 |
+
if (this.entry && !entry) throw new Error(`anyformer has no MODELS.chat.${this.entry}`);
|
| 24097 |
+
const session = await load(entry || this.repo, {
|
| 24098 |
+
...(opts.budget || !entry ? { budget: opts.budget || this.budget } : {}), maxCtx: opts.maxCtx, signal: opts.signal, ...(this.file ? { file: this.file } : {}),
|
| 24099 |
...(this.poolBytes ? { poolBytes: this.poolBytes } : {}), ...(opts.localFile ? { localFile: opts.localFile } : {}),
|
| 24100 |
+
onProgress: (e) => { const ev = toEngineProgress(e, files); if (ev && opts.onProgress) opts.onProgress(ev); },
|
| 24101 |
});
|
| 24102 |
return new this(session);
|
| 24103 |
}
|
|
|
|
| 24180 |
static poolBytes = 4 * 2 ** 30;
|
| 24181 |
}
|
| 24182 |
|
| 24183 |
+
// NVIDIA's Nemotron 3.5 Bolt E4B (dense, 4B effective, post-trained from Gemma 4 E4B), by anyformer's catalog entry:
|
| 24184 |
+
// at v0.4.6 a community q4f16 ONNX on transformers.js, text only, 4.9 GB, 34-39 tok/s in Chrome (2026-10-24).
|
| 24185 |
+
// diskformer's llama.cpp path ran it at 30 tok/s and its DFlash drafter made it slower (24.7); when a drafter pays on
|
| 24186 |
+
// WebGPU, anyformer moves the entry back and LocalMind changes nothing.
|
| 24187 |
+
export class NemotronBoltE4B extends AnyformerModel {
|
| 24188 |
+
static entry = 'NEMOTRON_3_5_BOLT_E4B';
|
| 24189 |
+
}
|
| 24190 |
+
|
| 24191 |
// LFM2.5 24B-A2B: Liquid AI's QAD-Q4_0 GGUF (13.6 GB) on diskformer's Lfm2MoeSsd hand engine (anyformer v0.4.2+). It
|
| 24192 |
// always reasons; session.think carries the markers. A 4 GiB expert cache as before.
|
| 24193 |
export class Lfm25_24B extends AnyformerModel {
|
|
|
|
| 32426 |
// The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
|
| 32427 |
// the LFM2.5 engine (Lfm2Mobile) and returns a session with the same generate / reset / dispose. Pinned to an exact
|
| 32428 |
// version; LocalMind's anyformer_models.js pins the same one.
|
| 32429 |
+
const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.6/index.js';
|
| 32430 |
|
| 32431 |
let anyformerLoad = null;
|
| 32432 |
let model = null;
|