qmetrics.net

Transformers.js

Hugging Face transformers machine learning in the browser

Transformers.js screenshot

Transformers.js runs pretrained Hugging Face-style models in the browser via ONNX Runtime, with a pipeline API for NLP, vision, audio, and multimodal tasks.

Overview

Transformers.js brings Hugging Face transformers workflows to JavaScript so models can run in the browser without a dedicated inference server. The API is intended to mirror the Python transformers library closely so many of the same pretrained models can be used with familiar call patterns.

The pipeline API bundles preprocessing, model inference, and postprocessing for tasks across modalities. Documented support includes text classification, question answering, summarization, translation, generation, image classification, object detection, segmentation, depth estimation, speech recognition, audio classification, text-to-speech, and several multimodal zero-shot tasks.

Inference uses ONNX Runtime in the browser, with models runnable on CPU through WASM by default or on WebGPU when configured. Quantized dtypes such as q8 or q4 can reduce bandwidth and memory use in constrained environments. Models can be loaded from the Hub or custom paths, and PyTorch, TensorFlow, or JAX checkpoints can be converted to ONNX using Optimum.

Installation is available through NPM or CDN import for vanilla pages. By default the library fetches hosted pretrained weights and WASM binaries, with settings to override those paths for custom hosting.

Key features

  • Pipeline API aligned with Python transformers
  • ONNX Runtime in-browser inference
  • WebGPU or WASM CPU execution
  • Quantized model dtype options
  • NLP, vision, audio, and multimodal tasks
  • Hub model IDs or local ONNX paths
  • CDN and NPM distribution
  • Optimum-based model conversion path

Use cases

  • Client-side sentiment analysis
  • In-browser speech transcription
  • Image classification without a server
  • Privacy-sensitive local inference
  • Prototyping HF models in web apps

Tags

Similar software

TensorFlow

End-to-end machine learning platform and tooling ecosystem

TensorFlow is a machine learning platform with Python and C++ APIs, optional GPU packages, and companion libraries for data, training, deployment, and visualization.

★ 201.8k⟳ todayApache-2.0

Transformers

Shared model definitions for multimodal ML workloads

Transformers is a Python library that defines pretrained text, vision, audio, and multimodal models once in PyTorch for shared inference and training across the ecosystem.

★ 169.4k⟳ todayApache-2.0

RAGFlow

Open-source RAG engine and agent context platform

RAGFlow ingests heterogeneous documents, builds retrievable knowledge, and supports agent workflows with citations. It can run on your own hardware with Docker or a from-source server stack.

★ 94.8k⟳ todayApache-2.0

Headroom

Local LLM context compression library and proxy

Headroom shrinks tool outputs, logs, JSON, and chat history before LLM calls to cut input tokens while preserving retrievable originals. It offers a Python library, proxy, MCP tools, and agent wrappers.

★ 81k⟳ yesterdayApache-2.0

Unsloth

Local desktop workspace to run and fine-tune AI models

Unsloth is a desktop application to chat with, fine-tune, and serve LLMs, diffusion, audio, and embedding models on your own hardware with optional agent integrations.

★ 80.4k⟳ todayApache-2.0

Models

TensorFlow reference models and modeling utilities collection

The TensorFlow Model Garden hosts implementations of models and modeling solutions for TensorFlow, installable via pip as tf-models-official.

★ 77.6k⟳ 11 days agoApache-2.0