NakliTechie commited on
Commit
872f8cf
·
1 Parent(s): e9576ac

Sync from GitHub 2026-10-30T03:44:41Z

Browse files
Files changed (1) hide show
  1. index.html +61 -10
index.html CHANGED
@@ -2680,6 +2680,7 @@
2680
  <li><strong>Gemma 4 E2B &middot; WebGPU kernels</strong> (~2 GB) &mdash; text + agent. Google's Gemma 4 E2B (QAT mobile, int4) on a from-scratch WebGPU engine: hand-written WGSL for QAT int4 matmul, embed-gather-norm, RoPE/RMSNorm and GQA + sliding-window attention, reading the QAT-mobile weights directly. Ported from <em>webml-community/gemma-4-webgpu-kernels</em>. WebGPU-only. About 4&times; the ONNX Gemma 4 E2B&rsquo;s decode speed on the same Mac (171 vs 42 tok/s, M4 Pro); text-only.</li>
2681
  <li><strong>Gemma 4 E4B &middot; WebGPU kernels</strong> (~3.6 GB) &mdash; text + agent. The larger Gemma 4 (QAT mobile) on the same hand-written WebGPU engine. Its per-layer embedding table can also live on disk (Settings &rarr; Models, below).</li>
2682
  <li><strong>LFM3-VL 2B</strong> (~1.9 GB) &mdash; text and images, with reasoning. Liquid AI's LFM3-VL-2B (October 2026): the LFM3 language model with a new vision encoder, through Transformers.js on WebGPU. Attach an image and ask about it. Show reasoning turns its step-by-step thinking on.</li>
 
2683
  <li><strong>Gemma 4 E2B</strong> (~1.5 GB) &mdash; multimodal (image + audio) + agent.</li>
2684
  <li><strong>Gemma 4 E4B</strong> (~4.9 GB) &mdash; multimodal + agent, best quality.</li>
2685
  <li><strong>LFM2.5 230M &middot; GGUF</strong> (~170 MB) &mdash; the same LFM2.5 230M through wllama (llama.cpp &rarr; WebAssembly), reading a Q5_K_M GGUF. WebGPU when your browser has it, CPU otherwise, so it also runs where WebGPU is missing.</li>
@@ -3004,6 +3005,7 @@
3004
  <option value="lfm3-1.7b">LFM3 1.7B &middot; Agent (~1.4 GB)</option>
3005
  <option value="gemini-nano">Gemini Nano &middot; Built into Chrome (0 MB)</option>
3006
  <option value="lfm3-vl-2b">LFM3-VL 2B &middot; Text and images (~1.9 GB)</option>
 
3007
  <option value="gemma4-e2b">Gemma 4 E2B &middot; Multimodal (~1.5 GB)</option>
3008
  <option value="gemma4-e4b">Gemma 4 E4B &middot; Multimodal (~4.9 GB)</option>
3009
  <option value="lfm2-230m-gguf">LFM2.5 230M &middot; GGUF (~170 MB)</option>
