webslm 0.12.0 → 0.12.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # webslm
2
2
 
3
- Run small language models in the browser and in Node, straight from their original Hugging Face checkpoints. A Rust engine compiled to WebAssembly reads `config.json`, `tokenizer.json`, the chat template and the `*.safetensors` weights as published, with no conversion step.
3
+ Run small language and vision-language models (and small embedding, speech recognition and text-to-image models) in the browser and in Node, straight from their original Hugging Face checkpoints. A Rust engine compiled to WebAssembly reads `config.json`, `tokenizer.json`, the chat template and the `*.safetensors` weights as published, with no conversion step.
4
4
 
5
5
  ```sh
6
6
  npm install webslm
@@ -18,8 +18,9 @@ The first call downloads the default model ([LFM2.5 350M](https://huggingface.co
18
18
  - Downloads a checkpoint once into the Origin Private File System (a directory in Node), resumes interrupted downloads, checks the Hub's SHA-256 and loads offline afterwards.
19
19
  - Streams answers, keeps conversations, and exposes a low-level session API (teacher-forced scoring, step-wise decoding, logits and hidden states as `Float32Array`s).
20
20
  - Searches the Hub for models it can run.
21
+ - Answers about [images and video](#images-and-video), [embeds](#embeddings) texts, [transcribes](#speech-recognition) speech, [generates images](#image-generation) and [trains](#training) LoRA adapters on the device.
21
22
 
22
- Supported architectures: Llama-style (SmolLM2, Mistral), Qwen2, Qwen3, Qwen3.5 (language model; Gated DeltaNet hybrid), LFM2 / LFM2.5 and LFM3. Models run on WebGPU or on the CPU through WebAssembly (SIMD, and Web Worker threads where the page allows): with `device: "auto"` (the default), WebGPU for models above ~100M parameters when the browser has an adapter, the CPU otherwise; `ModelInfo.backend` says which one runs. In Node and Bun, the [native engine](#native-engine-in-node) runs instead (downloaded once from the release, checked, and cached): native SIMD kernels on every core, and the GPU through Metal, Vulkan or DX12. ESM only; browsers with WebAssembly SIMD (every current browser). Demo: <https://maxgfr.github.io/webslm/>.
23
+ Supported architectures: Llama-style (SmolLM2, Mistral), Qwen2, Qwen3, Qwen3.5 (Gated DeltaNet hybrid, with its vision encoder), LFM2 / LFM2.5 and LFM3; the vision-language models SmolVLM / SmolVLM2 and LFM2-VL / LFM2.5-VL; the encoders BERT / MiniLM, ModernBERT and model2vec; Whisper; and Stable Diffusion style UNets (SDXS) and Sana-Sprint for image generation. Models run on WebGPU or on the CPU through WebAssembly (SIMD, and Web Worker threads where the page allows): with `device: "auto"` (the default), WebGPU for models above ~100M parameters when the browser has an adapter, the CPU otherwise; `ModelInfo.backend` says which one runs. In Node and Bun, the [native engine](#native-engine-in-node) runs instead (downloaded once from the release, checked, and cached): native SIMD kernels on every core, and the GPU through Metal, Vulkan or DX12. ESM only; browsers with WebAssembly SIMD (every current browser). Demo: <https://maxgfr.github.io/webslm/>.
23
24
 
24
25
  ## Ask
25
26
 
@@ -609,7 +610,7 @@ export default defineConfig({
609
610
  });
610
611
  ```
611
612
 
612
- Server code that imports webslm must not be bundled: webslm runs from its own files in `node_modules` (Next.js: `serverExternalPackages: ["webslm"]`). Without a bundler, a page can import it from jsDelivr (`https://cdn.jsdelivr.net/npm/webslm@0.12.0/dist/index.js`); webslm starts its workers through same-origin `blob:` workers when its files come from another origin. Guides for Next.js, Vite, webpack, Node servers, Bun, Deno and CDNs, each with a tested example: <https://github.com/maxgfr/webslm#frameworks-bundlers-and-runtimes>.
613
+ Server code that imports webslm must not be bundled: webslm runs from its own files in `node_modules` (Next.js: `serverExternalPackages: ["webslm"]`). Without a bundler, a page can import it from jsDelivr (`https://cdn.jsdelivr.net/npm/webslm@0.12.1/dist/index.js`); webslm starts its workers through same-origin `blob:` workers when its files come from another origin. Guides for Next.js, Vite, webpack, Node servers, Bun, Deno and CDNs, each with a tested example: <https://github.com/maxgfr/webslm#frameworks-bundlers-and-runtimes>.
613
614
 
614
615
  ## Errors
615
616
 
