Transformers.js
Runs Hugging Face AI models directly in a web browser, with no server needed.
- Your data
- Stays on your device
- Coding needed
- Developers only
- Cost
- Free
- Runs on
- Web browser
- Computer
- An ordinary computer is fine
Runs Hugging Face AI models directly in a web browser, with no server needed.
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.
Web developers adding private, on-device AI features to sites and apps.
Developers only. A JavaScript library for programmers. New to this? Start here.
Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?