@@ -8029,7 +8031,7 @@ const engineFetch = async (url, init = {}) => {
8029
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy
8030
  // of the engine (Gemma4Mobile) and, with ple, builds the OPFS per-layer-embedding table itself. The worker then drives
8031
  // session.engine exactly as it drove its own engine. Pinned to the same anyformer as anyformer_models.js.
8032
- const ANYFORMER_URL = 'https://cdn.jsdelivr.net/npm/anyformer@0.4.11/index.js';
8033
 
8034
  let anyformerLoad = null;
8035
  let session = null;
@@ -8174,7 +8176,7 @@ self.onmessage = async (e) => {
8174
  // rolled-in module URLs (moduleUrl()).
8175
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
8176
  // the engine (TernaryBonsai2); the worker drives session.engine as before and attaches DFlash / MTP itself.
8177
- const ANYFORMER_URL = 'https://cdn.jsdelivr.net/npm/anyformer@0.4.11/index.js';
8178
  const DFLASH_URL = '__TERNARY_BONSAI2_DFLASH_URL__';
8179
  const MTP_URL = '__TERNARY_BONSAI2_MTP_URL__';
8180
  // MTP speculative decoding (Settings → Models, default OFF; posted as `mtp` + `mtpDepth` on the
@@ -8657,9 +8659,12 @@ self.onmessage = async (e) => {
8657
  // Both models have a real system role; the engine applies the chat template itself. An engine with a vision
8658
  // encoder (MiniCPM-V 4.7: ensureVision) gets image parts: the page sends each image as a placeholder block in
8659
  // the message plus its bytes in d.attachments, in order; the first image downloads the encoder (1.1 GB) once.
8660
- const atts = Array.isArray(d.attachments) ? d.attachments.filter((a) => a && a.type === 'image') : [];
8661
- const vision = atts.length && typeof model.ensureVision === 'function';
8662
- if (vision) {
 
 
 
8663
  post({ type: 'progress', data: { status: 'loading', file: 'vision encoder' } });
8664
  await model.ensureVision({ onProgress: (ev) => {
8665
  if (ev.status === 'vision-download') post({ type: 'progress', data: { status: 'progress_total', file: 'vision encoder into on-device storage', loaded: ev.loaded, total: ev.total } });
@@ -8671,10 +8676,15 @@ self.onmessage = async (e) => {
8671
  for (const m of (d.messages || [])) {
8672
  // Role 'tool' arrives only for toolFormat 'arg-key' (Flint), whose engine renders it as <|observation|>.
8673
  const role = (m.role === 'system' || m.role === 'assistant' || m.role === 'tool') ? m.role : 'user';
8674
- if (vision && Array.isArray(m.content) && m.content.some((b) => b && b.type === 'image')) {
8675
  const parts = [];
8676
  for (const b of m.content) {
8677
- if (b && b.type === 'image' && ai < atts.length) parts.push(await imageRgb(atts[ai].data, atts[ai++].mimeType));
 
 
 
 
 
8678
  else if (b && b.type === 'text') parts.push({ type: 'text', text: b.text });
8679
  }
8680
  msgs.push({ role, content: parts });
@@ -9471,6 +9481,25 @@ self.addEventListener('message', async (e) => {
9471
  },
9472
  // backend:'anyformer-bolt-e4b' → NVIDIA's Nemotron 3.5 Bolt E4B through anyformer, which sends it to transformers.js
9473
  // (a community q4f16 ONNX, text only). Reasoning off: anyformer's text-only Gemma 4 path renders the template without it.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9474
  'nemotron-bolt-e4b-anyformer': {
9475
  id: 'danyalmalik/NVIDIA-Nemotron-3.5-Bolt-E4B-ONNX-WebGPU',
9476
  label: 'Nemotron 3.5 Bolt E4B · via anyformer (experimental)',
@@ -10570,6 +10599,7 @@ self.addEventListener('message', async (e) => {
10570
  'ternary-bonsai-2-4b-webgpu': 'qwen',
10571
  'lfm3-1.7b': 'lfm3',
10572
  'lfm3-vl-2b': 'lfm3',
 
10573
  'lfm2-230m-gguf': 'lfm2',
10574
  'lfm2-230m-webgpu': 'lfm2',
10575
  'gemma4-e2b': 'gemma',
@@ -17626,6 +17656,7 @@ self.addEventListener('message', async (e) => {
17626
  'anyformer-deepseek-v41': { engine: 'anyformer_models.js', exportName: 'DeepSeekV41Flash', label: 'DeepSeek V4.1 Flash (IQ1_M + Engram, via anyformer)' },
17627
  'anyformer-nemotron-diffusion': { engine: 'anyformer_models.js', exportName: 'NemotronDiffusion3B', label: 'Nemotron-Labs-Diffusion 3B (ONNX, via anyformer and kohra)' },
17628
  'anyformer-bolt-e4b': { engine: 'anyformer_models.js', exportName: 'NemotronBoltE4B', label: 'Nemotron 3.5 Bolt E4B (q4f16 ONNX, via anyformer)' },
 
17629
  'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
17630
  'hyv3-ssd': { engine: 'hy_v3_moe_ssd.js', exportName: 'HyV3MoeSsd', label: 'Hy-Memory 30B-A3B (Q8_0)' }, // the memory writer only (WRITER_MODELS)
17631
  'qwen35dense': { engine: 'qwen35_dense.js', exportName: 'Qwen35Dense', label: 'Underdog Saluki 27B (IQ2-mix)' },
@@ -19296,7 +19327,7 @@ self.addEventListener('message', async (e) => {
19296
  const ENGINE_STORES = {
19297
  'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
19298
  'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
19299
- '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-deepseek-v41': ['on disk (OPFS)'], 'anyformer-bolt-e4b': ['transformers-cache'], 'anyformer-nemotron-diffusion': ['kohra-models', '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)'],
19300
  };
19301
  function parseSizeBytes(size) {
19302
  const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
@@ -23936,7 +23967,8 @@ self.addEventListener('message', async (e) => {
23936
  */
23937
  const THINK_CLOSE = -2;
23938
 
23939
- export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/npm/anyformer@0.4.11/index.js';
 
23940
 
23941
  // anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
23942
  // into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
@@ -24090,6 +24122,25 @@ export class Lfm25_24B extends AnyformerModel {
24090
  static budget = 7e9;
24091
  static poolBytes = 4 * 2 ** 30;
24092
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24093
  </script>
24094
  <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
24095
  * message text and never on `instanceof` (two copies of this module, e.g. a CDN copy and a vendored one, make
@@ -32321,7 +32372,7 @@ const GGUF_FILE = 'LFM2.5-230M-Q4_0.gguf';
32321
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
32322
  // the LFM2.5 engine (Lfm2Mobile) and returns a session with the same generate / reset / dispose. Pinned to an exact
32323
  // version; LocalMind's anyformer_models.js pins the same one.
32324
- const ANYFORMER_URL = 'https://cdn.jsdelivr.net/npm/anyformer@0.4.11/index.js';
32325
 
32326
  let anyformerLoad = null;
32327
  let model = null;
 
2680
  <li><strong>Gemma 4 E2B &middot; WebGPU kernels</strong> (~2 GB) &mdash; text + agent. Google's Gemma 4 E2B (QAT mobile, int4) on a from-scratch WebGPU engine: hand-written WGSL for QAT int4 matmul, embed-gather-norm, RoPE/RMSNorm and GQA + sliding-window attention, reading the QAT-mobile weights directly. Ported from <em>webml-community/gemma-4-webgpu-kernels</em>. WebGPU-only. About 4&times; the ONNX Gemma 4 E2B&rsquo;s decode speed on the same Mac (171 vs 42 tok/s, M4 Pro); text-only.</li>
2681
  <li><strong>Gemma 4 E4B &middot; WebGPU kernels</strong> (~3.6 GB) &mdash; text + agent. The larger Gemma 4 (QAT mobile) on the same hand-written WebGPU engine. Its per-layer embedding table can also live on disk (Settings &rarr; Models, below).</li>
2682
  <li><strong>LFM3-VL 2B</strong> (~1.9 GB) &mdash; text and images, with reasoning. Liquid AI's LFM3-VL-2B (October 2026): the LFM3 language model with a new vision encoder, through Transformers.js on WebGPU. Attach an image and ask about it. Show reasoning turns its step-by-step thinking on.</li>
2683
+ <li><strong>LFM3-Omni 2B</strong> (~2.1 GB) &mdash; text, images and speech in, with reasoning and tools. Liquid AI's LFM3-Omni-2B (October 2026), one model that reads text, pictures and spoken questions (up to 30 seconds a clip). Transformers.js does not run it yet, so it comes through anyformer on diskformer's own onnxruntime-web engine; the first load stores the files in this browser once. It answers in text for now; spoken answers come later.</li>
2684
  <li><strong>Gemma 4 E2B</strong> (~1.5 GB) &mdash; multimodal (image + audio) + agent.</li>
2685
  <li><strong>Gemma 4 E4B</strong> (~4.9 GB) &mdash; multimodal + agent, best quality.</li>
2686
  <li><strong>LFM2.5 230M &middot; GGUF</strong> (~170 MB) &mdash; the same LFM2.5 230M through wllama (llama.cpp &rarr; WebAssembly), reading a Q5_K_M GGUF. WebGPU when your browser has it, CPU otherwise, so it also runs where WebGPU is missing.</li>
 
3005
  <option value="lfm3-1.7b">LFM3 1.7B &middot; Agent (~1.4 GB)</option>
3006
  <option value="gemini-nano">Gemini Nano &middot; Built into Chrome (0 MB)</option>
3007
  <option value="lfm3-vl-2b">LFM3-VL 2B &middot; Text and images (~1.9 GB)</option>
3008
+ <option value="lfm3-omni-2b-anyformer">LFM3-Omni 2B &middot; Text, images and speech in (~2.1 GB)</option>
3009
  <option value="gemma4-e2b">Gemma 4 E2B &middot; Multimodal (~1.5 GB)</option>
3010
  <option value="gemma4-e4b">Gemma 4 E4B &middot; Multimodal (~4.9 GB)</option>
3011
  <option value="lfm2-230m-gguf">LFM2.5 230M &middot; GGUF (~170 MB)</option>
 
8031
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy
8032
  // of the engine (Gemma4Mobile) and, with ple, builds the OPFS per-layer-embedding table itself. The worker then drives
8033
  // session.engine exactly as it drove its own engine. Pinned to the same anyformer as anyformer_models.js.
8034
+ const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.13/index.js';
8035
 
8036
  let anyformerLoad = null;
8037
  let session = null;
 
8176
  // rolled-in module URLs (moduleUrl()).
8177
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
8178
  // the engine (TernaryBonsai2); the worker drives session.engine as before and attaches DFlash / MTP itself.
8179
+ const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.13/index.js';
8180
  const DFLASH_URL = '__TERNARY_BONSAI2_DFLASH_URL__';
8181
  const MTP_URL = '__TERNARY_BONSAI2_MTP_URL__';
8182
  // MTP speculative decoding (Settings → Models, default OFF; posted as `mtp` + `mtpDepth` on the
 
8659
  // Both models have a real system role; the engine applies the chat template itself. An engine with a vision
8660
  // encoder (MiniCPM-V 4.7: ensureVision) gets image parts: the page sends each image as a placeholder block in
8661
  // the message plus its bytes in d.attachments, in order; the first image downloads the encoder (1.1 GB) once.
8662
+ // A model that reads media parts itself (LFM3-Omni: mediaParts) gets images and audio clips the same way, audio as
8663
+ // { type:'audio', pcm } (16 kHz mono, as the page decodes it).
8664
+ const media = model.mediaParts === true;
8665
+ const atts = Array.isArray(d.attachments) ? d.attachments.filter((a) => a && (a.type === 'image' || (media && a.type === 'audio'))) : [];
8666
+ const vision = atts.length && (media || typeof model.ensureVision === 'function');
8667
+ if (vision && !media) {
8668
  post({ type: 'progress', data: { status: 'loading', file: 'vision encoder' } });
8669
  await model.ensureVision({ onProgress: (ev) => {
8670
  if (ev.status === 'vision-download') post({ type: 'progress', data: { status: 'progress_total', file: 'vision encoder into on-device storage', loaded: ev.loaded, total: ev.total } });
 
8676
  for (const m of (d.messages || [])) {
8677
  // Role 'tool' arrives only for toolFormat 'arg-key' (Flint), whose engine renders it as <|observation|>.
8678
  const role = (m.role === 'system' || m.role === 'assistant' || m.role === 'tool') ? m.role : 'user';
8679
+ if (vision && Array.isArray(m.content) && m.content.some((b) => b && (b.type === 'image' || (media && b.type === 'audio')))) {
8680
  const parts = [];
8681
  for (const b of m.content) {
8682
+ if (b && (b.type === 'image' || (media && b.type === 'audio')) && ai < atts.length) {
8683
+ const a = atts[ai++];
8684
+ parts.push(a.type === 'audio'
8685
+ ? { type: 'audio', pcm: a.pcmData instanceof Float32Array ? a.pcmData : new Float32Array(a.pcmData) }
8686
+ : await imageRgb(a.data, a.mimeType));
8687
+ }
8688
  else if (b && b.type === 'text') parts.push({ type: 'text', text: b.text });
8689
  }
8690
  msgs.push({ role, content: parts });
 
9481
  },
9482
  // backend:'anyformer-bolt-e4b' → NVIDIA's Nemotron 3.5 Bolt E4B through anyformer, which sends it to transformers.js
9483
  // (a community q4f16 ONNX, text only). Reasoning off: anyformer's text-only Gemma 4 path renders the template without it.
9484
+ // backend:'anyformer-lfm3-omni' → LiquidAI's LFM3-Omni-2B through anyformer, which sends it to diskformer's
9485
+ // onnxruntime-web engine (lfm3_omni.js) until transformers.js supports it. Images and speech clips in (up to 30 s
9486
+ // each), text out; speech out is not built yet. Tools in the Qwen3-Coder XML form its template uses.
9487
+ 'lfm3-omni-2b-anyformer': {
9488
+ id: 'LiquidAI/LFM3-Omni-2B-ONNX',
9489
+ label: 'LFM3-Omni 2B',
9490
+ backend: 'anyformer-lfm3-omni',
9491
+ size: '~2.1 GB',
9492
+ type: 'causal',
9493
+ multimodal: true,
9494
+ imageInput: true,
9495
+ audioInput: true,
9496
+ videoInput: false,
9497
+ agentCapable: true,
9498
+ toolFormat: 'qwen3-xml',
9499
+ thinking: true,
9500
+ contextSize: 32768,
9501
+ genConfig: { max_new_tokens: 2048 },
9502
+ },
9503
  'nemotron-bolt-e4b-anyformer': {
9504
  id: 'danyalmalik/NVIDIA-Nemotron-3.5-Bolt-E4B-ONNX-WebGPU',
9505
  label: 'Nemotron 3.5 Bolt E4B · via anyformer (experimental)',
 
10599
  'ternary-bonsai-2-4b-webgpu': 'qwen',
10600
  'lfm3-1.7b': 'lfm3',
10601
  'lfm3-vl-2b': 'lfm3',
10602
+ 'lfm3-omni-2b-anyformer': 'lfm3',
10603
  'lfm2-230m-gguf': 'lfm2',
10604
  'lfm2-230m-webgpu': 'lfm2',
10605
  'gemma4-e2b': 'gemma',
 
17656
  'anyformer-deepseek-v41': { engine: 'anyformer_models.js', exportName: 'DeepSeekV41Flash', label: 'DeepSeek V4.1 Flash (IQ1_M + Engram, via anyformer)' },
17657
  'anyformer-nemotron-diffusion': { engine: 'anyformer_models.js', exportName: 'NemotronDiffusion3B', label: 'Nemotron-Labs-Diffusion 3B (ONNX, via anyformer and kohra)' },
17658
  'anyformer-bolt-e4b': { engine: 'anyformer_models.js', exportName: 'NemotronBoltE4B', label: 'Nemotron 3.5 Bolt E4B (q4f16 ONNX, via anyformer)' },
17659
+ 'anyformer-lfm3-omni': { engine: 'anyformer_models.js', exportName: 'Lfm3Omni2B', label: 'LFM3-Omni 2B (ONNX, via anyformer)' },
17660
  'qwen3dense': { engine: 'qwen35_dense.js', exportName: 'Qwen3Dense', label: 'Qwen3 4B (Q8_0) + FlashMap' },
17661
  'hyv3-ssd': { engine: 'hy_v3_moe_ssd.js', exportName: 'HyV3MoeSsd', label: 'Hy-Memory 30B-A3B (Q8_0)' }, // the memory writer only (WRITER_MODELS)
17662
  'qwen35dense': { engine: 'qwen35_dense.js', exportName: 'Qwen35Dense', label: 'Underdog Saluki 27B (IQ2-mix)' },
 
19327
  const ENGINE_STORES = {
19328
  'transformers': ['transformers-cache'], 'wllama': ['wllama'], 'lfm2-webgpu': ['gguf-v1'],
19329
  'bonsai2-webgpu': ['gguf-cache-v1'], 'gemma4-webgpu': ['safetensors-cache-v1', 'bonsai-pipeline-v1'],
19330
+ '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-deepseek-v41': ['on disk (OPFS)'], 'anyformer-bolt-e4b': ['transformers-cache'], 'anyformer-lfm3-omni': ['diskformer-models'], 'anyformer-nemotron-diffusion': ['kohra-models', '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)'],
19331
  };
19332
  function parseSizeBytes(size) {
19333
  const m = /([\d.]+)\s*(GB|MB)/i.exec(String(size || ''));
 
23967
  */
23968
  const THINK_CLOSE = -2;
23969
 
23970
+ // 0.4.13 (LFM3-Omni-2B) is tagged but not yet on npm: the GitHub tag from jsDelivr until it is.
23971
+ export const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.13/index.js';
23972
 
23973
  // anyformer's progress events → the engine events the SSD worker posts. The llama.cpp path reports 'download' (bytes
23974
  // into OPFS) and 'load' / 'plan'; a hand engine (diskformer back end) reports its own engine events, 'weights' with
 
24122
  static budget = 7e9;
24123
  static poolBytes = 4 * 2 ** 30;
24124
  }
24125
+
24126
+ // LiquidAI's LFM3-Omni-2B (LiquidAI/LFM3-Omni-2B-ONNX: q4f16 decoder, int8 vision encoder, fp32 audio encoder, 2.14 GB)
24127
+ // by anyformer's catalog entry, on diskformer's onnxruntime-web engine (lfm3_omni.js, gated 2026-10-30: 32 of 32
24128
+ // greedy tokens equal Liquid's CPU reference for text, image and speech in). transformers.js 4.3.2 has no lfm3_omni
24129
+ // class; when it adds one, anyformer moves the entry and LocalMind changes nothing. Text out only for now.
24130
+ // mediaParts: the SSD worker passes image parts as { type:'image', rgb, width, height } and audio parts as
24131
+ // { type:'audio', pcm } (16 kHz mono, at most 30 s); this class turns them into anyformer's content blocks.
24132
+ export class Lfm3Omni2B extends AnyformerModel {
24133
+ static entry = 'LFM3_OMNI_2B';
24134
+ get mediaParts() { return true; }
24135
+ async *generate(messages, opts) {
24136
+ const blocks = messages.map((m) => !Array.isArray(m.content) ? m : {
24137
+ ...m,
24138
+ content: m.content.map((b) => b.type === 'image' ? { type: 'image', image: { data: b.rgb, width: b.width, height: b.height, channels: 3 } }
24139
+ : b.type === 'audio' ? { type: 'audio', audio: b.pcm } : b),
24140
+ });
24141
+ yield* super.generate(blocks, opts);
24142
+ }
24143
+ }
24144
  </script>
24145
  <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
24146
  * message text and never on `instanceof` (two copies of this module, e.g. a CDN copy and a vendored one, make
 
32372
  // The model loads through anyformer (convergence plan, 2026-10-22): anyformer resolves the repo to diskformer's copy of
32373
  // the LFM2.5 engine (Lfm2Mobile) and returns a session with the same generate / reset / dispose. Pinned to an exact
32374
  // version; LocalMind's anyformer_models.js pins the same one.
32375
+ const ANYFORMER_URL = 'https://cdn.jsdelivr.net/gh/NakliTechie/anyformer.js@v0.4.13/index.js';
32376
 
32377
  let anyformerLoad = null;
32378
  let model = null;