Transformers.js
A JavaScript version of the Transformers library developed by Hugging Face. It relies on ONNX Runtime Web for model inference and supports WebAssembly or WebGPU backends for running AI models in the browser.
Core Facts
Timeline (last 90 days)
Transformers.js 4.3.1 paired with onnxruntime-web 1.31.0-dev.20260914 automatically uses the regular (non-asyncify) WebAssembly build only when the Safari version is below 26 and there is no WebGPU.
You should use env.backends.onnx.versions.web rather than a hardcoded version number to construct the onnxruntime-web wasm file URL, to ensure the .wasm binary and .mjs glue code versions are strictly consistent and avoid runtime errors caused by ABI mismatch.
Transformers.js 4.3.1 by default (when WebGPU is available or the Safari version is >= 26) chooses the asyncify build (ort-wasm-simd-threaded.asyncify.{mjs,wasm}) to load ONNX Runtime Web.
Transformers.js version 4.3.1 can be used to run AI model inference directly in the browser.
GrassToucher's AI model pipeline is designed to run open-weight models such as Google Gemma 2 and can be adapted for local execution via Ollama or Transformers.js.
By compiling a machine learning inference engine (such as ONNX Runtime Web or Transformers.js) into a Wasm module and loading quantized model weights, image inference can be completed locally on the user's device, with photos never leaving the local device.
Open-source frameworks such as MLC-LLM and Transformers.js are specifically optimized for browser-side inference scenarios, capable of loading model weights in ONNX, GGUF, and other formats into browser memory and executing inference.
The team fully reimplemented LLGuidance in pure JavaScript, eliminating the dependency on the 1MB WASM file.
Transformers.js released version v4.3, with the core highlight being Structured Output.
Structured Output allows large models running in the browser to generate content strictly according to a predefined schema.
5 more timeline events
All Facts (16)
Transformers.js is a JavaScript library developed by Hugging Face that, based on WebAssembly and WebGPU technology, ports Transformer model inference to browser environments.
70%UnverifiedYou should use env.backends.onnx.versions.web rather than a hardcoded version number to construct the onnxruntime-web wasm file URL, to ensure the .wasm binary and .mjs glue code versions are strictly consistent and avoid runtime errors caused by ABI mismatch.
50%UnverifiedTransformers.js 4.3.1 by default (when WebGPU is available or the Safari version is >= 26) chooses the asyncify build (ort-wasm-simd-threaded.asyncify.{mjs,wasm}) to load ONNX Runtime Web.
50%UnverifiedTransformers.js 4.3.1 paired with onnxruntime-web 1.31.0-dev.20260914 automatically uses the regular (non-asyncify) WebAssembly build only when the Safari version is below 26 and there is no WebGPU.
50%UnverifiedTransformers.js version 4.3.1 can be used to run AI model inference directly in the browser.
50%UnverifiedGrassToucher's AI model pipeline is designed to run open-weight models such as Google Gemma 2 and can be adapted for local execution via Ollama or Transformers.js.
50%UnverifiedBy compiling a machine learning inference engine (such as ONNX Runtime Web or Transformers.js) into a Wasm module and loading quantized model weights, image inference can be completed locally on the user's device, with photos never leaving the local device.
50%UnverifiedOpen-source frameworks such as MLC-LLM and Transformers.js are specifically optimized for browser-side inference scenarios, capable of loading model weights in ONNX, GGUF, and other formats into browser memory and executing inference.
50%UnverifiedTransformers.js v4 restructured the GitHub repository, added a packages directory, and introduced the Transformers Structured Output package.
50%UnverifiedThe Structured Output feature required almost no changes to the core Transformers.js code, because it already supports the Logits Processor mechanism.
50%UnverifiedThe team fully reimplemented LLGuidance in pure JavaScript, eliminating the dependency on the 1MB WASM file.
50%UnverifiedStructured Output allows large models running in the browser to generate content strictly according to a predefined schema.
50%UnverifiedProjects such as Transformers.js and WebLLM have demonstrated that small-to-medium-scale language models can run smoothly in the browser without a backend server.
50%UnverifiedOn Chrome, Apogee integrates WebGPU to leverage GPU-accelerated local model inference; on Firefox, it uses Transformers.js to run lightweight models within the browser.
50%UnverifiedOpenAI的Whisper模型已有多个社区版本被移植到ONNX Runtime Web和Transformers.js等框架,可在客户端完成语音转文字
50%UnverifiedTransformers.js released version v4.3, with the core highlight being Structured Output.
50%