anyformer 0.4.8 → 0.4.10

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,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.10 — 2026-10-24
4
+
5
+ ### Changed
6
+ - kohra pinned to v0.3.1 (bf95d44): `from_pretrained` reports download progress, which anyformer's `onProgress`
7
+ receives (forwarded since npm 0.4.9), and caches the graph files in Cache Storage 'kohra-models', which `stored()`
8
+ lists and `remove()` deletes. A second load of Nemotron-Labs-Diffusion-3B reads them from there.
9
+
10
+ ### Verified
11
+ - npm test 90/90. kohra's own Chrome check on v0.3.1 (kohra session): the first Nemotron load cached all 3 files with
12
+ their content-length; a reload was ready in 7.4 s with no graph fetches; output unchanged. anyformer's own browser
13
+ check is owed (the GPU is with Quench), and the npm publish waits for it.
14
+
15
+ ## 0.4.9 — 2026-10-24
16
+
17
+ npm 0.4.9 was published from main 69bed78, one commit after tag v0.4.9 (cce1e1a), so it also carries the change
18
+ below. With the kohra v0.3.0 pin that change does nothing yet: v0.3.0 ignores `progress_callback` and caches nothing.
19
+
20
+ ### Added (69bed78)
21
+ - `kohra`: `onProgress` is forwarded to kohra's `from_pretrained` as `progress_callback` (kohra v0.3.1+), so the
22
+ 2.7 GB Nemotron download reports bytes. `stored()` and `remove()` list kohra's Cache Storage 'kohra-models'.
23
+
24
+ ### Added
25
+ - Catalog flags: `diffusion: true` on the two kohra entries (Qwen3-0.6B MDLM, Nemotron-Labs-Diffusion-3B), and
26
+ `experimental: true` on Nemotron-Labs-Diffusion-3B, so LocalMind can show it as opt-in, "experimental · diffusion",
27
+ until its multi-turn chat check passes (Chirag's conditions for LocalMind, 2026-10-24). `anyformer_models` returns
28
+ them.
29
+
30
+ ### Verified
31
+ - npm test 90/90. No browser check: catalog fields only.
32
+
3
33
  ## 0.4.8 — 2026-10-24
4
34
 
5
35
  Skips 0.4.7 on npm: this release carries its Nemotron-Labs-Diffusion-3B entry too.
package/README.md CHANGED
@@ -14,7 +14,7 @@ browser storage; no account, no server, no telemetry.
14
14
  | How | Command |
15
15
  |---|---|
16
16
  | npm | `npm install anyformer` |
17
- | CDN | `import { load } from 'https://cdn.jsdelivr.net/npm/anyformer@0.4.8/+esm';` |
17
+ | CDN | `import { load } from 'https://cdn.jsdelivr.net/npm/anyformer@0.4.10/+esm';` |
18
18
  | Copy | `index.js` and `src/`; nothing else is needed |
19
19
 
20
20
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anyformer",
3
- "version": "0.4.8",
3
+ "version": "0.4.10",
4
4
  "description": "One call to run a model in a browser tab: anyformer reads the Hub repo, probes the browser, and picks the back end (transformers.js, LocalMind's WebGPU kernels, diskformer, kohra) that fits the model's format, architecture and your GPU budget.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -65,6 +65,9 @@ export const kohraBackend = {
65
65
  const special = SPECIAL[model.architecture];
66
66
  const lm = await DiffusionLM.from_pretrained({
67
67
  model: `${base}/${graph}`, tokenizer: model.repo, ...(graph === Q4 && { ortVersion: Q4_ORT }), ...special?.opts,
68
+ // kohra v0.3.1+: transformers.js-style events ({ status: 'initiate' | 'progress' | 'done', file, loaded, total,
69
+ // progress }) while the graph and its data download into Cache Storage 'kohra-models'. Older kohra ignores it.
70
+ ...(onProgress && { progress_callback: (p) => onProgress({ backend: 'kohra', ...p }) }),
68
71
  });
69
72
  signal?.throwIfAborted();
70
73
  const blockCausal = special ? special.blockCausal : model.tags.includes('block-diffusion');
package/src/models.js CHANGED
@@ -1,6 +1,8 @@
1
1
  // Models that pass a browser test through anyformer, grouped by what they do. Pass an entry to load() in place of a
2
2
  // repo id; it carries the task and, where the back end needs one, the budget. DEFAULT is the smallest download that
3
3
  // passed. `test` names the page under test/browser/ that proves the entry; test/models.test.js checks it exists.
4
+ // `diffusion: true` marks a text-diffusion model (the reply denoises in blocks); `experimental: true` marks an entry its
5
+ // app shows as opt-in until that app's own checks pass.
4
6
 
5
7
  const M = (repo, backend, task, test, extra = {}) => ({ repo, backend, task, test, ...extra });
6
8
 
@@ -15,8 +17,8 @@ const QWEN3_5_4B = M('onnx-community/Qwen3.5-4B-ONNX-OPT', 'transformers', 'text
15
17
  const GEMMA4_E2B_ONNX = M('onnx-community/gemma-4-E2B-it-ONNX', 'transformers', 'text-generation', 'vision', { budget: 3.5e9, downloadBytes: 3.38e9 });
16
18
  const GEMMA4_E4B_ONNX = M('onnx-community/gemma-4-E4B-it-ONNX', 'transformers', 'text-generation', 'transformers', { budget: 5.3e9, downloadBytes: 5.18e9 });
17
19
  const MINICPM5_2B = M('openbmb/MiniCPM5-2B-GGUF', 'wllama', 'text-generation', 'chat', { downloadBytes: 1.56e9 });
18
- const QWEN3_0_6B_MDLM = M('naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX', 'kohra', 'text-generation', 'kohra', { downloadBytes: 1.54e9 });
19
- const NEMOTRON_DIFFUSION_3B = M('naklitechie/Nemotron-Labs-Diffusion-3B-ONNX', 'kohra', 'text-generation', 'kohra', { downloadBytes: 2.77e9 });
20
+ const QWEN3_0_6B_MDLM = M('naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX', 'kohra', 'text-generation', 'kohra', { downloadBytes: 1.54e9, diffusion: true });
21
+ const NEMOTRON_DIFFUSION_3B = M('naklitechie/Nemotron-Labs-Diffusion-3B-ONNX', 'kohra', 'text-generation', 'kohra', { downloadBytes: 2.77e9, diffusion: true, experimental: true });
20
22
  const GEMMA4_26B_A4B = M('google/gemma-4-26B-A4B-it-qat-q4_0-gguf', 'diskformer', 'text-generation', 'diskformer-chat', { budget: 2.5e9, downloadBytes: 14.44e9 });
21
23
  const NEMOTRON_3_5_BOLT_E4B = M('danyalmalik/NVIDIA-Nemotron-3.5-Bolt-E4B-ONNX-WebGPU', 'transformers', 'text-generation', 'transformers', { budget: 5e9, downloadBytes: 4.94e9 });
22
24
  const MINILM_L6 = M('Xenova/all-MiniLM-L6-v2', 'transformers', 'feature-extraction', 'embed', { downloadBytes: 90e6 });
package/src/sources.js CHANGED
@@ -6,8 +6,9 @@
6
6
  export const PINS = {
7
7
  transformers: '4.3.1',
8
8
  wllama: '3.4.1', // LocalMind's pin; its stream-drain workaround (src/backends/wllama.js) is for this version
9
- // v0.3.0: seeded block-KV graphs (Nemotron-Labs-Diffusion-3B), chatFormat, split external data.
10
- kohra: '85e01f0193163b0f2e9696d4f6f5e12b68a277e9',
9
+ // v0.3.1: seeded block-KV graphs (Nemotron-Labs-Diffusion-3B), chatFormat, split external data; download progress
10
+ // (progress_callback) and the graph files cached in Cache Storage 'kohra-models'.
11
+ kohra: 'bf95d44c3e3cfc001201baa03fa121c2bf9c7d73',
11
12
  // v0.6.8: every engine (the disk-tier MoE engines, Ling 3.0 Flash, and LocalMind's whole-model engines LFM2.5,
12
13
  // Gemma 4 E2B/E4B and Ternary Bonsai 2) under engines/, and the llama.cpp path under ggml/, which loads split GGUFs
13
14
  // and drafters, and reads past 2 GiB (Nemotron 3.5 Bolt E4B needs v0.6.8 or later). The hand engines' ingest
package/src/store.js CHANGED
@@ -3,8 +3,8 @@
3
3
  // inventoryModelCaches() (index.html), which covers the same engines' stores.
4
4
  // Cache Storage 'transformers-cache' (transformers.js; kohra's tokenizer too); 'gguf-v1', 'gguf-v1-headers' and
5
5
  // 'bonsai-pipeline-v1' (LocalMind's engines; 'gguf-v1' holds the LFM2
6
- // engine): one entry per file URL (…/<repo>/resolve/<rev>/<file>). kohra's ONNX graph sits in the
7
- // browser's HTTP cache, which a page cannot list.
6
+ // engine), 'kohra-models' (kohra v0.3.1+: its ONNX graph and data files): one entry per file URL
7
+ // (…/<repo>/resolve/<rev>/<file>). Older kohra left its graph in the HTTP cache, which a page cannot list.
8
8
  // IndexedDB 'gguf-cache-v1' (Bonsai 2) and 'safetensors-cache-v1' (Gemma 4 QAT-mobile): a store keyed by URL
9
9
  // with { size } and a chunk store keyed [url, start, end]; 'webgpu-prefix-snapshots' (Bonsai 2's
10
10
  // system-prompt snapshot).
@@ -18,7 +18,7 @@ import { DISKFORMER_MODELS } from './backends/diskformer.js';
18
18
  import { SPLIT_ROOT } from './gguf-split.js';
19
19
  import { readLlamaIndex, LLAMA_INDEX } from './backends/diskformer-llama.js';
20
20
 
21
- const CACHE_BACKEND = { 'transformers-cache': 'transformers', 'gguf-v1': 'localmind', 'gguf-v1-headers': 'localmind', 'bonsai-pipeline-v1': 'localmind' };
21
+ const CACHE_BACKEND = { 'transformers-cache': 'transformers', 'gguf-v1': 'localmind', 'gguf-v1-headers': 'localmind', 'bonsai-pipeline-v1': 'localmind', 'kohra-models': 'kohra' };
22
22
  const IDB_STORES = ['gguf-cache-v1', 'safetensors-cache-v1'];
23
23
  const BONSAI2 = 'prism-ml/Ternary-Bonsai-2-27B-gguf';
24
24
 
package/src/tools.js CHANGED
@@ -43,7 +43,7 @@ export const TOOLS = [
43
43
  },
44
44
  {
45
45
  name: 'anyformer_models', consequence: 'read',
46
- description: 'Models that pass a browser test through anyformer, by family (chat, embedding, objectDetection): repo, back end, task, budget, download size. Pass a repo to anyformer_plan or anyformer_load.',
46
+ description: 'Models that pass a browser test through anyformer, by family (chat, embedding, objectDetection): repo, back end, task, budget, download size, and the flags diffusion and experimental. Pass a repo to anyformer_plan or anyformer_load.',
47
47
  inputSchema: { type: 'object', properties: {} },
48
48
  handler: () => MODELS,
49
49
  },