transformers.js  by huggingface

Run Transformers models directly in your browser

created 2 years ago
14,253 stars

Top 3.6% on sourcepulse

GitHubView on GitHub
Project Summary

This library enables state-of-the-art machine learning models to run directly in the browser using JavaScript, eliminating the need for server-side infrastructure. It targets web developers and researchers looking to integrate advanced NLP, computer vision, audio, and multimodal capabilities into client-side applications, offering a familiar API to the Hugging Face Python library.

How It Works

Transformers.js leverages ONNX Runtime for efficient execution of models within the browser. Models are converted to the ONNX format, a widely supported intermediate representation, using 🤗 Optimum. This approach allows for broad model compatibility and optimized performance, with support for both CPU (via WebAssembly) and GPU (via WebGPU) execution.

Quick Start & Requirements

Highlighted Details

  • Supports a wide range of tasks including text classification, object detection, speech recognition, and text-to-speech.
  • Offers GPU acceleration via WebGPU for improved performance.
  • Supports model quantization (e.g., q4, q8) for reduced bandwidth and faster inference in resource-constrained environments.
  • Provides a pipeline API mirroring the Python library for ease of use.

Maintenance & Community

  • Developed and maintained by Hugging Face.
  • Active community support through Hugging Face platforms.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

WebGPU is an experimental API and may have inconsistent support across browsers. Some advanced or less common model architectures might not yet be supported or require specific conversion steps.

Health Check
Last commit

22 hours ago

Responsiveness

Inactive

Pull Requests (30d)
19
Issues (30d)
14
Star History
796 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
7 more.

ctransformers by marella

0.1%
2k
Python bindings for fast Transformer model inference
created 2 years ago
updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Eugene Yan Eugene Yan(AI Scientist at AWS), and
10 more.

accelerate by huggingface

0.2%
9k
PyTorch training helper for distributed execution
created 4 years ago
updated 1 day ago
Feedback? Help us improve.