transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!

19 articles 15.5k View on GitHub ↗
19 articles
Debugging Model Loading Failures in Transformers.js: A Complete Diagnostic Guide

Troubleshoot Transformers.js model loading errors. Use debug logging to trace the ONNX pipeline and pinpoint failures for effective diagnosis.

how-to-guide
Mar 3, 2026
Supporting Different JavaScript Runtimes (Node.js, Deno, Bun) with the Same API

Learn how huggingface/transformers.js unifies the JavaScript API for Node.js, Deno, and Bun, enabling consistent filesystem access, caching, and model loading across environments.

internals
Mar 3, 2026
Preloading Models at Startup and Managing Persistent Cache Strategies in Transformers.js

Learn to preload Transformers.js models at startup and manage persistent cache with custom backends. Optimize your application's model loading performance efficiently.

performance
Mar 3, 2026
Customizing ONNX Runtime with session_options in Transformers.js: A Complete Guide

Unlock ONNX Runtime power in Transformers.js by customizing session_options. Control execution providers, logging, memory optimization, and hardware acceleration for advanced configuration.

how-to-guide
Mar 3, 2026
How to Stream Generated Text Progressively in Transformers.js Text-Generation Pipelines

Learn to stream generated text progressively in Transformers.js text-generation pipelines. This guide shows how to use TextStreamer for real-time incremental output.

how-to-guide
Mar 3, 2026
Organizing Model Files in Subfolders within Hugging Face Repositories: The Complete Transformers.js Guide

Learn to organize model files in subfolders within Hugging Face repositories using Transformers.js. Load ONNX models easily by specifying the subfolder option in AutoModel.from_pretrained.

how-to-guide
Mar 3, 2026
How to Load Specific Model Revisions or Commits from Hugging Face Hub with transformers.js

Easily load specific model revisions or commits from Hugging Face Hub using transformers.js. Control versions precisely and manage isolated caches with the revision option.

how-to-guide
Mar 3, 2026
Processing Multiple Inputs Through Batch Inference for Throughput in Transformers.js

Boost Transformer inference speed with Transformers.js batching. Process multiple inputs efficiently in a single forward pass for maximum throughput. Learn how.

performance
Mar 3, 2026
Managing Multiple Pipeline Instances and Sharing Model Weights in Transformers.js

Learn to manage multiple pipeline instances and share model weights in Transformers.js. Load once, reuse `PreTrainedModel` for efficient ONNX sessions and reduced memory usage.

best-practices
Mar 3, 2026
Handling Errors and Implementing Retry Logic During Model Loading in Transformers.js

Learn to handle errors and implement retry logic for model loading in Transformers.js. Make model loading resilient to network failures with exponential back-off and status code inspection.

how-to-guide
Mar 3, 2026
Running Transformers.js Inference in Web Workers to Avoid Blocking the Main Thread

Learn how to run Transformers.js inference in Web Workers to prevent blocking the main thread and maintain a responsive browser UI during heavy model operations.

performance
Mar 3, 2026
Comparing dtype Options and Their Impact on Model Accuracy and Performance in transformers.js

Explore dtype options in transformers.js like fp32, fp16, and q4 to balance speed, accuracy, and memory for your AI models. Learn how selectDtype optimizes performance.

performance
Mar 3, 2026

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →