NakliTechie commited on
Commit
8d9f687
·
1 Parent(s): 53ebc1b

Sync from GitHub 2026-10-22T21:50:34Z

Browse files
Files changed (1) hide show
  1. index.html +45 -17
index.html CHANGED
@@ -9307,10 +9307,12 @@ self.addEventListener('message', async (e) => {
9307
  // on-device storage once (~37 GB of disk). Experimental: rung 2b of the SSD-streaming ladder,
9308
  // decode speed is bound by SSD reads (~9 tok/s on an M4 Pro), and prompts are read one token at
9309
  // a time. Greedy output matches llama.cpp Metal on layer cuts (plan/history.md, 2026-10-04).
 
 
9310
  'qwen36-35b-a3b-ssd': {
9311
  id: 'unsloth/Qwen3.6-35B-A3B-GGUF',
9312
  label: 'Qwen3.6 35B-A3B · SSD-streamed (experimental)',
9313
- backend: 'qwen35moe-ssd',
9314
  size: '~37 GB',
9315
  // The pinned GGUF (QWEN36_35B_A3B in qwen35_moe_ssd.js): "Load .gguf from disk…" routes a file of exactly
9316
  // this size here and ingests it instead of downloading. test-local-gguf-ssd.mjs keeps the two in step.
@@ -17777,6 +17779,7 @@ self.addEventListener('message', async (e) => {
17777
  'gemma4moe-ssd': { engine: 'gemma4_moe_ssd.js', exportName: 'Gemma4MoeSsd', label: 'Gemma 4 26B-A4B (Q4_0)' },
17778
  'lfm2moe-ssd': { engine: 'lfm2_moe_ssd.js', exportName: 'Lfm2MoeSsd', label: 'LFM2.5 24B-A2B (Q4_0)' },
17779
  'flint-ssd': { engine: 'flint_moe_ssd.js', exportName: 'FlintMoeSsd', label: 'Flint 40B-A2.5B (Q4_1)' },
 
17780
  'anyformer-ling3flash': { engine: 'anyformer_models.js', exportName: 'Ling3Flash', label: 'Ling 3.0 Flash (Q4_K_M, via anyformer)' },
17781
  'anyformer-glm47flash': { engine: 'anyformer_models.js', exportName: 'Glm47Flash', label: 'GLM-4.7-Flash (Q4_K_M, via anyformer)' },
17782
  'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
@@ -19395,7 +19398,7 @@ self.addEventListener('message', async (e) => {
19395
  const ENGINE_STORES = {
19396
  'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
19397
  'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
19398
- '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)'], 'qwen3dense': ['on disk (OPFS)'], 'qwen35dense': ['on disk (OPFS)'],
19399
  };
19400
  function parseSizeBytes(size) {
19401
  const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
@@ -24018,17 +24021,20 @@ self.addEventListener('message', async (e) => {
24018
  * anyformer picks the back end per model; LocalMind sees one call shape.
24019
  *
24020
  * AnyformerModel gives an anyformer session the engine interface LocalMind's SSD worker drives (moeSsdWorkerSrc):
24021
- * static load(null, { maxCtx, onProgress, signal }), generate(messages, { maxNewTokens, signal }) streaming
24022
- * { text }, reset(), dispose(), and the think markers. One subclass per model names its repo.
 
24023
  *
24024
- * anyformer loads from jsDelivr by GitHub tag until it is on npm. Through diskformer's llama.cpp path reasoning is off
24025
- * unless generate() passes { thinking: true } (llama.cpp path since anyformer v0.2.1, hand engines since v0.2.4), and the reply is text only (no token ids). With
24026
- * reasoning on, the reply opens inside the thought; the class drops the literal <think> and </think> from the text
24027
- * and marks the boundary with a chunk whose token is THINK_CLOSE (the worker's close event).
 
 
24028
  */
24029
  const THINK_CLOSE = -2;
24030
 
24031
- export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.2.5/index.js';
24032
 
24033
  // anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
24034
  // into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
@@ -24045,27 +24051,40 @@ function toEngineProgress(e) {
24045
  export class AnyformerModel {
24046
  static repo = null;
24047
  static file = undefined; // a GGUF in the repo; undefined lets anyformer pick (the file diskformer checked)
24048
- static budget = 4e9; // GPU bytes; the llama.cpp path plans its expert slots from it
 
24049
 
24050
  static async load(_id, opts = {}) {
24051
  const { load } = await import(ANYFORMER_URL);
24052
  const session = await load(this.repo, {
24053
  budget: opts.budget || this.budget, maxCtx: opts.maxCtx, signal: opts.signal, ...(this.file ? { file: this.file } : {}),
 
24054
  onProgress: (e) => { const ev = toEngineProgress(e); if (ev && opts.onProgress) opts.onProgress(ev); },
24055
  });
24056
  return new this(session);
24057
  }
24058
 
24059
- constructor(session) { this.session = session; this.backend = session.backend; }
 
 
 
 
 
24060
 
24061
- get thinkOpenTokenId() { return null; }
24062
- get thinkCloseTokenId() { return THINK_CLOSE; }
24063
- get thinkInPrompt() { return true; }
24064
- get alwaysThinks() { return false; }
 
24065
 
24066
- // The reply text without its <think> / </think> tags. When </think> first appears, the text up to it goes out, then
24067
- // the same text again with token THINK_CLOSE (an empty delta), so the worker closes the thought with no text lost.
 
24068
  async *generate(messages, { maxNewTokens = 1024, signal, enableThinking = false } = {}) {
 
 
 
 
24069
  let closed = false;
24070
  for await (const c of this.session.generate(messages, { maxNewTokens, signal, thinking: enableThinking })) {
24071
  const raw = String(c.text || '').replace(/^\s*<think>\n?/, '');
@@ -24096,6 +24115,15 @@ export class Ling3Flash extends AnyformerModel {
24096
  static repo = 'inclusionAI/Ling-3.0-flash-GGUF';
24097
  static budget = 7e9;
24098
  }
 
 
 
 
 
 
 
 
 
24099
  </script>
24100
  <script type="text/plain" data-module="errors.js">/* errors.js — coded errors for the store, ingest and the engines. A host branches on `code`, never on the
24101
  * message text and never on `instanceof` (two copies of this module, e.g. a CDN copy and a vendored one, make
 
9307
  // on-device storage once (~37 GB of disk). Experimental: rung 2b of the SSD-streaming ladder,
9308
  // decode speed is bound by SSD reads (~9 tok/s on an M4 Pro), and prompts are read one token at
9309
  // a time. Greedy output matches llama.cpp Metal on layer cuts (plan/history.md, 2026-10-04).
9310
+ // Since 2026-10-23 loaded through anyformer (backend 'anyformer-qwen36': Qwen36 in anyformer_models.js), which runs
9311
+ // diskformer's copy of the same engine; the store under localmind-ssd/ is reused.
9312
  'qwen36-35b-a3b-ssd': {
9313
  id: 'unsloth/Qwen3.6-35B-A3B-GGUF',
9314
  label: 'Qwen3.6 35B-A3B · SSD-streamed (experimental)',
9315
+ backend: 'anyformer-qwen36',
9316
  size: '~37 GB',
9317
  // The pinned GGUF (QWEN36_35B_A3B in qwen35_moe_ssd.js): "Load .gguf from disk…" routes a file of exactly
9318
  // this size here and ingests it instead of downloading. test-local-gguf-ssd.mjs keeps the two in step.
 
17779
  'gemma4moe-ssd': { engine: 'gemma4_moe_ssd.js', exportName: 'Gemma4MoeSsd', label: 'Gemma 4 26B-A4B (Q4_0)' },
17780
  'lfm2moe-ssd': { engine: 'lfm2_moe_ssd.js', exportName: 'Lfm2MoeSsd', label: 'LFM2.5 24B-A2B (Q4_0)' },
17781
  'flint-ssd': { engine: 'flint_moe_ssd.js', exportName: 'FlintMoeSsd', label: 'Flint 40B-A2.5B (Q4_1)' },
17782
+ 'anyformer-qwen36': { engine: 'anyformer_models.js', exportName: 'Qwen36', label: 'Qwen3.6 35B-A3B (Q8_0, via anyformer)' },
17783
  'anyformer-ling3flash': { engine: 'anyformer_models.js', exportName: 'Ling3Flash', label: 'Ling 3.0 Flash (Q4_K_M, via anyformer)' },
17784
  'anyformer-glm47flash': { engine: 'anyformer_models.js', exportName: 'Glm47Flash', label: 'GLM-4.7-Flash (Q4_K_M, via anyformer)' },
17785
  'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
 
19398
  const ENGINE_STORES = {
19399
  'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
19400
  'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
19401
+ '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)'], 'qwen3dense': ['on disk (OPFS)'], 'qwen35dense': ['on disk (OPFS)'],
19402
  };
19403
  function parseSizeBytes(size) {
19404
  const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
 
24021
  * anyformer picks the back end per model; LocalMind sees one call shape.
24022
  *
24023
  * AnyformerModel gives an anyformer session the engine interface LocalMind's SSD worker drives (moeSsdWorkerSrc):
24024
+ * static load(null, { maxCtx, localFile, onProgress, signal }), generate(messages, { maxNewTokens, signal,
24025
+ * enableThinking }) streaming { text, token }, prime(), ensureVision(), reset(), dispose(), and the think markers. One
24026
+ * subclass per model names its repo. anyformer loads from jsDelivr by GitHub tag until it is on npm.
24027
  *
24028
+ * Two shapes of session (anyformer v0.3.0):
24029
+ * - a diskformer hand engine: chunks carry the engine's token ids and session.think its markers, so they pass
24030
+ * through unchanged and the worker handles reasoning as it does for LocalMind's own engines;
24031
+ * - diskformer's llama.cpp path: text only, session.think null. With reasoning on, the reply opens inside the
24032
+ * thought; the class drops the literal <think> and </think> from the text and marks the boundary with a chunk
24033
+ * whose token is THINK_CLOSE (the worker's close event).
24034
  */
24035
  const THINK_CLOSE = -2;
24036
 
24037
+ export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.3.0/index.js';
24038
 
24039
  // anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
24040
  // into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
 
24051
  export class AnyformerModel {
24052
  static repo = null;
24053
  static file = undefined; // a GGUF in the repo; undefined lets anyformer pick (the file diskformer checked)
24054
+ static budget = 4e9; // GPU bytes: the llama.cpp path plans its expert slots from it; for a hand engine, the fit check
24055
+ static poolBytes = undefined; // a hand engine's expert cache (LocalMind's own engines ran with 4 GiB)
24056
 
24057
  static async load(_id, opts = {}) {
24058
  const { load } = await import(ANYFORMER_URL);
24059
  const session = await load(this.repo, {
24060
  budget: opts.budget || this.budget, maxCtx: opts.maxCtx, signal: opts.signal, ...(this.file ? { file: this.file } : {}),
24061
+ ...(this.poolBytes ? { poolBytes: this.poolBytes } : {}), ...(opts.localFile ? { localFile: opts.localFile } : {}),
24062
  onProgress: (e) => { const ev = toEngineProgress(e); if (ev && opts.onProgress) opts.onProgress(ev); },
24063
  });
24064
  return new this(session);
24065
  }
24066
 
24067
+ constructor(session) {
24068
+ this.session = session; this.backend = session.backend; this.think = session.think || null;
24069
+ // Present only where the engine has them (Qwen3.6: both), so the worker's own checks still work.
24070
+ if (session.prime) this.prime = (system) => session.prime(system);
24071
+ if (session.ensureVision) this.ensureVision = (o) => session.ensureVision(o);
24072
+ }
24073
 
24074
+ get thinkOpenTokenId() { return this.think ? this.think.openId : null; }
24075
+ get thinkCloseTokenId() { return this.think ? this.think.closeId : THINK_CLOSE; }
24076
+ get thinkInPrompt() { return this.think ? this.think.inPrompt ?? undefined : true; }
24077
+ get thinkPreamble() { return this.think ? this.think.preamble ?? '' : ''; }
24078
+ get alwaysThinks() { return this.think ? this.think.always === true : false; }
24079
 
24080
+ // A hand engine's chunks pass through. On the llama.cpp path: the reply text without its <think> / </think> tags; when
24081
+ // </think> first appears, the text up to it goes out, then the same text again with token THINK_CLOSE (an empty
24082
+ // delta), so the worker closes the thought with no text lost.
24083
  async *generate(messages, { maxNewTokens = 1024, signal, enableThinking = false } = {}) {
24084
+ if (this.think) {
24085
+ for await (const c of this.session.generate(messages, { maxNewTokens, signal, thinking: enableThinking })) yield c;
24086
+ return;
24087
+ }
24088
  let closed = false;
24089
  for await (const c of this.session.generate(messages, { maxNewTokens, signal, thinking: enableThinking })) {
24090
  const raw = String(c.text || '').replace(/^\s*<think>\n?/, '');
 
24115
  static repo = 'inclusionAI/Ling-3.0-flash-GGUF';
24116
  static budget = 7e9;
24117
  }
24118
+
24119
+ // Qwen3.6 35B-A3B: unsloth's Q8_0 GGUF (36.9 GB) on diskformer's Qwen35MoeSsd hand engine, which LocalMind ran itself
24120
+ // until 2026-10-23 (same engine code; the store under localmind-ssd/ is the same one, so a stored copy is reused).
24121
+ // A 4 GiB expert cache as before; the budget covers it, the dense weights and the KV cache.
24122
+ export class Qwen36 extends AnyformerModel {
24123
+ static repo = 'unsloth/Qwen3.6-35B-A3B-GGUF';
24124
+ static budget = 9e9;
24125
+ static poolBytes = 4 * 2 ** 30;
24126
+ }
24127
  </script>
24128
  <script type="text/plain" data-module="errors.js">/* errors.js — coded errors for the store, ingest and the engines. A host branches on `code`, never on the
24129
  * message text and never on `instanceof` (two copies of this module, e.g. a CDN copy and a vendored one, make