# Transformers.js: 8.4 out of 10

A strong pick. 1st of 7 in [Machine learning in JavaScript](https://elestia.ai/opensource/ml/index.md).

Transformers.js is Hugging Face's library for running pretrained ONNX models on the device. It runs in the browser on WebGPU or WASM, and in Node, Bun and Deno, and covers text, vision, audio and LLM tasks. It is the broadest, most actively maintained general-purpose choice in this category today, and the one to start with unless you only need LLM chat (WebLLM, node-llama-cpp) or ready-made vision tasks (MediaPipe).

**Best for:** JS/TS developers who want to run Hugging Face models for embeddings, classification, speech, vision or small LLMs locally in the browser or Node with a pipeline API.

## Scores

- **Overall: 8.4** (likely 7.3 to 9.3)
  - Claude Opus 5.5 (8.0): It is the strongest general-purpose pick for on-device ML in JS. It has the broadest model coverage, active funded maintenance, a modern WebGPU runtime and fast-growing use. TensorFlow.js and brain.js have stalled, and WebLLM and node-llama-cpp serve only LLMs. LLM decode speed and the heavy Node install keep it short of a clear 9.
  - GPT-6.2 Sol (8.7): Transformers.js is my first choice for a new JavaScript project that needs several kinds of local inference. The typed API, model catalog, active maintenance, and Firefox deployment carry the most weight. WebLLM is a strong option for browser-only chat, and node-llama-cpp is a better fit for a Node.js app built around GGUF models. Device-dependent performance and model compatibility keep the recommendation below a category-wide default.
- **Needed by many: 4.3** (likely 3.2 to 5.4)
  - Claude Opus 5.5 (5.0): Running ML on the device is a growing but still minority need among JS developers. Local embeddings for search and RAG widen the group. Within the category, Transformers.js covers the most task types on both browser and server runtimes, so it is broad for its niche.
  - GPT-6.2 Sol (3.5): On-device ML is a clear niche. In the 2025 State of JavaScript survey, 242 of 10,926 respondents to the use-case question reported using JavaScript for machine learning. Browser and Node.js support give Transformers.js a broad remit within that niche, and the survey leaves room for developers who describe their work as web development.
- **Helps a lot: 8.3** (likely 7.2 to 9.3)
  - Claude Opus 5.5 (8.0): It has the widest task and model coverage in the category, a simple pipeline API, types, and a v4 WebGPU runtime with real speedups. LLM decoding speed trails WebLLM and newer engines such as Kiln. Large Node installs and cold-start costs are clear limits.
  - GPT-6.2 Sol (8.6): Version 4.3.2 covers embeddings, chat, speech, and vision through a common API. The types and runnable examples give coding agents a clear starting point for standard tasks. An independent MiniLM test found WebAssembly faster than WebGPU on one laptop, and a user reported iOS Safari crashes with longer prompts. Performance and error handling still depend heavily on the model, backend, and device.
- **Holds up over time: 8.2** (likely 7.1 to 9.2)
  - Claude Opus 5.5 (8.0): Hugging Face funds it. It had 172 commits and 8 releases last year, the latest in late October 2026, plus a major v4 rewrite with the ONNX Runtime team. It still rests on a small core team led by its creator. The move from v3 to v4 and from @xenova to @huggingface caused some migration churn.
  - GPT-6.2 Sol (8.4): The project recorded 172 commits and eight releases in the last year, and two Hugging Face maintainers have cut GitHub releases. One recent model-download fix reached a stable release nine days after the pull request opened. The small release team and v4's substantial runtime changes leave some uncertainty about upgrade effort and support across devices.
- **Used widely: 7.4** (likely 6.0 to 8.6)
  - Claude Opus 5.5 (8.0): Downloads went from 0.67M to 19.4M per 4 weeks, a ratio of about 29x against a median of 4.1. Part of that comes from the migration off @xenova/transformers and from being a dependency of other tools, so direct choice is lower than the raw count suggests. It has 16k stars and steady HN and Bluesky attention, and the dependents count is missing because the package is scoped.
  - GPT-6.2 Sol (6.7): Four-week npm downloads rose from 671,493 to 19.4 million, up 28.9× against the catalog median of 4.1×. That is the second-fastest growth among the listed projects, and Bluesky attention is close to WebLLM's. npm search shows about 1,550 dependent packages, while ecosyste.ms has no count for the package. Build servers and transitive installs blur the number of direct choices, and GitHub stars cover the full repository, including related packages.
- **Vouched for: 7.5** (likely 6.4 to 8.5)
  - Claude Opus 5.5 (7.0): Firefox ships a vendored copy for its local ML features. Hugging Face backs it, and the ONNX Runtime team co-developed the v4 runtime. Independent guides from Intel, web.dev, SitePoint and an arXiv benchmark treat it as the reference browser ML library. Survey data on satisfaction is thin.
  - GPT-6.2 Sol (7.9): Mozilla ships Transformers.js in Firefox for PDF alt text and smart tab grouping, using its own native ONNX backend. Continue includes it as a local embeddings provider in VS Code. Independent benchmarks and developer reports add evidence for embeddings, classification, and transcription, with limited coverage across devices and little survey evidence about satisfaction.
- **Safe: 7.2** (likely 6.0 to 8.3)
  - Claude Opus 5.5 (7.0): It has no advisories, an Apache-2.0 licence and 5 direct dependencies. The bundle has no Scorecard data. In Node, onnxruntime-node brings a large native binary footprint, and models are fetched from remote hubs at runtime, which widens the attack surface.
  - GPT-6.2 Sol (7.4): The package uses the permissive Apache-2.0 license, and OSV lists zero direct advisories. Its five direct dependencies include ONNX Runtime, a development build of the web runtime, and the native image library sharp. GitHub shows a verified release commit and no repository security policy. OpenSSF Scorecard data, npm publishing provenance, and the number of authorized npm publishers remain unverified.

## Good

- It works with thousands of ready-converted models on the Hugging Face Hub, across about 200 architectures, through one pipeline() API that mirrors Python Transformers.
- The v4 WebGPU runtime was built with the ONNX Runtime team and gives about 4x faster BERT embeddings, with a WASM fallback.
- The same code runs in browsers, Node, Bun and Deno, and v4.3 added WebGPU on Safari 26+, structured output and tool calling.
- Hugging Face employs the maintainers, who ship releases often, and it ships with TypeScript types.

## Bad

- In Node it pulls in onnxruntime-node, which is over 200 MB and can break serverless size limits.
- For autoregressive LLM chat, WebLLM and newer WebGPU engines are often faster.
- Cold start is slow because models must be downloaded and warmed up, and users report memory spikes and UI freezes unless inference runs in a worker.
- Custom models need an ONNX export that matches the library's expectations, and mismatched onnxruntime versions cause crashes.

## The numbers

- Downloads, 4 weeks: 19M
- In a year: ×29
- GitHub stars: 16k
- Commits, 12 months: 172
- Last npm release: Oct 2026
- Advisories, 24 months: 0
- Licence: Apache-2.0
- GitHub: https://github.com/huggingface/transformers.js
- npm: https://www.npmjs.com/package/@huggingface/transformers

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
