• Transformers.js v4 Preview: Now Available on NPM! • We’re excited to announce that Transformers.js v4 (preview) is now available on NPM! • After nearly a year of development (we started in March 2025 🤯), we’re finally ready for you to test it out. • Previously, users had to install v4 directly from source via GitHub, but now it’s as simple as running a single command! • npm i @huggingface/transformers@next We’ll continue publishing v4 releases under the next tag on NPM until the full release, so expect regular updates! • Performance & Runtime Improvements The biggest change is undoubtedly the adoption of a new WebGPU Runtime, completely rewritten in C++.
Article Summaries:
- Transformers.js v4 Preview released on NPM
Hugging Face has made the preview of Transformers.js v4 available via NPM, simplifying installation to a single command (npm i @huggingface/transformers@next). The new release introduces a WebGPU runtime rewritten in C++, delivering significant performance gains-up to a ~4× speedup for BERT‑based models-and broader compatibility across browsers, Node, Bun, and Deno. It also supports offline use by caching WASM files locally. The codebase has been restructured into a monorepo with pnpm workspaces, enabling smaller sub‑packages, and a modular class architecture replaces the monolithic models.js file, improving maintainability and model addition.
Sources: