
Transformers.js
Run Hugging Face Transformer models directly in JavaScript, no Python server needed.
About
Transformers.js is Hugging Face's JavaScript library for running state-of-the-art machine learning models in the browser and in Node.js, Bun, and Deno. It mirrors the Python transformers pipeline API, so developers can run the same pretrained models with a familiar interface.
It covers text, vision, audio, and multimodal tasks: sentiment analysis, translation, summarization, image classification, object detection, and speech recognition. Models are fetched from the Hugging Face Hub and executed client-side, which keeps data on the device and removes backend inference costs.
What it can do
- Pipeline API matching Python transformers
- Text, vision, audio, and multimodal tasks
- Client-side inference with no backend
- Model loading from the Hugging Face Hub
Setup
Install via npm with npm install @huggingface/transformers, or load it from a CDN as an ES module in the browser.
Prerequisites
A JavaScript runtime (browser, Node.js, Bun, or Deno); internet access to download models from the Hub.
Use cases
Works with
Trust score — 8/10
Scored 8/10 (verified tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 116; Trending score 82/100 from researcher assessment.
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.