Overview
Transformers.js enables running Hugging Face Transformer models directly in browsers and Node.js without a server, suitable for edge and client-side inference with good portability.
Key features
- Run common NLP, vision and audio tasks client-side.
- Pipeline API compatible with Python Transformers and support for quantization and precompiled WASM/ONNX backends.
- Rich examples and demos for quick integration into web apps and demos.
Use cases
- Privacy-preserving client-side inference without sending data to servers.
- Building interactive demos, browser extensions, or offline inference features.
- Reducing bandwidth and compute in constrained environments via quantized models.
Technical details
- Multiple backends (WebGPU, WASM, ONNX) selectable by environment.
- Uses Hugging Face Hub models and precompiled binaries with options for local model paths.
- Frontend-optimized API designed to mirror the Python Transformers developer experience.