rotative
huggingface blog · February 9, 2026

Transformers.js v4 launches with C++ WebGPU runtime and 4x BERT speedup

huggingface released transformers.js v4, featuring a rewritten c++ webgpu runtime enabling local inference in node, bun, and deno. the update introduces a monorepo structure, splits the 8,000-line models file into modules, and adds support for gpt-oss, mamba, and mixture of experts architectures. benchmarking shows a 4x speedup for bert-based embedding models.

read in 简体中文 · 繁體中文 · 日本語 · 한국어

Hugging Face released Transformers.js v4, introducing a WebGPU runtime completely rewritten in C++ to enable high-performance local inference. The new runtime leverages ONNX Runtime Contrib Operators—such as `com.microsoft.GroupQueryAttention` and `com.microsoft.MatMulNBits`—to accelerate execution, achieving a 4x speedup for BERT-based embedding models. This update extends support beyond browsers to server-side environments like Node.js, Bun, and Deno.

The release includes a major codebase restructuring, moving from a single package to a pnpm-based monorepo to manage sub-packages more effectively. Developers also refactored the monolithic `models.js` file—previously over 8,000 lines—into focused, maintainable modules. Additionally, the library adds support for advanced architectures, including GPT-OSS, Mamba, and Mixture-of-Experts (MoE).

read at source ↗

← rotative