What it does
Transformers.js is a JavaScript library that lets websites run AI models right in the visitor's browser. It mirrors Hugging Face's Python transformers library, so developers can use the same ready-trained models with very similar code.
Supported tasks include sorting text into categories, answering questions, summarising, translating and generating text; recognising objects in images and estimating depth; and speech recognition and text-to-speech. Models run on the computer's processor by default or on the graphics card through WebGPU, and smaller compressed versions can be used to save download time.
Who it's for
Web developers adding private, on-device AI features to sites and apps.
Can I use it without coding?
Developers only. A JavaScript library for programmers. New to this? Start here.
Can I run it?
- Cost
- FreeNothing to pay or sign up for.
- Runs on
- Web browser
- Computer
- An ordinary computer is fine
- Privacy
- Runs on your own device: your data stays with you
- API key
- Not needed
Try it
Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?
Before you install
- Only download from the official GitHub page. Copies with similar names exist for many popular projects.
- License (Apache-2.0): Permissive: free to use, change and share, including for business.
- More on staying safe
Where people are talking about it
- Transformers.js 3.0 Released with WebGPU SupportHacker News · Oct 2024