Skip to content
PluginStats

webslm weekly downloads statistics

By maxgfr (3 listings) · npm · AI SDKs

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.

View on npm Fresh · Dec 6, 2026

webslm has 5,375 recorded weekly downloads on npm, ranking #1500 of 3,247 tracked listings.

Weekly downloads
5,375
Official API · Dec 5, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#1500
Among tracked npm listings

About webslm

webslm

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.

npm install webslm
import { ask } from "webslm";

console.log(await ask("Write a haiku about the sea"));

The first call downloads the default model (LFM2.5 350M, about 710 MB) into a local cache; later runs load it offline. The same code runs in browsers, Node 20+ and Bun, with no bundler or setup in Node.

  • Runs in a dedicated module Worker in browsers (worker_threads in Node), so the page stays responsive.
  • 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.
  • Streams answers, keeps conversations, and exposes a low-level session API (teacher-forced scoring, step-wise decoding, logits and hidden states as Float32Arrays).
  • Searches the Hub for models it can run.
  • Answers about images and video, embeds texts, transcribes speech, generates images and trains LoRA adapters on the device.

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 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/.

Ask

import { ask } from "webslm";

const text = await ask("What is the capital of France?"); // DEFAULT_MODEL
const fact = await ask("What is 2 + 2?", { model: "Qwen/Qwen3-0.6B", think: false });

ask and stream load their model on first use and share it between calls (concurrent calls wait for the same load). unloadAll() frees them. A Node script exits on its own when it is done; no cleanup is needed.

Options, all optional:

OptionDefault
modelDEFAULT_MODELHub repository id or a source (module-level calls only)
maxTokens512Largest number of new tokens (reasoning included)
temperaturethe model card's for the curated models, else the checkpoint's generation_config.json, else 0.70 is greedy, deterministic decoding
systemSystem prompt
thinkthe template's defaultenable_thinking for models that reason first (Qwen3, LFM3, and Qwen3.5 when asked); ignored by the others
stopStrings that end the answer (never emitted, not even in part)
seedSeed of the sampler: same seed, same answer
topK, topP, minPthe checkpoint'sSampling filters
repetitionPenalty, presencePenalty, frequencyPenaltyPenalties on repeated tokens
jsonfalseAnswer with a JSON object (constrained decoding)
schemaAnswer with JSON following this JSON schema (see Generation controls)
thinkingBudgetMost reasoning tokens before the model must answer
loopDetectionfalseStop when the answer starts repeating itself
contextShiftfalseWhen the context is full, drop the oldest turns (the system prompt stays)
speculative"off""auto", a number of tokens to guess per forward pass, or "mtp" / "mtp:N" (Qwen3.5's own draft head, loaded with mtp: true): same answer, faster when it repeats the prompt (see Generation controls)
templateKwargsExtra chat template variables
signalAbortSignal; ask then rejects with code "ABORTED"
onTokenCalled with each piece of the answer
onReasoningCalled with each piece of the reasoning
withReasoningfalseask resolves to { text, reasoning }
Reasoning

Models such as Qwen3 and LFM3 write their reasoning in a <think>…</think> block before the answer. ask, stream and chats return the answer without it; ask for it explicitly:

const { text, reasoning } = await ask("Is 97 prime?", { model: "Qwen/Qwen3-0.6B", withReasoning: true });

The split is generic: a <think> block at the start of the output (or one the chat template opens in the prompt) is reasoning, whatever the model. splitReasoning(output, opened?) applies it to text you already have (opened: the prompt opened the block, as Qwen3.5's and LFM3's do when thinking; inferred when left out). A reasoning model can spend its maxTokens thinking, leaving an empty answer: raise maxTokens or pass think: false.

Stream

import { stream } from "webslm";

const answer = stream("Tell me a story");
for await (const text of answer) process.stdout.write(text);
await answer.text; // the whole answer

answer.stop(), or leaving the loop early, stops the generation; the stream then ends normally and answer.text holds what was generated. answer.reasoning resolves to the reasoning, if any.

Load a model and chat

import { load } from "webslm";…

Description from the npm listing.

  • llm
  • slm
  • wasm
  • webassembly
  • safetensors
  • huggingface
  • browser
  • worker
  • opfs
  • language-model
  • chat
  • inference
  • node
  • bun
  • ai-sdk

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

webslm weekly downloads on npm, last 90 days: 5,375 weekly downloads as of Dec 5, 2026.webslmWeekly downloads on npm · Last 90 days5,375downloads / week01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
webslm weekly downloads on npm, last 90 days: 5,375 weekly downloads as of Dec 5, 2026.

7/30/90-day growth

webslm weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.webslmWeekly downloads growth on npm5,375downloads / week now7-day growth+5,375 weekly downloadsInsufficient history30-day growth+5,375 weekly downloadsInsufficient history90-day growth+5,375 weekly downloadsInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
webslm weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

webslm npm ranking history: currently #1500 (by weekly downloads).webslmnpm ranking · by weekly downloads · Last 90 days#1500current rank#1400#1420#1440#1460#1480#1500#1520Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankDec 5, 2026 – Dec 6, 2026 · 2 observations · Updated Dec 5, 2026pluginstats.com
webslm npm ranking history: currently #1500 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 75, #20 (overall #1,500)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 6, #12 (overall #112)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (121)
Recent weekly downloads observations for webslm
Date (UTC)Weekly downloadsChange vs. previous
5,375+151
5,224+1.4K
3,823+1.7K
2,112+1.1K
1,019+1K
00
00
00
00
00
00
00
00
0—

Similar npm AI SDKs plugins

All 20 webslm alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/webslm. First seen Dec 5, 2026; last successful collection Dec 6, 2026. See the methodology.