Description
Transformers.js is a JavaScript library that runs Hugging Face Transformers models directly in the browser, with no server needed. It is designed to be functionally equivalent to Hugging Face's Python transformers library, so you can run the same pretrained models with a very similar API. The models cover tasks in several modalities, including natural language processing tasks such as text classification, named entity recognition, question answering, language modeling, summarization and translation, and other areas listed in the README. The README covers installation, a quick tour, custom usage and a settings section. Because inference runs in the browser, your data does not have to leave the page for the model to process it, which is the main reason to choose this approach. The project is on GitHub at huggingface/transformers.js.…
Highlights
- Runs Hugging Face Transformers models in the browser
- Similar API to the Python transformers library
- Natural language tasks such as classification and summarization
- No server needed for inference
- Quick tour, custom usage and settings docs
Ratings & Reviews
No ratings yet
Be the first to rate Transformers.js.
People also visit

transformers
Hugging Face Transformers for loading Hub models, running pipeline inference
Transformers.js FAQ
What is Transformers.js?
A JavaScript library for running Hugging Face Transformers models in the browser.
Does it need a server?
No. The README says you can run the models directly in the browser with no server.
How close is it to the Python library?
The README says it is designed to be functionally equivalent, with a very similar API, so the same pretrained models can be used.
What tasks does it support?
Natural language processing tasks such as text classification, named entity recognition, question answering, summarization and translation, along with other modalities.
Where do I start?
The README has installation and a quick tour, then custom usage and settings.
What are the best Transformers.js alternatives?
Popular alternatives to Transformers.js include Web LLM, Rust Bert and AgentOp. See all Transformers.js alternatives