@@ -1,47 +1,47 @@
1
1
  {
2
- "version": "0.12.0",
2
+ "version": "0.12.1",
3
3
  "assets": {
4
4
  "darwin-arm64": {
5
- "file": "webslm-node-0.12.0-darwin-arm64.node.gz",
6
- "size": 6140716,
7
- "sha256": "82fabc24d852f30164262e4464ccaf66d7fbb9d8f15036741f0a329e809eeac6",
8
- "nodeSha256": "214c12103f111e26b6d9e723d05b94f2e9a921fad40b0acccbbaa361488aedc7"
5
+ "file": "webslm-node-0.12.1-darwin-arm64.node.gz",
6
+ "size": 6140577,
7
+ "sha256": "e212dda69d9716a8b5deb600fa815c1964ae40b81f3f9cf46dee794846a69ce7",
8
+ "nodeSha256": "61498f18a76d281103d9d0a342a9d16db7f8633a3ac7f6cb241b1ffc10a66522"
9
9
  },
10
10
  "darwin-x64": {
11
- "file": "webslm-node-0.12.0-darwin-x64.node.gz",
12
- "size": 6499071,
13
- "sha256": "2c83db8c7305481ca92aa1652ae9bd5023a812beed0017cf2ddc8c97fb4d7820",
14
- "nodeSha256": "b34c7d90d43a2eed6cd5626b0359c3fa6f0b9141ec5a4df3cff80012bdaf1e38"
11
+ "file": "webslm-node-0.12.1-darwin-x64.node.gz",
12
+ "size": 6504035,
13
+ "sha256": "36732dc97df6925b0e3596ad017c1cc568e18122b81b1f5ac71ffda8bff15a3d",
14
+ "nodeSha256": "7157b4e4ce4b66b804b55a7f6663f64b92c811c929bc7abf197494f4e0a4d76d"
15
15
  },
16
16
  "linux-x64-gnu": {
17
- "file": "webslm-node-0.12.0-linux-x64-gnu.node.gz",
18
- "size": 6512134,
19
- "sha256": "210abd09d68e933b7323a0319ba51558006dab011d935a5d6e20db5312f1835c",
20
- "nodeSha256": "bf31ad28980cf3890af93c706f262cf16208b704114869236ce5219b0cd4e588"
17
+ "file": "webslm-node-0.12.1-linux-x64-gnu.node.gz",
18
+ "size": 6515391,
19
+ "sha256": "6d6c5b96e400cedb9fe02dbb779c8e915d149eeef11a55923d22521d0e1248e2",
20
+ "nodeSha256": "9d1005c41b6fda6237431b45931dbc247fbbdcdc7ace3006e4e3fca71208996f"
21
21
  },
22
22
  "linux-arm64-gnu": {
23
- "file": "webslm-node-0.12.0-linux-arm64-gnu.node.gz",
24
- "size": 6106673,
25
- "sha256": "6904daf73a001100becd269f7d34c7d04db995194d2f2e66ebbbcb731cee8a7f",
26
- "nodeSha256": "86beb6444acb5a413f14d782deccea94b9ae8cb4c1a31ff1aa0ede856a89b0c8"
23
+ "file": "webslm-node-0.12.1-linux-arm64-gnu.node.gz",
24
+ "size": 6109195,
25
+ "sha256": "c14f81210a07d9ee5fff168c8bf8146315e06dc47eaee3df0b5b2dde175b7ae3",
26
+ "nodeSha256": "4d49e2963081191390873a00ebf07f91f07c1e2747655e05b27c196d543f708f"
27
27
  },
28
28
  "linux-x64-musl": {
29
- "file": "webslm-node-0.12.0-linux-x64-musl.node.gz",
30
- "size": 6939402,
31
- "sha256": "25fdbec04d3bfd53a1134975c6d71a422515a4326c5dfc4cd7fd63bd9e11736a",
32
- "nodeSha256": "97b7acd9fd0e0c65ec39f694faa44e3d7f4ba59bfa34dc1552e16e6f3eb52bbf"
29
+ "file": "webslm-node-0.12.1-linux-x64-musl.node.gz",
30
+ "size": 6943802,
31
+ "sha256": "cdf670f8ca63d67142c7e5dd4494b49b62412f743349f3d7f99b2c4f04b704c2",
32
+ "nodeSha256": "502f6a136da1d64d84f180b05144273db3300e0d480af3bff2b579fd0096ea18"
33
33
  },
34
34
  "linux-arm64-musl": {
35
- "file": "webslm-node-0.12.0-linux-arm64-musl.node.gz",
36
- "size": 6661808,
37
- "sha256": "a71f54029461a8d4b4bdff84f4e17318061314ba5c46e6b2a3468e2b8831ae83",
38
- "nodeSha256": "cfc9475765b25e0a033d52286347054bb74c19d8c30fd306462b600012ab837d"
35
+ "file": "webslm-node-0.12.1-linux-arm64-musl.node.gz",
36
+ "size": 6666573,
37
+ "sha256": "73b1f2db25fb97f87c4dd83307686354c812afaf43f0bb1065a94f2c1e800115",
38
+ "nodeSha256": "0f81a35c9911aab2618df4422c357efbe7f9fa276d6a3ef4443981b5e70d5835"
39
39
  },
40
40
  "win32-x64-msvc": {
41
- "file": "webslm-node-0.12.0-win32-x64-msvc.node.gz",
42
- "size": 7073063,
43
- "sha256": "b8184caa26f7c249e02bc9266177bf1366a2230c4c5d0a0f16cfbd8914a64bb5",
44
- "nodeSha256": "d611a4dde4770ef7df4df92424b09a1b704ea42cef8fbcbe39bddb3c972845e5"
41
+ "file": "webslm-node-0.12.1-win32-x64-msvc.node.gz",
42
+ "size": 7073349,
43
+ "sha256": "64fb0ba03c1d065db61754acd23d117e11610a308146b8f5d5e08c8d8c0dd668",
44
+ "nodeSha256": "4e848546a1de84ecaf98d9cee866ef65a89fff99b37e363c42a54943a879c1e9"
45
45
  }
46
46
  }
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webslm",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Run small language models in the browser and in Node, straight from their original Hugging Face checkpoints: a Rust engine compiled to WebAssembly, in a worker, with an offline cache.",
5
5
  "license": "MIT",
6
6
  "author": "Maxime Golfier",
Binary file
Binary file
Binary file