Devtoolwatch BoardGet it every Monday

Transformers.js review

Transformers.js is a JavaScript library from Hugging Face that runs pretrained Transformers models directly in the browser, with no server needed.

Updated Nov 1, 2026. Review written Oct 22, 2026 from the project's own sources; usage data refreshed every Monday.

TL;DR

Transformers.js is a JavaScript library for running pretrained machine learning models in the browser using ONNX Runtime. Transformers.js is for web developers who want on-device NLP, vision, audio, or multimodal inference. Transformers.js is designed to be functionally equivalent to Hugging Face's Python transformers library, with a very similar pipeline API.

Transformers.js at a glance

Category
Model SDKs and gateways
Maintained by
Hugging Face (organization, @huggingface on GitHub)
License
Apache 2.0
Language
JavaScript, TypeScript, Vim Snippet
Repository
github.com/huggingface/transformers.js
Website
huggingface.co/docs/transformers.js
npm package
@huggingface/transformers 4.3.1
Latest release
4.3.1 on GitHub, Oct 7, 2026
First published
Feb 13, 2023

What Transformers.js does

  • Transformers.js runs NLP tasks such as text classification, named entity recognition, question answering, summarization, translation, and text generation.
  • Transformers.js supports vision tasks including image classification, object detection, segmentation, depth estimation, and background removal.
  • Transformers.js handles audio tasks such as automatic speech recognition, audio classification, and text-to-speech.
  • Transformers.js produces embeddings and supports zero-shot audio classification, image classification, and object detection.
  • Transformers.js runs models on CPU via WASM by default, or on GPU via WebGPU with the device option.
  • Transformers.js supports quantized models through the dtype option, with choices such as fp32, fp16, q8, and q4.
  • Transformers.js added tool calling in TextGenerationPipeline in version 4.2.0. It also offers an experimental structured output package for JSON schema or regex constraints.

How it works

Transformers.js uses ONNX Runtime to run models in the browser. You call the pipeline function with a task and an optional model id. The pipeline loads a model and handles input preprocessing and output postprocessing. By default, Transformers.js fetches hosted pretrained models from the Hugging Face Hub and precompiled WASM binaries from a CDN. Both locations can be changed through env settings.

How to install and start using Transformers.js

With npm

npm i @huggingface/transformers

Requirements

  • Models must be in ONNX format. PyTorch, TensorFlow, or JAX models can be converted with Hugging Face Optimum.
  • GPU inference requires a browser with WebGPU support. Version 4.3.0 added WebGPU support for Safari 26+.

First steps

  1. Install Transformers.js from npm, or import it from the jsDelivr CDN as an ES module without a bundler.
  2. Import pipeline from '@huggingface/transformers' and allocate a pipeline, for example await pipeline('sentiment-analysis').
  3. Pass a model id as the second argument to pipeline to use a specific model from the Hub.
  4. Set device: 'webgpu' or a dtype such as 'q4' in the pipeline options to use the GPU or a quantized model.

Who Transformers.js is for

  • Web developers who want to run ML models client-side in the browser without a server
  • Developers familiar with the Python transformers library who want a similar API in JavaScript
  • Building in-browser semantic search or embedding features with feature-extraction pipelines
  • Teams building browser extensions, Electron apps, or Node.js server-side inference

Limitations to know

  • Transformers.js notes that the WebGPU API is still experimental in many browsers, so GPU runs may hit issues.
  • Transformers.js does not support some tasks, including table question answering, mask generation, and video classification.
  • Transformers.js recommends quantized models in browsers to lower bandwidth, which trades some precision for size.
  • The Transformers.js structured output package is marked experimental.

Is Transformers.js growing? Usage data

In the week of Oct 25–31, 2026, Transformers.js ranked #296 on the Devtoolwatch Board and #17 in Model SDKs and gateways, with a momentum score of 32 out of 100. Its main package had about 4.9M downloads that week, +5% against its own 4-week average.

New GitHub stars per week for Transformers.js12 weeks from Aug 9, 2026: 25, 14, 15, 14, 15, 18, 31, 20, 12, 15, 29, 17 new stars, an average of 19 a week.Aug 9week of Oct 25
New GitHub stars per week for the last 12 weeks, from GitHub's stargazer history (today's stargazers by the week they starred).
Show the weekly numbers
New GitHub stars per week for Transformers.js
Week ofNew stars
Aug 9, 202625
Aug 16, 202614
Aug 23, 202615
Aug 30, 202614
Sep 6, 202615
Sep 13, 202618
Sep 20, 202631
Sep 27, 202620
Oct 4, 202612
Oct 11, 202615
Oct 18, 202629
Oct 25, 202617

On Hacker News

The Board ranks tools by four signals each week: new stars, new stars for the repo's size, added downloads and download growth beyond the market. How the ranking works.

