- Add support for Gemma 4
From Transformers.js
Run Hugging Face transformer models directly in the browser or Node.
| May | Jun | Jul | Aug | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sunday | No releases on May 3, 2026 | No releases on May 10, 2026 | No releases on May 17, 2026 | No releases on May 24, 2026 | No releases on May 31, 2026 | No releases on Jun 7, 2026 | No releases on Jun 14, 2026 | No releases on Jun 21, 2026 | No releases on Jun 28, 2026 | No releases on Jul 5, 2026 | No releases on Jul 12, 2026 | No releases on Jul 19, 2026 | No releases on Jul 26, 2026 | No releases on Aug 2, 2026 | No releases on Aug 9, 2026 | No releases on Aug 16, 2026 |
| Monday | No releases on May 4, 2026 | No releases on May 11, 2026 | No releases on May 18, 2026 | No releases on May 25, 2026 | No releases on Jun 1, 2026 | No releases on Jun 8, 2026 | No releases on Jun 15, 2026 | No releases on Jun 22, 2026 | No releases on Jun 29, 2026 | No releases on Jul 6, 2026 | No releases on Jul 13, 2026 | No releases on Jul 20, 2026 | No releases on Jul 27, 2026 | No releases on Aug 3, 2026 | No releases on Aug 10, 2026 | No releases on Aug 17, 2026 |
| Tuesday | No releases on May 5, 2026 | No releases on May 12, 2026 | No releases on May 19, 2026 | No releases on May 26, 2026 | No releases on Jun 2, 2026 | No releases on Jun 9, 2026 | No releases on Jun 16, 2026 | No releases on Jun 23, 2026 | No releases on Jun 30, 2026 | No releases on Jul 7, 2026 | No releases on Jul 14, 2026 | No releases on Jul 21, 2026 | No releases on Jul 28, 2026 | No releases on Aug 4, 2026 | No releases on Aug 11, 2026 | No releases on Aug 18, 2026 |
| Wednesday | No releases on May 6, 2026 | No releases on May 13, 2026 | No releases on May 20, 2026 | No releases on May 27, 2026 | No releases on Jun 3, 2026 | No releases on Jun 10, 2026 | No releases on Jun 17, 2026 | No releases on Jun 24, 2026 | No releases on Jul 1, 2026 | No releases on Jul 8, 2026 | No releases on Jul 15, 2026 | No releases on Jul 22, 2026 | No releases on Jul 29, 2026 | No releases on Aug 5, 2026 | No releases on Aug 12, 2026 | No releases on Aug 19, 2026 |
| Thursday | No releases on May 7, 2026 | No releases on May 14, 2026 | No releases on May 21, 2026 | No releases on May 28, 2026 | No releases on Jun 4, 2026 | No releases on Jun 11, 2026 | No releases on Jun 18, 2026 | No releases on Jun 25, 2026 | No releases on Jul 2, 2026 | No releases on Jul 9, 2026 | No releases on Jul 16, 2026 | No releases on Jul 23, 2026 | No releases on Jul 30, 2026 | No releases on Aug 6, 2026 | No releases on Aug 13, 2026 | |
| Friday | No releases on May 8, 2026 | No releases on May 15, 2026 | No releases on May 22, 2026 | No releases on May 29, 2026 | No releases on Jun 5, 2026 | No releases on Jun 12, 2026 | No releases on Jun 19, 2026 | No releases on Jun 26, 2026 | No releases on Jul 3, 2026 | No releases on Jul 10, 2026 | No releases on Jul 17, 2026 | No releases on Jul 24, 2026 | No releases on Jul 31, 2026 | No releases on Aug 7, 2026 | No releases on Aug 14, 2026 | |
| Saturday | No releases on May 9, 2026 | No releases on May 16, 2026 | No releases on May 23, 2026 | No releases on May 30, 2026 | No releases on Jun 6, 2026 | No releases on Jun 13, 2026 | No releases on Jun 20, 2026 | No releases on Jun 27, 2026 | No releases on Jul 4, 2026 | No releases on Jul 11, 2026 | No releases on Jul 18, 2026 | No releases on Jul 25, 2026 | No releases on Aug 1, 2026 | No releases on Aug 8, 2026 | No releases on Aug 15, 2026 |
10 releases since Sep 12, 2025, busiest day 3
From Transformers.js
From Transformers.js
tools to TextGenerationPipeline in #1655inputMetadata API for simplified internals in #1657Full Changelog: 4.1.0...4.2.0
From Transformers.js
past_key_values via pipeline function) in #1638q1, q1f16, q2, and q2f16 data types in #1647Full Changelog: 4.0.0...4.1.0
From Transformers.js
We're excited to announce that Transformers.js v4 is now available on NPM! After a year of development (we started in March 2025 🤯), we're finally ready for you to use it.
npm i @huggingface/transformers
Links: YouTube Video, Blog Post, Demo Collection
The biggest change is undoubtedly the adoption of a new WebGPU Runtime, completely rewritten in C++. We've worked closely with the ONNX Runtime team to thoroughly test this runtime across our ~200 supported model architectures, as well as many new v4-exclusive architectures.
In addition to better operator support (for performance, accuracy, and coverage), this new WebGPU runtime allows the same transformers.js code to be used across a wide variety of JavaScript environments, including browsers, server-side runtimes, and desktop applications. That's right, you can now run WebGPU-accelerated models directly in Node, Bun, and Deno!
We've proven that it's possible to run state-of-the-art AI models 100% locally in the browser, and now we're focused on performance: making these models run as fast as possible, even in resource-constrained environments. This required completely rethinking our export strategy, especially for large language models. We achieve this by re-implementing new models operation by operation, leveraging specialized ONNX Runtime Contrib Operators like com.microsoft.GroupQueryAttention, com.microsoft.MatMulNBits, or com.microsoft.QMoE to maximize performance.
For example, adopting the com.microsoft.MultiHeadAttention operator, we were able to achieve a ~4x speedup for BERT-based embedding models.
Thanks to our new export strategy and ONNX Runtime's expanding support for custom operators, we've been able to add many new models and architectures to Transformers.js v4. These include popular models like GPT-OSS, Chatterbox, GraniteMoeHybrid, LFM2-MoE, HunYuanDenseV1, Apertus, Olmo3, FalconH1, and Youtu-LLM. Many of these required us to implement support for advanced architectural patterns, including Mamba (state-space models), Multi-head Latent Attention (MLA), and Mixture of Experts (MoE). Perhaps most importantly, these models are all compatible with WebGPU, allowing users to run them directly in the browser or server-side JavaScript environments with hardware acceleration. We've released several Transformers.js v4 demos so far... and we'll continue to release more!
Additionally, we've added support for larger models exceeding 8B parameters. In our tests, we've been able to run GPT-OSS 20B (q4f16) at ~60 tokens per second on an M4 Pro Max.
The new ModelRegistry API is designed for production workflows. It provides explicit visibility into pipeline assets before loading anything: list required files with get_pipeline_files, inspect per-file metadata with get_file_metadata (quite useful to calculate total download size), check cache status with is_pipeline_cached, and clear cached artifacts with clear_pipeline_cache. You can also query available precision types for a model with get_available_dtypes. Based on this new API, progress_callback now includes a progress_total event, making it easy to render end-to-end loading progress without manually aggregating per-file updates.
import { ModelRegistry, pipeline } from "@huggingface/transformers";
const modelId = "onnx-community/all-MiniLM-L6-v2-ONNX";
const modelOptions = { dtype: "fp32" };
const files = await ModelRegistry.get_pipeline_files(
"feature-extraction",
modelId,
modelOptions
);
// ['config.json', 'onnx/model.onnx', ..., 'tokenizer_config.json']
const metadata = await Promise.all(
files.map(file => ModelRegistry.get_file_metadata(modelId, file))
);
const downloadSize = metadata.reduce((total, item) => total + item.size, 0);
const cached = await ModelRegistry.is_pipeline_cached(
"feature-extraction",
modelId,
modelOptions
);
const dtypes = await ModelRegistry.get_available_dtypes(modelId);
// ['fp32', 'fp16', 'q4', 'q4f16']
if (cached) {
await ModelRegistry.clear_pipeline_cache(
"feature-extraction",
modelId,
modelOptions
);
}
const pipe = await pipeline(
"feature-extraction",
modelId,
{
progress_callback: e => {
if (e.status === "progress_total") {
console.log(`${Math.round(e.progress)}%`);
}
},
}
);
We also added new environment controls for model loading. env.useWasmCache enables caching of WASM runtime files (when cache storage is available), allowing applications to work fully offline after the initial load.
env.fetch lets you provide a custom fetch implementation for use cases such as authenticated model access, custom headers, and abortable requests.
import { env } from "@huggingface/transformers";
env.useWasmCache = true;
env.fetch = (url, options) =>
fetch(url, {
...options,
headers: {
...options?.headers,
Authorization: `Bearer ${MY_TOKEN}`,
},
});
Finally, logging is easier to manage in real-world deployments. ONNX Runtime WebGPU warnings are now hidden by default, and you can set explicit verbosity levels for both Transformers.js and ONNX Runtime. This update, also driven by community feedback, keeps console output focused on actionable signals rather than low-value noise.
import { env, LogLevel } from "@huggingface/transformers";
// LogLevel.DEBUG
// LogLevel.INFO
// LogLevel.WARNING
// LogLevel.ERROR
// LogLevel.NONE
env.logLevel = LogLevel.WARNING;
is_cached / is_pipeline_cached, closes #1554 by @nico-martin in https://github.com/huggingface/transformers.js/pull/1559progress_total events from PreTrainedModel.from_pretrained() by @xenova in https://github.com/huggingface/transformers.js/pull/1615Developing a new major version gave us the opportunity to invest in the codebase and tackle long-overdue refactoring efforts.
Until now, the GitHub repository served as our npm package. This worked well as long as the repository only exposed a single library. However, looking to the future, we saw the need for various sub-packages that depend heavily on the Transformers.js core while addressing different use cases, like library-specific implementations, or smaller utilities that most users don't need but are essential for some.
That's why we converted the repository to a monorepo using pnpm workspaces. This allows us to ship smaller packages that depend on @huggingface/transformers without the overhead of maintaining separate repositories.
Another major refactoring effort targeted the ever-growing models.js file. In v3, all available models were defined in a single file spanning over 8,000 lines, becoming increasingly difficult to maintain. For v4, we split this into smaller, focused modules with a clear distinction between utility functions, core logic, and model-specific implementations. This new structure improves readability and makes it much easier to add new models. Developers can now focus on model-specific logic without navigating through thousands of lines of unrelated code.
In v3, many Transformers.js example projects lived directly in the main repository. For v4, we've moved them to a dedicated repository, allowing us to maintain a cleaner codebase focused on the core library. This also makes it easier for users to find and contribute to examples without sifting through the main repository.
We updated the Prettier configuration and reformatted all files in the repository. This ensures consistent formatting throughout the codebase, with all future PRs automatically following the same style. No more debates about formatting... Prettier handles it all, keeping the code clean and readable for everyone.
A frequent request from users was to extract the tokenization logic into a separate library, and with v4, that's exactly what we've done. @huggingface/tokenizers is a complete refactor of the tokenization logic, designed to work seamlessly across browsers and server-side runtimes. At just 8.8kB (gzipped) with zero dependencies, it's incredibly lightweight while remaining fully type-safe.
import { Tokenizer } from "@huggingface/tokenizers";
// Load from Hugging Face Hub
const modelId = "HuggingFaceTB/SmolLM3-3B";
const tokenizerJson = await fetch(
`https://huggingface.co/${modelId}/resolve/main/tokenizer.json`
).then(res => res.json());
const tokenizerConfig = await fetch(
`https://huggingface.co/${modelId}/resolve/main/tokenizer_config.json`
).then(res => res.json());
// Create tokenizer
const tokenizer = new Tokenizer(tokenizerJson, tokenizerConfig);
// Tokenize text
const tokens = tokenizer.tokenize("Hello World");
// ['Hello', 'ĠWorld']
const encoded = tokenizer.encode("Hello World");
// { ids: [9906, 4435], tokens: ['Hello', 'ĠWorld'], ... }
This separation keeps the core of Transformers.js focused and lean while offering a versatile, standalone tool that any WebML project can use independently.
We've migrated our build system from Webpack to esbuild, and the results have been incredible. Build times dropped from 2 seconds to just 200 milliseconds, a 10x improvement that makes development iteration significantly faster. Speed isn't the only benefit, though: bundle sizes also decreased by an average of 10% across all builds. The most notable improvement is in transformers.web.js, our default export, which is now 53% smaller, meaning faster downloads and quicker startup times for users.
We've made several quality-of-life improvements across the library. The type system has been enhanced with dynamic pipeline types that adapt based on inputs, providing better developer experience and type safety.
stopping_criteria missing from generation pipelines by @xenova in https://github.com/huggingface/transformers.js/pull/1523content-length header in COS Response by @tomayac in https://github.com/huggingface/transformers.js/pull/1572skip_special_tokens: false by @xenova in https://github.com/huggingface/transformers.js/pull/1520Full Changelog: https://github.com/huggingface/transformers.js/compare/3.8.1...4.0.0
From Transformers.js
Full Changelog: https://github.com/huggingface/transformers.js/compare/3.8.0...3.8.1
From Transformers.js
Add support for EdgeTAM in https://github.com/huggingface/transformers.js/pull/1454
Add support for Supertonic TTS in https://github.com/huggingface/transformers.js/pull/1459
Example:
import { pipeline } from '@huggingface/transformers';
const tts = await pipeline('text-to-speech', 'onnx-community/Supertonic-TTS-ONNX');
const input_text = 'This is really cool!';
const audio = await tts(input_text, {
speaker_embeddings: 'https://huggingface.co/onnx-community/Supertonic-TTS-ONNX/resolve/main/voices/F1.bin',
});
await audio.save('output.wav');
Add support for SAM2 and SAM3 (Tracker) in https://github.com/huggingface/transformers.js/pull/1461
Remove Metaspace add_prefix_space logic in https://github.com/huggingface/transformers.js/pull/1451
ImageProcessor preprocess uses image_std for fill value by @NathanKolbas in https://github.com/huggingface/transformers.js/pull/1455
Full Changelog: https://github.com/huggingface/transformers.js/compare/3.7.6...3.8.0
From Transformers.js
temperature=0 and do_sample=true by @nico-martin in https://github.com/huggingface/transformers.js/pull/1431Full Changelog: https://github.com/huggingface/transformers.js/compare/3.7.5...3.7.6
From Transformers.js
Full Changelog: https://github.com/huggingface/transformers.js/compare/3.7.4...3.7.5
From Transformers.js
_get_logits_processor in https://github.com/huggingface/transformers.js/pull/1422Full Changelog: https://github.com/huggingface/transformers.js/compare/3.7.3...3.7.4
From Transformers.js
Full Changelog: https://github.com/huggingface/transformers.js/compare/3.7.2...3.7.3
codex release notes.
Get up and running with large language models locally.
Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
An Open Source Machine Learning Framework for Everyone
An agentic skills framework & software development methodology that works.
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
If you publish Transformers.js, you can claim this product by proving you administer its repository.