Transformers.js v4: Now Available on NPM!
Hugging Face Blog 5 months ago
Transformers.js v4 was released on NPM with a new WebGPU runtime written in C++ that enables AI models to run with hardware acceleration across browsers, Node.js, Bun, and Deno. The build system migration from Webpack to esbuild reduced build times from 2 seconds to 200 milliseconds and cut the default bundle size by 53%. The library now supports advanced model architectures like Mamba and Mixture of Experts, adds production-ready features like ModelRegistry for inspecting pipeline assets before loading, and extracts tokenization logic into a separate 8.8kB library.