Transformers.js alternatives

Other LLM SDKs and gateways on the Board in the week of Oct 25–31, 2026, by momentum:

Model SDKs and gateways ranked by momentum, the week of Oct 25–31, 2026
RankToolStarsDownloads/wk
#1thinking-orbsthinking-orbs is a React library of dotted, animated thought-orb loading indicators for AI and agent user interfaces.3.9k1.4M
#2HeadroomHeadroom compresses tool outputs, logs, files, and RAG chunks locally before they reach the LLM, as a library, proxy, or MCP server.78.5k125.8k
#3LiteLLMLiteLLM is an open source AI gateway and Python SDK that calls 100+ LLM providers through one OpenAI-format interface.62.5k23.1M
#4Honcho Memory library for building stateful agents7.9k–
#5Anthropic SDKAnthropic SDK is the official Python library for calling the Claude API from Python applications.4k111M
#6Hugging Face HubHugging Face Hub is the official CLI and Python client for downloading, uploading and managing models, datasets and Spaces on the…4k68.3M

All LLM SDKs and gateways, ranked

Recent Transformers.js releases

Transformers.js FAQ

Is Transformers.js free and open source?

Yes. Transformers.js's source code is on GitHub (huggingface/transformers.js) under the Apache 2.0 license, so you can use it for free. Its website also links to a pricing page (https://huggingface.co/pricing) for any paid plans.

How do I install Transformers.js?

Run npm i @huggingface/transformers. The install section above has the other options from the project's README.

Is Transformers.js still maintained?

Yes. The huggingface/transformers.js repository was last updated on Oct 21, 2026, and the latest release, 4.3.1 on GitHub, came out on Oct 7, 2026.

How popular is Transformers.js?

Transformers.js has 16.4k GitHub stars as of Nov 1, 2026. It gained 17 new stars in the week of Oct 25–31, 2026, against a 12-week average of 19 a week. Its main package had about 4.9M downloads that week, +5% against its own 4-week average. That made it #17 among LLM SDKs and gateways on the Devtoolwatch Board.

What are the best alternatives to Transformers.js?

Other LLM SDKs and gateways on the Devtoolwatch Board in the week of Oct 25–31, 2026, by momentum: thinking-orbs (#1), Headroom (#2), LiteLLM (#3), Honcho (#4), Anthropic SDK (#5). The alternatives table above has their numbers.

How does Transformers.js work?

Transformers.js runs ONNX models in the browser through ONNX Runtime. You call the pipeline API with a task and an optional model id. By default, Transformers.js runs on CPU via WASM. You can switch to GPU with device: 'webgpu'.

What does Transformers.js do?

Transformers.js lets you run pretrained Hugging Face models in JavaScript, directly in the browser and with no server. It covers NLP, computer vision, audio, and multimodal tasks such as embeddings and zero-shot classification.

Can I use my own PyTorch model with Transformers.js?

Yes. Convert your PyTorch, TensorFlow, or JAX model to ONNX using Hugging Face Optimum, then load it in Transformers.js. You can point env.localModelPath at local models and set env.allowRemoteModels to false.

Does Transformers.js work without a bundler?

Yes. Transformers.js can be imported in vanilla JS as an ES module from a CDN or static hosting, for example from cdn.jsdelivr.net.

Does Transformers.js support tool calling or structured output?

Yes. Version 4.2.0 added tools to TextGenerationPipeline. Version 4.3.0 added an experimental @huggingface/transformers-structured-output package that constrains generation to a JSON schema, a JSON object, or a regular expression.

Sources

  1. huggingface/transformers.js on GitHub
  2. Transformers.js README
  3. @huggingface/transformers on npm
  4. Transformers.js website
  5. Release 4.3.1 (Oct 7, 2026)
  6. Release 4.3.0 (Sep 16, 2026)
  7. Release 4.2.0 (Apr 23, 2026)
  8. Hacker News: Qwen 3.8 27B
  9. Hacker News: Kimi-K3 on HuggingFace
  10. Hacker News: DeepSeek-v3.2: Pushing the frontier of open large language models [pdf]
  11. Devtoolwatch Board, the week of Oct 25–31, 2026

Transformers.js README badge

Maintainers can show the tool's weekly Board rank in their README:

Devtoolwatch badge for Transformers.js

[![Devtoolwatch](https://index.devtoolwatch.com/badge/transformers-js.svg)](https://index.devtoolwatch.com/tools/transformers-js/)

How this page is made: Devtoolwatch writes each review from the project's README, releases, package metadata and website, with an AI model, then checks every claim against the source it cites and drops what the sources don't support. The numbers come from Devtoolwatch's daily GitHub snapshots, GitHub's stargazer history, and the npm and PyPI download APIs. Spotted an error? Email [email protected].