anyformer 0.4.8 → 0.4.9

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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ### Added
6
+ - `kohra`: `onProgress` is forwarded to kohra's `from_pretrained` as `progress_callback` (kohra v0.3.1+), so the
7
+ 2.7 GB Nemotron download reports bytes. `stored()` and `remove()` list kohra's Cache Storage 'kohra-models'.
8
+ Waits on the kohra v0.3.1 pin.
9
+
10
+ ## 0.4.9 — 2026-10-24
11
+
12
+ ### Added
13
+ - Catalog flags: `diffusion: true` on the two kohra entries (Qwen3-0.6B MDLM, Nemotron-Labs-Diffusion-3B), and
14
+ `experimental: true` on Nemotron-Labs-Diffusion-3B, so LocalMind can show it as opt-in, "experimental · diffusion",
15
+ until its multi-turn chat check passes (Chirag's conditions for LocalMind, 2026-10-24). `anyformer_models` returns
16
+ them.
17
+
18
+ ### Verified
19
+ - npm test 90/90. No browser check: catalog fields only.
20
+
3
21
  ## 0.4.8 — 2026-10-24
4
22
 
5
23
  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.9/+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.9",
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/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
  },