{"id":"src_Xpuy_bSviQuAwbH7CzGKR","slug":"transformers-js","name":"Transformers.js","type":"github","url":"https://github.com/huggingface/transformers.js","orgId":"org_GDdYeYynEgCEBNBwy-m6s","org":{"slug":"hugging-face","name":"Hugging Face"},"isPrimary":false,"metadata":"{\"evaluatedMethod\":\"github\",\"evaluatedAt\":\"2026-04-07T17:19:25.246Z\",\"changelogDetectedAt\":\"2026-04-07T17:29:37.248Z\"}","releaseCount":84,"releasesLast30Days":1,"avgReleasesPerWeek":0.1,"latestVersion":"4.0.0","latestDate":"2026-03-30T12:55:30.000Z","changelogUrl":null,"hasChangelogFile":false,"lastFetchedAt":"2026-04-18T14:05:12.868Z","trackingSince":"2023-05-15T15:30:49.000Z","releases":[{"id":"rel_YL2j5hdHQ8bscu9gNf7qW","version":"4.0.0","title":"4.0.0","summary":"# 🚀 Transformers.js v4\r\n\r\nWe're excited to announce that Transformers.js v4 is now available on NPM! After a year of development (we started in March...","content":"# 🚀 Transformers.js v4\r\n\r\nWe'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.\r\n\r\n```sh\r\nnpm i @huggingface/transformers\r\n```\r\n\r\nLinks: [YouTube Video](https://www.youtube.com/watch?v=KnhppkY4gHs), [Blog Post](https://huggingface.co/blog/transformersjs-v4), [Demo Collection](https://huggingface.co/collections/webml-community/transformersjs-v4-demos)\r\n\r\n## New WebGPU backend\r\n\r\nThe 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.\r\n\r\nIn 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!\r\n\r\n<img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformersjs-v4/webgpu.png\" alt=\"WebGPU Overview\" width=\"100%\">\r\n\r\nWe'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](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md) like [com.microsoft.GroupQueryAttention](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.GroupQueryAttention), [com.microsoft.MatMulNBits](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.MatMulNBits), or [com.microsoft.QMoE](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.QMoE) to maximize performance.\r\n\r\nFor example, adopting the [com.microsoft.MultiHeadAttention](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.MultiHeadAttention) operator, we were able to achieve a ~4x speedup for BERT-based embedding models.\r\n\r\n<img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformersjs-v4/speedups.png\" alt=\"Optimized ONNX Exports\" width=\"100%\">\r\n\r\n\r\n* ONNX Runtime improvements by @xenova in https://github.com/huggingface/transformers.js/pull/1306\r\n* Transformers.js V4: Native WebGPU EP, repo restructuring, and more! by @xenova in https://github.com/huggingface/transformers.js/pull/1382\r\n\r\n## New models\r\n\r\nThanks 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](https://huggingface.co/collections/webml-community/transformersjs-v4-demos) so far... and we'll continue to release more!\r\n\r\nAdditionally, 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.\r\n\r\n* Add support for Apertus by @nico-martin in https://github.com/huggingface/transformers.js/pull/1465\r\n* Add support for FalconH1 by @xenova in https://github.com/huggingface/transformers.js/pull/1502\r\n* Add support for Cohere's Tiny Aya models by @xenova in https://github.com/huggingface/transformers.js/pull/1529\r\n* Add support for AFMoE by @xenova in https://github.com/huggingface/transformers.js/pull/1542\r\n* Add support for new Qwen VL models (Qwen2.5-VL, Qwen3-VL, Qwen3.5, and Qwen3.5 MoE) by @xenova in https://github.com/huggingface/transformers.js/pull/1551\r\n* Add support for Qwen2 MoE, Qwen3 MoE, Qwen3 Next, Qwen3-VL MoE, and Olmo Hybrid by @xenova in https://github.com/huggingface/transformers.js/pull/1562\r\n* Add support for EuroBERT by @xenova in https://github.com/huggingface/transformers.js/pull/1583\r\n* Add support for LightOnOCR and GLM-OCR by @xenova in https://github.com/huggingface/transformers.js/pull/1582\r\n* Add support for Nemotron-H by @xenova in https://github.com/huggingface/transformers.js/pull/1585\r\n* Add support for DeepSeek-v3 by @xenova in https://github.com/huggingface/transformers.js/pull/1586\r\n* Add support for mistral4 by @xenova in https://github.com/huggingface/transformers.js/pull/1587\r\n* Add support for GLM-MoE-DSA by @xenova in https://github.com/huggingface/transformers.js/pull/1588\r\n* Add support for Chatterbox @xenova in https://github.com/huggingface/transformers.js/pull/1592\r\n* Add support for Cohere ASR by @xenova in https://github.com/huggingface/transformers.js/pull/1610\r\n* Add support for SolarOpen and CHMv2 models by @xenova in https://github.com/huggingface/transformers.js/pull/1593\r\n* Voxtral Realtime, LFM2-VL, Granite Speech, and modeling type refactoring by @xenova in https://github.com/huggingface/transformers.js/pull/1569\r\n* Add support for Gemma3 VLM architecture by @xenova in https://github.com/huggingface/transformers.js/pull/1601\r\n\r\n\r\n## New features\r\n\r\n### ModelRegistry\r\n\r\nThe 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.\r\n\r\n<details>\r\n<summary>See `ModelRegistry` examples</summary>\r\n\r\n```javascript\r\nimport { ModelRegistry, pipeline } from \"@huggingface/transformers\";\r\n\r\nconst modelId = \"onnx-community/all-MiniLM-L6-v2-ONNX\";\r\nconst modelOptions = { dtype: \"fp32\" };\r\n\r\nconst files = await ModelRegistry.get_pipeline_files(\r\n  \"feature-extraction\",\r\n  modelId,\r\n  modelOptions\r\n);\r\n// ['config.json', 'onnx/model.onnx', ..., 'tokenizer_config.json']\r\n\r\nconst metadata = await Promise.all(\r\n  files.map(file => ModelRegistry.get_file_metadata(modelId, file))\r\n);\r\n\r\nconst downloadSize = metadata.reduce((total, item) => total + item.size, 0);\r\n\r\nconst cached = await ModelRegistry.is_pipeline_cached(\r\n  \"feature-extraction\",\r\n  modelId,\r\n  modelOptions\r\n);\r\n\r\nconst dtypes = await ModelRegistry.get_available_dtypes(modelId);\r\n// ['fp32', 'fp16', 'q4', 'q4f16']\r\n\r\nif (cached) {\r\n  await ModelRegistry.clear_pipeline_cache(\r\n    \"feature-extraction\",\r\n    modelId,\r\n    modelOptions\r\n  );\r\n}\r\n\r\nconst pipe = await pipeline(\r\n  \"feature-extraction\",\r\n  modelId,\r\n  {\r\n    progress_callback: e => {\r\n      if (e.status === \"progress_total\") {\r\n        console.log(`${Math.round(e.progress)}%`);\r\n      }\r\n    },\r\n  }\r\n);\r\n```\r\n\r\n</details>\r\n\r\n### New Environment Settings\r\n\r\nWe 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.\r\n\r\n`env.fetch` lets you provide a custom fetch implementation for use cases such as authenticated model access, custom headers, and abortable requests.\r\n\r\n<details>\r\n<summary>See env examples</summary>\r\n\r\n```javascript\r\nimport { env } from \"@huggingface/transformers\";\r\n\r\nenv.useWasmCache = true;\r\n\r\nenv.fetch = (url, options) =>\r\n  fetch(url, {\r\n    ...options,\r\n    headers: {\r\n      ...options?.headers,\r\n      Authorization: `Bearer ${MY_TOKEN}`,\r\n    },\r\n  });\r\n```\r\n\r\n</details>\r\n\r\n### Improved Logging Controls\r\n\r\nFinally, 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.\r\n\r\n<details>\r\n<summary>See `logLevel` example</summary>\r\n\r\n```javascript\r\nimport { env, LogLevel } from \"@huggingface/transformers\";\r\n\r\n// LogLevel.DEBUG\r\n// LogLevel.INFO\r\n// LogLevel.WARNING\r\n// LogLevel.ERROR\r\n// LogLevel.NONE\r\n\r\nenv.logLevel = LogLevel.WARNING;\r\n```\r\n\r\n</details>\r\n\r\n* [v4] added wasm cache by @nico-martin in https://github.com/huggingface/transformers.js/pull/1471\r\n* V4 cache wasm file blob fix by @nico-martin in https://github.com/huggingface/transformers.js/pull/1489\r\n* [v4] suppress console.error while creating InferenceSession by @nico-martin in https://github.com/huggingface/transformers.js/pull/1468\r\n* feat: add configurable log levels via env.logLevel by @taronsung in https://github.com/huggingface/transformers.js/pull/1507\r\n* [v4] Improve download progress tracking (model cache registry and define which files will be loaded for pipelines) by @nico-martin in https://github.com/huggingface/transformers.js/pull/1511\r\n* Add support for seedable random number generation by @xenova in https://github.com/huggingface/transformers.js/pull/1537\r\n* Add customFetch to env for user override by @sroussey in https://github.com/huggingface/transformers.js/pull/1538 and @xenova in https://github.com/huggingface/transformers.js/pull/1543\r\n* [deno] Support both wgpu and dawn webgpu backends by @xenova in https://github.com/huggingface/transformers.js/pull/1546\r\n* feat: experimental Cross-Origin Storage cache backend by @nico-martin in https://github.com/huggingface/transformers.js/pull/1549\r\n* Support PKV cached generation for Qwen-VL models by @xenova in https://github.com/huggingface/transformers.js/pull/1557\r\n* Use ModelRegistry for pipeline file loading by @xenova in https://github.com/huggingface/transformers.js/pull/1555\r\n* feat: add fast boolean `is_cached` / `is_pipeline_cached`, closes #1554 by @nico-martin in https://github.com/huggingface/transformers.js/pull/1559\r\n* feat: add ModelRegistry.get_available_dtypes() to detect quantization by @sroussey in https://github.com/huggingface/transformers.js/pull/1580\r\n* Add support for qwen3_5_text <-> Qwen3_5ForCausalLM by @xenova in https://github.com/huggingface/transformers.js/pull/1602\r\n* Fix ModelRegistry calls when loading multimodal models with text-generation pipeline by @xenova in https://github.com/huggingface/transformers.js/pull/1614\r\n* Emit `progress_total` events from `PreTrainedModel.from_pretrained()` by @xenova in https://github.com/huggingface/transformers.js/pull/1615\r\n\r\n## Repository Restructuring\r\n\r\nDeveloping a new major version gave us the opportunity to invest in the codebase and tackle long-overdue refactoring efforts.\r\n\r\n### PNPM Workspaces\r\n\r\nUntil 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.\r\n\r\nThat'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.\r\n\r\n### Modular Class Structure\r\n\r\nAnother 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.\r\n\r\n### Examples Repository\r\n\r\nIn v3, many Transformers.js example projects lived directly in the main repository. For v4, we've moved them to a [dedicated repository](https://github.com/huggingface/transformers.js-examples), 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.\r\n\r\n### Prettier\r\n\r\nWe 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.\r\n\r\n### Standalone Tokenizers.js Library\r\n\r\nA 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](https://www.npmjs.com/package/@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.\r\n\r\n<details>\r\n<summary>See example code</summary>\r\n\r\n```javascript\r\nimport { Tokenizer } from \"@huggingface/tokenizers\";\r\n\r\n// Load from Hugging Face Hub\r\nconst modelId = \"HuggingFaceTB/SmolLM3-3B\";\r\nconst tokenizerJson = await fetch(\r\n  `https://huggingface.co/${modelId}/resolve/main/tokenizer.json`\r\n).then(res => res.json());\r\n\r\nconst tokenizerConfig = await fetch(\r\n  `https://huggingface.co/${modelId}/resolve/main/tokenizer_config.json`\r\n).then(res => res.json());\r\n\r\n// Create tokenizer\r\nconst tokenizer = new Tokenizer(tokenizerJson, tokenizerConfig);\r\n\r\n// Tokenize text\r\nconst tokens = tokenizer.tokenize(\"Hello World\");\r\n// ['Hello', 'ĠWorld']\r\n\r\nconst encoded = tokenizer.encode(\"Hello World\");\r\n// { ids: [9906, 4435], tokens: ['Hello', 'ĠWorld'], ... }\r\n```\r\n\r\n</details>\r\n\r\nThis separation keeps the core of Transformers.js focused and lean while offering a versatile, standalone tool that any WebML project can use independently.\r\n\r\n* Move examples by @xenova in https://github.com/huggingface/transformers.js/pull/1362\r\n* [v4] Refactor models.js into separate per-model modeling files by @nico-martin in https://github.com/huggingface/transformers.js/pull/1498\r\n* V4 move to pnpm workspaces by @nico-martin in https://github.com/huggingface/transformers.js/pull/1504\r\n* [v4] Tokenizers.js migration by @xenova in https://github.com/huggingface/transformers.js/pull/1501\r\n\r\n## New build system\r\n\r\nWe'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.\r\n\r\n* [v4] Switch build system to use esbuild by @nico-martin in https://github.com/huggingface/transformers.js/pull/1466\r\n\r\n## Improved types\r\n\r\nWe'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.\r\n\r\n<img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformersjs-v4/types.png\" alt=\"Type Improvements\" width=\"100%\">\r\n\r\n* [v4] Finalize pipeline types by @xenova in https://github.com/huggingface/transformers.js/pull/1505\r\n* Add type definitions for various pipeline outputs in transformers.js by @sroussey in https://github.com/huggingface/transformers.js/pull/1535\r\n* fix: improves typedef of Message by @philnash in https://github.com/huggingface/transformers.js/pull/1525\r\n* added ProgressCallback and ProgressInfo as type exports by @nico-martin in https://github.com/huggingface/transformers.js/pull/1528\r\n\r\n## Bug fixes\r\n* fixed backend loading path by @nico-martin in https://github.com/huggingface/transformers.js/pull/1464\r\n* fixed v4 ts errors by @nico-martin in https://github.com/huggingface/transformers.js/pull/1477\r\n* Hot-fix Float16Array usage in node by @xenova in https://github.com/huggingface/transformers.js/pull/1482\r\n* [v4@next] Fix WebGPU validation failed by @xenova in https://github.com/huggingface/transformers.js/pull/1519\r\n* Fix `stopping_criteria` missing from generation pipelines by @xenova in https://github.com/huggingface/transformers.js/pull/1523\r\n* Overdue Whisper fixes by @xenova in https://github.com/huggingface/transformers.js/pull/1594\r\n* Fix custom cache in Node.js when cache returns non-paths (e.g., Response) by @xenova in https://github.com/huggingface/transformers.js/pull/1617\r\n* Include `content-length` header in COS `Response` by @tomayac in https://github.com/huggingface/transformers.js/pull/1572\r\n* Fix: file size missing for cached files by @nico-martin in https://github.com/huggingface/transformers.js/pull/1575\r\n* [deno via CDN] Fix simultaneous multi-session loading (e.g., VLMs) and d support usage for image loading by @xenova in https://github.com/huggingface/transformers.js/pull/1556\r\n* fix: prevent partial file reads during concurrent downloads by @nico-martin in https://github.com/huggingface/transformers.js/pull/1548\r\n* Fix WASM factory blob URL loading (#1527, #1532) by @nico-martin in https://github.com/huggingface/transformers.js/pull/1558\r\n\r\n## Documentation improvements\r\n* Fix broken source code links in the Tutorials sections. by @SeanGallen in https://github.com/huggingface/transformers.js/pull/1526\r\n* V4 (docs): add Vercel AI SDK integration with browser-ai/transformers.js package by @xenova in https://github.com/huggingface/transformers.js/pull/1566\r\n* docs: add step-by-step guide for contributing a new model by @nico-martin in https://github.com/huggingface/transformers.js/pull/1560\r\n* Add background-removal pipeline to JSDoc by @xenova in https://github.com/huggingface/transformers.js/pull/1595\r\n* fix(docs): Fix typo in WebGPU documentation by @mattsoulanille in https://github.com/huggingface/transformers.js/pull/1607\r\n\r\n## Miscellaneous improvements\r\n\r\n* Improve text streamer when `skip_special_tokens: false` by @xenova in https://github.com/huggingface/transformers.js/pull/1520\r\n* Upgrade GitHub Actions for Node 24 compatibility (follow-up) by @xenova in https://github.com/huggingface/transformers.js/pull/1531\r\n* Align audio_spectrogram_transformer name with python library by @xenova in https://github.com/huggingface/transformers.js/pull/1591\r\n* Memoize network calls in model registry by @nico-martin in https://github.com/huggingface/transformers.js/pull/1552\r\n* added no-store to range request #1561 by @nico-martin in https://github.com/huggingface/transformers.js/pull/1564\r\n\r\n## New Contributors\r\n* @taronsung made their first contribution in https://github.com/huggingface/transformers.js/pull/1507\r\n* @philnash made their first contribution in https://github.com/huggingface/transformers.js/pull/1525\r\n* @tomayac made their first contribution in https://github.com/huggingface/transformers.js/pull/1572\r\n* @mattsoulanille made their first contribution in https://github.com/huggingface/transformers.js/pull/1607\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.8.1...4.0.0","publishedAt":"2026-03-30T12:55:30.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/4.0.0","media":[]},{"id":"rel_TmGbXoAnkMxwUjFGO5hwV","version":"3.8.1","title":"3.8.1","summary":"## What's new?\r\n* Add support for Ministral 3 in https://github.com/huggingface/transformers.js/pull/1474\r\n* Fix Ernie 4.5 naming in https://github.co...","content":"## What's new?\r\n* Add support for Ministral 3 in https://github.com/huggingface/transformers.js/pull/1474\r\n* Fix Ernie 4.5 naming in https://github.com/huggingface/transformers.js/pull/1473\r\n* Update Supertonic TTS paper + authors in https://github.com/huggingface/transformers.js/pull/1463\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.8.0...3.8.1","publishedAt":"2025-12-02T14:37:50.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.8.1","media":[]},{"id":"rel_jPsQiG3wex6I0LtNFr2mE","version":"3.8.0","title":"3.8.0","summary":"# 🚀 Transformers.js v3.8 — SAM2, SAM3, EdgeTAM, Supertonic TTS\r\n\r\n* Add support for EdgeTAM in https://github.com/huggingface/transformers.js/pull/14...","content":"# 🚀 Transformers.js v3.8 — SAM2, SAM3, EdgeTAM, Supertonic TTS\r\n\r\n* Add support for EdgeTAM in https://github.com/huggingface/transformers.js/pull/1454\r\n* Add support for Supertonic TTS in https://github.com/huggingface/transformers.js/pull/1459\r\n\r\n    \r\n    **Example:**\r\n    ```js\r\n    import { pipeline } from '@huggingface/transformers';\r\n    \r\n    const tts = await pipeline('text-to-speech', 'onnx-community/Supertonic-TTS-ONNX');\r\n    \r\n    const input_text = 'This is really cool!';\r\n    const audio = await tts(input_text, {\r\n        speaker_embeddings: 'https://huggingface.co/onnx-community/Supertonic-TTS-ONNX/resolve/main/voices/F1.bin',\r\n    });\r\n    await audio.save('output.wav');\r\n    ```\r\n\r\n\r\n* Add support for SAM2 and SAM3 (Tracker) in https://github.com/huggingface/transformers.js/pull/1461\r\n* Remove Metaspace add_prefix_space logic in https://github.com/huggingface/transformers.js/pull/1451\r\n* ImageProcessor preprocess uses image_std for fill value by @NathanKolbas in https://github.com/huggingface/transformers.js/pull/1455\r\n\r\n## New Contributors\r\n* @NathanKolbas made their first contribution in https://github.com/huggingface/transformers.js/pull/1455\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.6...3.8.0","publishedAt":"2025-11-19T16:50:46.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.8.0","media":[]},{"id":"rel_KYv_vSoQ93Jm9V52bjfVt","version":"3.7.6","title":"3.7.6","summary":"## What's new?\r\n* Fix issue when `temperature=0` and `do_sample=true` by @nico-martin in https://github.com/huggingface/transformers.js/pull/1431\r\n* F...","content":"## What's new?\r\n* Fix issue when `temperature=0` and `do_sample=true` by @nico-martin in https://github.com/huggingface/transformers.js/pull/1431\r\n* Fix type errors by @nico-martin in https://github.com/huggingface/transformers.js/pull/1436\r\n* Add support for NanoChat in https://github.com/huggingface/transformers.js/pull/1441\r\n* Add support for Parakeet CTC in https://github.com/huggingface/transformers.js/pull/1440\r\n\r\n## New Contributors\r\n* @nico-martin made their first contribution in https://github.com/huggingface/transformers.js/pull/1431\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.5...3.7.6","publishedAt":"2025-10-20T19:44:04.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.6","media":[]},{"id":"rel_WyZOB8YO5eDagYMO9Mg9I","version":"3.7.5","title":"3.7.5","summary":"## What's new?\r\n* Add support for GraniteMoeHybrid in https://github.com/huggingface/transformers.js/pull/1426\r\n\r\n\r\n**Full Changelog**: https://github...","content":"## What's new?\r\n* Add support for GraniteMoeHybrid in https://github.com/huggingface/transformers.js/pull/1426\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.4...3.7.5","publishedAt":"2025-10-02T13:58:48.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.5","media":[]},{"id":"rel__889F8RnHTTuo-32mrgoR","version":"3.7.4","title":"3.7.4","summary":"## What's new?\r\n* Correctly assign logits warpers in `_get_logits_processor` in https://github.com/huggingface/transformers.js/pull/1422\r\n\r\n**Full Cha...","content":"## What's new?\r\n* Correctly assign logits warpers in `_get_logits_processor` in https://github.com/huggingface/transformers.js/pull/1422\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.3...3.7.4","publishedAt":"2025-09-29T17:40:31.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.4","media":[]},{"id":"rel_oz_myDQ-egWDMiAvCAn1s","version":"3.7.3","title":"3.7.3","summary":"## What's new?\r\n* Unify inference chains in https://github.com/huggingface/transformers.js/pull/1399\r\n* Fix progress tracking bug by @kukudixiaoming i...","content":"## What's new?\r\n* Unify inference chains in https://github.com/huggingface/transformers.js/pull/1399\r\n* Fix progress tracking bug by @kukudixiaoming in https://github.com/huggingface/transformers.js/pull/1405\r\n* Add support for MobileLLM-R1 (llama4_text) in https://github.com/huggingface/transformers.js/pull/1412\r\n* Add support for VaultGemma in https://github.com/huggingface/transformers.js/pull/1413\r\n\r\n## New Contributors\r\n* @kukudixiaoming made their first contribution in https://github.com/huggingface/transformers.js/pull/1405\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.2...3.7.3","publishedAt":"2025-09-12T20:35:32.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.3","media":[]},{"id":"rel_30Ii2uc5q8brdSu1a47a5","version":"3.7.2","title":"3.7.2","summary":"## What's new?\r\n* Add support for DINOv3 in https://github.com/huggingface/transformers.js/pull/1390\r\n\r\n    See [here](https://huggingface.co/models?l...","content":"## What's new?\r\n* Add support for DINOv3 in https://github.com/huggingface/transformers.js/pull/1390\r\n\r\n    See [here](https://huggingface.co/models?library=transformers.js&other=dinov3&sort=trending) for the full list of supported models.\r\n\r\n    **Example**: Compute image embeddings\r\n    ```js\r\n    import { pipeline } from '@huggingface/transformers';\r\n    \r\n    const image_feature_extractor = await pipeline(\r\n        'image-feature-extraction',\r\n        'onnx-community/dinov3-vits16-pretrain-lvd1689m-ONNX',\r\n    );\r\n    const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';\r\n    const features = await image_feature_extractor(url);\r\n    console.log(features);\r\n    ```\r\n\r\n\r\n    Try it out using our [online demo](https://huggingface.co/spaces/webml-community/dinov3-web):\r\n\r\n    https://github.com/user-attachments/assets/7b46f225-1699-467a-9d62-87c0ef497029\r\n\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.1...3.7.2","publishedAt":"2025-08-15T17:58:06.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.2","media":[]},{"id":"rel_RJ4_5GeIwEY0t5OneafcX","version":"3.7.1","title":"3.7.1","summary":"## What's new?\r\n* Add support for Arcee in https://github.com/huggingface/transformers.js/pull/1377\r\n* Optimize tensor.slice() by @Honry in https://gi...","content":"## What's new?\r\n* Add support for Arcee in https://github.com/huggingface/transformers.js/pull/1377\r\n* Optimize tensor.slice() by @Honry in https://github.com/huggingface/transformers.js/pull/1381\r\n\r\n## New Contributors\r\n* @Honry made their first contribution in https://github.com/huggingface/transformers.js/pull/1381\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.7.0...3.7.1","publishedAt":"2025-08-01T21:14:19.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.1","media":[]},{"id":"rel_94jAS0hww9RFBPKbeE0QB","version":"3.7.0","title":"3.7.0","summary":"# 🚀 Transformers.js v3.7 — Voxtral, LFM2, ModernBERT Decoder\r\n\r\n## 🤖 New models\r\n\r\nThis update adds support for 3 new architectures:\r\n\r\n- [Voxtral](...","content":"# 🚀 Transformers.js v3.7 — Voxtral, LFM2, ModernBERT Decoder\r\n\r\n## 🤖 New models\r\n\r\nThis update adds support for 3 new architectures:\r\n\r\n- [Voxtral](#new-models-voxtral)\r\n- [LFM2](#new-models-lfm2)\r\n- [ModernBERT Decoder](#new-models-modernbert-decoder)\r\n\r\n<h3 id=\"new-models-voxtral\">Voxtral</h2>\r\n\r\nVoxtral Mini is an enhancement of [Ministral 3B](https://mistral.ai/news/ministraux), incorporating state-of-the-art audio input capabilities while retaining best-in-class text performance. It excels at speech transcription, translation and audio understanding. ONNX weights for Voxtral-Mini-3B-2507 can be found [here](https://huggingface.co/onnx-community/Voxtral-Mini-3B-2507-ONNX). Learn more about Voxtral in the release [blog post](https://mistral.ai/news/voxtral).\r\n\r\nTry it out with our [online demo](https://huggingface.co/spaces/webml-community/Voxtral-WebGPU):\r\n\r\nhttps://github.com/user-attachments/assets/e1b95fe1-461d-4cb9-8fe8-5ec17e6c93f0\r\n\r\n\r\n**Example**: Audio transcription\r\n```js\r\nimport { VoxtralForConditionalGeneration, VoxtralProcessor, TextStreamer, read_audio } from \"@huggingface/transformers\";\r\n\r\n// Load the processor and model\r\nconst model_id = \"onnx-community/Voxtral-Mini-3B-2507-ONNX\";\r\nconst processor = await VoxtralProcessor.from_pretrained(model_id);\r\nconst model = await VoxtralForConditionalGeneration.from_pretrained(\r\n    model_id,\r\n    {\r\n        dtype: {\r\n            embed_tokens: \"fp16\", // \"fp32\", \"fp16\", \"q8\", \"q4\"\r\n            audio_encoder: \"q4\", // \"fp32\", \"fp16\", \"q8\", \"q4\", \"q4f16\"\r\n            decoder_model_merged: \"q4\", // \"q4\", \"q4f16\"\r\n        },\r\n        device: \"webgpu\",\r\n    },\r\n);\r\n\r\n// Prepare the conversation\r\nconst conversation = [\r\n    {\r\n        \"role\": \"user\",\r\n        \"content\": [\r\n            { \"type\": \"audio\" },\r\n            { \"type\": \"text\", \"text\": \"lang:en [TRANSCRIBE]\" },\r\n        ],\r\n    }\r\n];\r\nconst text = processor.apply_chat_template(conversation, { tokenize: false });\r\nconst audio = await read_audio(\"http://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/mlk.wav\", 16000);\r\nconst inputs = await processor(text, audio);\r\n\r\n// Generate the response\r\nconst generated_ids = await model.generate({\r\n    ...inputs,\r\n    max_new_tokens: 256,\r\n    streamer: new TextStreamer(processor.tokenizer, { skip_special_tokens: true, skip_prompt: true }),\r\n});\r\n\r\n// Decode the generated tokens\r\nconst new_tokens = generated_ids.slice(null, [inputs.input_ids.dims.at(-1), null]);\r\nconst generated_texts = processor.batch_decode(\r\n    new_tokens,\r\n    { skip_special_tokens: true },\r\n);\r\nconsole.log(generated_texts[0]);\r\n// I have a dream that one day this nation will rise up and live out the true meaning of its creed.\r\n```\r\n\r\nAdded in https://github.com/huggingface/transformers.js/pull/1373 and https://github.com/huggingface/transformers.js/pull/1375.\r\n\r\n<h3 id=\"new-models-lfm2\">LFM2</h2>\r\n\r\nLFM2 is a new generation of hybrid models developed by [Liquid AI](https://www.liquid.ai/), specifically designed for edge AI and on-device deployment. It sets a new standard in terms of quality, speed, and memory efficiency.\r\n\r\nThe models, which we have converted to ONNX, come in three different sizes: [350M](https://huggingface.co/onnx-community/LFM2-350M-ONNX), [700M](https://huggingface.co/onnx-community/LFM2-700M-ONNX), and [1.2B](https://huggingface.co/onnx-community/LFM2-1.2B-ONNX) parameters.\r\n\r\n**Example**: Text-generation with LFM2-350M:\r\n\r\n```js\r\nimport { pipeline, TextStreamer } from \"@huggingface/transformers\";\r\n\r\n// Create a text generation pipeline\r\nconst generator = await pipeline(\r\n  \"text-generation\",\r\n  \"onnx-community/LFM2-350M-ONNX\",\r\n  { dtype: \"q4\" },\r\n);\r\n\r\n// Define the list of messages\r\nconst messages = [\r\n  { role: \"system\", content: \"You are a helpful assistant.\" },\r\n  { role: \"user\", content: \"What is the capital of France?\" },\r\n];\r\n\r\n// Generate a response\r\nconst output = await generator(messages, {\r\n    max_new_tokens: 512,\r\n    do_sample: false,\r\n    streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),\r\n});\r\nconsole.log(output[0].generated_text.at(-1).content);\r\n// The capital of France is Paris. It is a vibrant city known for its historical landmarks, art, fashion, and gastronomy.\r\n```\r\n\r\nAdded in https://github.com/huggingface/transformers.js/pull/1367 and https://github.com/huggingface/transformers.js/pull/1369.\r\n\r\n\r\n<h3 id=\"new-models-modernbert-decoder\">ModernBERT Decoder</h2>\r\n\r\nThese models form part of the Ettin suite: the first collection of paired encoder-only and decoder-only models trained with identical data, architecture, and training recipes. Ettin enables fair comparisons between encoder and decoder architectures across multiple scales, providing state-of-the-art performance for open-data models in their respective size categories.\r\n\r\nThe list of supported models can be found [here](https://huggingface.co/models?library=transformers.js&other=modernbert-decoder&sort=trending).\r\n\r\n```js\r\nimport { pipeline, TextStreamer } from \"@huggingface/transformers\";\r\n\r\n// Create a text generation pipeline\r\nconst generator = await pipeline(\r\n  \"text-generation\",\r\n  \"onnx-community/ettin-decoder-150m-ONNX\",\r\n  { dtype: \"fp32\" },\r\n);\r\n\r\n// Generate a response\r\nconst text = \"Q: What is the capital of France?\\nA:\";\r\nconst output = await generator(text, {\r\n  max_new_tokens: 128,\r\n  streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),\r\n});\r\nconsole.log(output[0].generated_text);\r\n```\r\n\r\nAdded in https://github.com/huggingface/transformers.js/pull/1371.\r\n\r\n\r\n##  🛠️ Other improvements\r\n\r\n* Add special tokens in text-generation pipeline if tokenizer requires in https://github.com/huggingface/transformers.js/pull/1370\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.6.3...3.7.0","publishedAt":"2025-07-23T03:12:34.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.7.0","media":[]},{"id":"rel_srT-1BIgfPJVzBjPhPbBg","version":"3.6.3","title":"3.6.3","summary":"## What's new?\r\n* Bump `@huggingface/jinja` to version 0.5.1 for new chat template functionality in https://github.com/huggingface/transformers.js/pul...","content":"## What's new?\r\n* Bump `@huggingface/jinja` to version 0.5.1 for new chat template functionality in https://github.com/huggingface/transformers.js/pull/1364\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.6.2...3.6.3","publishedAt":"2025-07-11T20:11:55.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.6.3","media":[]},{"id":"rel_YAMqHvN28JGvF5SAfL4Qh","version":"3.6.2","title":"3.6.2","summary":"## What's new?\r\n* Add support for SmolLM3 in https://github.com/huggingface/transformers.js/pull/1359\r\n\r\n    SmolLM3 is a 3B parameter language model ...","content":"## What's new?\r\n* Add support for SmolLM3 in https://github.com/huggingface/transformers.js/pull/1359\r\n\r\n    SmolLM3 is a 3B parameter language model designed to push the boundaries of small models. It supports 6 languages, advanced reasoning and long context. SmolLM3 is a fully open model that offers strong performance at the 3B–4B scale.\r\n\r\n\r\n    <img src=\"https://cdn-uploads.huggingface.co/production/uploads/61c141342aac764ce1654e43/zy0dqTCCt5IHmuzwoqtJ9.png\" />\r\n     \r\n    **Example:**\r\n    ```js\r\n    import { pipeline, TextStreamer } from \"@huggingface/transformers\";\r\n    \r\n    // Create a text generation pipeline\r\n    const generator = await pipeline(\r\n      \"text-generation\",\r\n      \"HuggingFaceTB/SmolLM3-3B-ONNX\",\r\n      { dtype: \"q4f16\" },\r\n    );\r\n    \r\n    // Define the list of messages\r\n    const messages = [\r\n      { role: \"system\", content: \"You are SmolLM, a language model created by Hugging Face. If asked by the user, here is some information about you: SmolLM has 3 billion parameters and can converse in 6 languages: English, Spanish, German, French, Italian, and Portuguese. SmolLM is a fully open model and was trained on a diverse mix of public datasets./think\" },\r\n      { role: \"user\", content: \"Solve the equation x^2 - 3x + 2 = 0\" },\r\n    ];\r\n    \r\n    // Generate a response\r\n    const output = await generator(messages, {\r\n        max_new_tokens: 1024,\r\n        do_sample: false,\r\n        streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),\r\n    });\r\n    console.log(output[0].generated_text.at(-1).content);\r\n    ```\r\n\r\n* Add support for ERNIE-4.5 in https://github.com/huggingface/transformers.js/pull/1354\r\n    **Example:**\r\n    ```js\r\n    import { pipeline, TextStreamer } from \"@huggingface/transformers\";\r\n    \r\n    // Create a text generation pipeline\r\n    const generator = await pipeline(\r\n      \"text-generation\",\r\n      \"onnx-community/ERNIE-4.5-0.3B-ONNX\",\r\n      { dtype: \"fp32\" }, // Options: \"fp32\", \"fp16\", \"q8\", \"q4\", \"q4f16\"\r\n    );\r\n    \r\n    // Define the list of messages\r\n    const messages = [\r\n      { role: \"system\", content: \"You are a helpful assistant.\" },\r\n      { role: \"user\", content: \"What is the capital of France?\" },\r\n    ];\r\n    \r\n    // Generate a response\r\n    const output = await generator(messages, {\r\n        max_new_tokens: 512,\r\n        do_sample: false,\r\n        streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),\r\n    });\r\n    console.log(output[0].generated_text.at(-1).content);\r\n    // The capital of France is Paris.\r\n    ```\r\n\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.6.1...3.6.2","publishedAt":"2025-07-08T17:46:17.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.6.2","media":[]},{"id":"rel_LOu9N5Boz49cKmKU7IQLH","version":"3.6.1","title":"3.6.1","summary":"## What's new?\r\n* Add support for NeoBERT in https://github.com/huggingface/transformers.js/pull/1350\r\n    \r\n    ```js\r\n    import { pipeline } from \"...","content":"## What's new?\r\n* Add support for NeoBERT in https://github.com/huggingface/transformers.js/pull/1350\r\n    \r\n    ```js\r\n    import { pipeline } from \"@huggingface/transformers\";\r\n    \r\n    // Create feature extraction pipeline\r\n    const extractor = await pipeline(\"feature-extraction\", \"onnx-community/NeoBERT-ONNX\");\r\n    \r\n    // Compute embeddings\r\n    const text = \"NeoBERT is the most efficient model of its kind!\";\r\n    const embedding = await extractor(text, { pooling: \"cls\" });\r\n    console.log(embedding.dims); // [1, 768]\r\n    ```\r\n\r\n* Improve webworker detection to support ServiceWorker and SharedWorker by @aungKhantPaing in https://github.com/huggingface/transformers.js/pull/1346\r\n* Pin numpy version for scripts by @fidoriel in https://github.com/huggingface/transformers.js/pull/1351\r\n* Fix optional `from_pretrained` types in https://github.com/huggingface/transformers.js/pull/1352\r\n\r\n## New Contributors\r\n* @aungKhantPaing made their first contribution in https://github.com/huggingface/transformers.js/pull/1346\r\n* @fidoriel made their first contribution in https://github.com/huggingface/transformers.js/pull/1351\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.6.0...3.6.1","publishedAt":"2025-07-02T05:20:41.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.6.1","media":[]},{"id":"rel_u52_l6aPDGg5jtwj1Qwy3","version":"3.6.0","title":"3.6.0","summary":"# 🚀 Transformers.js v3.6 — Gemma 3n, Qwen3-Embedding, Llava-Qwen2\r\n\r\n- [🤖 New models](#new-models)\r\n    - [Gemma 3n](#new-models-gemma3n)\r\n    - [Qw...","content":"# 🚀 Transformers.js v3.6 — Gemma 3n, Qwen3-Embedding, Llava-Qwen2\r\n\r\n- [🤖 New models](#new-models)\r\n    - [Gemma 3n](#new-models-gemma3n)\r\n    - [Qwen3-Embedding](#new-models-qwen3-embedding)\r\n    - [Llava-Qwen2](#new-models-llava-qwen2)\r\n\r\n- [🛠️ Other improvements](#other-improvements)\r\n\r\n<h2 id=\"new-models\">🤖 New models</h2>\r\n\r\n<h3 id=\"new-models-gemma3n\">Gemma 3n</h2>\r\n\r\nGemma 3n, which was announced as a _preview_ during Google I/O, is a model that is designed from the ground up to **run locally** on your hardware. On top of that, it's natively **multimodal**, supporting image, text, audio, and video inputs 🤯\r\n\r\nGemma 3n models have multiple architecture innovations:\r\n* They are available in two sizes based on [effective parameters](https://ai.google.dev/gemma/docs/gemma-3n#parameters). While the raw parameter count of this model is 6B, the architecture design allows the model to be run with a memory footprint comparable to a traditional 2B model by offloading low-utilization matrices from the accelerator.\r\n* They use a MatFormer architecture that allows nesting sub-models within the [E4B model](https://huggingface.co/google/gemma-3n-E4B-it). We provide one sub-model (this model repository), or you can access a spectrum of custom-sized models using the [Mix-and-Match method](https://goo.gle/gemma3n-matformer-lab).\r\n\r\nLearn more about these techniques in the [technical blog post](https://developers.googleblog.com/en/introducing-gemma-3n-developer-guide) and the [Gemma documentation](https://ai.google.dev/gemma/docs/gemma-3n). \r\n\r\n\r\nAs part of the release, we are releasing ONNX weights for the `gemma-3n-E2B-it` variant ([link](https://huggingface.co/onnx-community/gemma-3n-E2B-it-ONNX)), making it compatible with Transformers.js:\r\n\r\n> [!WARNING]  \r\n> Due to the model's large size, we currently only support Node.js, Deno, and Bun execution.\r\n> In-browser WebGPU support is actively being worked on, so stay tuned for an update!\r\n\r\n**Example:** Caption an image\r\n\r\n```js\r\nimport {\r\n  AutoProcessor,\r\n  AutoModelForImageTextToText,\r\n  load_image,\r\n  TextStreamer,\r\n} from \"@huggingface/transformers\";\r\n\r\n// Load processor and model\r\nconst model_id = \"onnx-community/gemma-3n-E2B-it-ONNX\";\r\nconst processor = await AutoProcessor.from_pretrained(model_id);\r\nconst model = await AutoModelForImageTextToText.from_pretrained(model_id, {\r\n  dtype: {\r\n    embed_tokens: \"q8\",\r\n    audio_encoder: \"q8\",\r\n    vision_encoder: \"fp16\",\r\n    decoder_model_merged: \"q4\",\r\n  },\r\n  device: \"cpu\", // NOTE: WebGPU support coming soon!\r\n});\r\n\r\n// Prepare prompt\r\nconst messages = [\r\n  {\r\n    role: \"user\",\r\n    content: [\r\n      { type: \"image\" },\r\n      { type: \"text\", text: \"Describe this image in detail.\" },\r\n    ],\r\n  },\r\n];\r\nconst prompt = processor.apply_chat_template(messages, {\r\n  add_generation_prompt: true,\r\n});\r\n\r\n// Prepare inputs\r\nconst url = \"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg\";\r\nconst image = await load_image(url);\r\nconst audio = null;\r\nconst inputs = await processor(prompt, image, audio, {\r\n  add_special_tokens: false,\r\n});\r\n\r\n// Generate output\r\nconst outputs = await model.generate({\r\n  ...inputs,\r\n  max_new_tokens: 512,\r\n  do_sample: false,\r\n  streamer: new TextStreamer(processor.tokenizer, {\r\n    skip_prompt: true,\r\n    skip_special_tokens: false,\r\n    // callback_function: (text) => { /* Do something with the streamed output */ },\r\n  }),\r\n});\r\n\r\n// Decode output\r\nconst decoded = processor.batch_decode(\r\n  outputs.slice(null, [inputs.input_ids.dims.at(-1), null]),\r\n  { skip_special_tokens: true },\r\n);\r\nconsole.log(decoded[0]);\r\n```\r\n\r\n<details>\r\n\r\n<summary>See example output</summary>\r\n\r\n```\r\nThe image is a close-up, slightly macro shot of a cluster of vibrant pink cosmos flowers in full bloom. The flowers are the focal point, with their delicate, slightly ruffled petals radiating outwards. They have a soft, almost pastel pink hue, and their edges are subtly veined. \r\n\r\nA small, dark-colored bee is actively visiting one of the pink flowers, its body positioned near the center of the bloom. The bee appears to be collecting pollen or nectar. \r\n\r\nThe flowers are attached to slender, brownish-green stems, and some of the surrounding foliage is visible in a blurred background, suggesting a natural outdoor setting. There are also hints of other flowers in the background, including some red ones, adding a touch of contrast to the pink. \r\n\r\nThe lighting in the image seems to be natural daylight, casting soft shadows and highlighting the textures of the petals and the bee. The overall impression is one of delicate beauty and the gentle activity of nature.\r\n```\r\n\r\n</details>\r\n\r\n**Example:** Transcribe audio\r\n\r\n```js\r\nimport {\r\n  AutoProcessor,\r\n  AutoModelForImageTextToText,\r\n  TextStreamer,\r\n} from \"@huggingface/transformers\";\r\nimport wavefile from \"wavefile\";\r\n\r\n// Load processor and model\r\nconst model_id = \"onnx-community/gemma-3n-E2B-it-ONNX\";\r\nconst processor = await AutoProcessor.from_pretrained(model_id);\r\nconst model = await AutoModelForImageTextToText.from_pretrained(model_id, {\r\n  dtype: {\r\n    embed_tokens: \"q8\",\r\n    audio_encoder: \"q4\",\r\n    vision_encoder: \"fp16\",\r\n    decoder_model_merged: \"q4\",\r\n  },\r\n  device: \"cpu\", // NOTE: WebGPU support coming soon!\r\n});\r\n\r\n// Prepare prompt\r\nconst messages = [\r\n  {\r\n    role: \"user\",\r\n    content: [\r\n      { type: \"audio\" },\r\n      { type: \"text\", text: \"Transcribe this audio verbatim.\" },\r\n    ],\r\n  },\r\n];\r\nconst prompt = processor.apply_chat_template(messages, {\r\n  add_generation_prompt: true,\r\n});\r\n\r\n// Prepare inputs\r\nconst url = \"https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav\";\r\nconst buffer = Buffer.from(await fetch(url).then((x) => x.arrayBuffer()));\r\nconst wav = new wavefile.WaveFile(buffer);\r\nwav.toBitDepth(\"32f\"); // Pipeline expects input as a Float32Array\r\nwav.toSampleRate(processor.feature_extractor.config.sampling_rate);\r\nlet audioData = wav.getSamples();\r\nif (Array.isArray(audioData)) {\r\n  if (audioData.length > 1) {\r\n    for (let i = 0; i < audioData[0].length; ++i) {\r\n      audioData[0][i] = (Math.sqrt(2) * (audioData[0][i] + audioData[1][i])) / 2;\r\n    }\r\n  }\r\n  audioData = audioData[0];\r\n}\r\n\r\nconst image = null;\r\nconst audio = audioData;\r\nconst inputs = await processor(prompt, image, audio, {\r\n  add_special_tokens: false,\r\n});\r\n\r\n// Generate output\r\nconst outputs = await model.generate({\r\n  ...inputs,\r\n  max_new_tokens: 512,\r\n  do_sample: false,\r\n  streamer: new TextStreamer(processor.tokenizer, {\r\n    skip_prompt: true,\r\n    skip_special_tokens: false,\r\n    // callback_function: (text) => { /* Do something with the streamed output */ },\r\n  }),\r\n});\r\n\r\n// Decode output\r\nconst decoded = processor.batch_decode(\r\n  outputs.slice(null, [inputs.input_ids.dims.at(-1), null]),\r\n  { skip_special_tokens: true },\r\n);\r\nconsole.log(decoded[0]);\r\n```\r\n\r\n<details>\r\n\r\n<summary>See example output</summary>\r\n\r\n```\r\nAnd so, my fellow Americans, ask not what your country can do for you. Ask what you can do for your country.\r\n```\r\n\r\n</details>\r\n\r\n\r\n\r\n<h3 id=\"new-models-qwen3-embed\">Qwen3-Embedding</h2>\r\n\r\nThe Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks. Building upon the dense foundational models of the Qwen3 series, it provides a comprehensive range of text embeddings and reranking models in various sizes (0.6B, 4B, and 8B). This series inherits the exceptional multilingual capabilities, long-text understanding, and reasoning skills of its foundational model.\r\n\r\nYou can run it with Transformers.js as follows:\r\n\r\n```js\r\nimport { pipeline, matmul } from \"@huggingface/transformers\";\r\n\r\n// Create a feature extraction pipeline\r\nconst extractor = await pipeline(\r\n  \"feature-extraction\",\r\n  \"onnx-community/Qwen3-Embedding-0.6B-ONNX\",\r\n  {\r\n    dtype: \"fp32\", // Options: \"fp32\", \"fp16\", \"q8\"\r\n    // device: \"webgpu\",\r\n  },\r\n);\r\n\r\nfunction get_detailed_instruct(task_description, query) {\r\n  return `Instruct: ${task_description}\\nQuery:${query}`;\r\n}\r\n\r\n// Each query must come with a one-sentence instruction that describes the task\r\nconst task = \"Given a web search query, retrieve relevant passages that answer the query\";\r\nconst queries = [\r\n  get_detailed_instruct(task, \"What is the capital of China?\"),\r\n  get_detailed_instruct(task, \"Explain gravity\"),\r\n];\r\n\r\n// No need to add instruction for retrieval documents\r\nconst documents = [\r\n  \"The capital of China is Beijing.\",\r\n  \"Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.\",\r\n];\r\nconst input_texts = [...queries, ...documents];\r\n\r\n// Extract embeddings for queries and documents\r\nconst output = await extractor(input_texts, {\r\n  pooling: \"last_token\",\r\n  normalize: true,\r\n});\r\nconst scores = await matmul(\r\n  output.slice([0, queries.length]), // Query embeddings\r\n  output.slice([queries.length, null]).transpose(1, 0), // Document embeddings\r\n);\r\nconsole.log(scores.tolist());\r\n// [\r\n//   [ 0.7645590305328369, 0.14142560958862305 ],\r\n//   [ 0.13549776375293732, 0.599955141544342 ]\r\n// ]\r\n```\r\n\r\n\r\n<h3 id=\"new-models-llava-qwen2\">Llava-Qwen2</h2>\r\n\r\nFinally, we also added support for Llava models with a Qwen2 text backbone:\r\n\r\n```js\r\nimport {\r\n  AutoProcessor,\r\n  AutoModelForImageTextToText,\r\n  load_image,\r\n  TextStreamer,\r\n} from \"@huggingface/transformers\";\r\n\r\n// Load processor and model\r\nconst model_id = \"onnx-community/FastVLM-0.5B-ONNX\";\r\nconst processor = await AutoProcessor.from_pretrained(model_id);\r\nconst model = await AutoModelForImageTextToText.from_pretrained(model_id, {\r\n  dtype: {\r\n    embed_tokens: \"fp16\",\r\n    vision_encoder: \"q4\",\r\n    decoder_model_merged: \"q4\",\r\n  },\r\n});\r\n\r\n// Prepare prompt\r\nconst messages = [\r\n  {\r\n    role: \"user\",\r\n    content: \"<image>Describe this image in detail.\",\r\n  },\r\n];\r\nconst prompt = processor.apply_chat_template(messages, {\r\n  add_generation_prompt: true,\r\n});\r\n\r\n// Prepare inputs\r\nconst url = \"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg\";\r\nconst image = await load_image(url);\r\nconst inputs = await processor(image, prompt, {\r\n  add_special_tokens: false,\r\n});\r\n\r\n// Generate output\r\nconst outputs = await model.generate({\r\n  ...inputs,\r\n  max_new_tokens: 512,\r\n  do_sample: false,\r\n  streamer: new TextStreamer(processor.tokenizer, {\r\n    skip_prompt: true,\r\n    skip_special_tokens: false,\r\n    // callback_function: (text) => { /* Do something with the streamed output */ },\r\n  }),\r\n});\r\n\r\n// Decode output\r\nconst decoded = processor.batch_decode(\r\n  outputs.slice(null, [inputs.input_ids.dims.at(-1), null]),\r\n  { skip_special_tokens: true },\r\n);\r\nconsole.log(decoded[0]);\r\n```\r\n\r\n<details>\r\n\r\n<summary>See here for example output</summary>\r\n\r\n```\r\nThe image depicts a vibrant and colorful scene featuring a variety of flowers and plants. The main focus is on a striking pink flower with a dark center, which appears to be a type of petunia. The petals are a rich, deep pink, and the flower has a classic, slightly ruffled appearance. The dark center of the flower is a contrasting color, likely a deep purple or black, which adds to the flower's visual appeal.\r\n\r\nIn the background, there are several other flowers and plants, each with their unique colors and shapes. To the left, there is a red flower with a bright, vivid hue, which stands out against the pink flower. The red flower has a more rounded shape and a lighter center, with petals that are a lighter shade of red compared to the pink flower.\r\n\r\nTo the right of the pink flower, there is a plant with red flowers, which are smaller and more densely packed. The red flowers are a deep, rich red color, and they have a more compact shape compared to the pink flower.\r\n\r\nIn the foreground, there is a green plant with a few leaves and a few small flowers. The leaves are a bright green color, and the flowers are a lighter shade of green, with a few petals that are slightly open.\r\n\r\nOverall, the image is a beautiful representation of a garden or natural setting, with a variety of flowers and plants that are in full bloom. The colors are vibrant and the composition is well-balanced, with the pink flower in the center drawing the viewer's attention.\r\n```\r\n\r\n</details>\r\n\r\n<h2 id=\"other-improvements\">🛠️ Other improvements</h2>\r\n\r\n* Improve detection & usage of deno/bun in https://github.com/huggingface/transformers.js/pull/1333\r\n* Add eos/last_token pooling in https://github.com/huggingface/transformers.js/pull/1335\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.5.2...3.6.0","publishedAt":"2025-06-26T15:48:28.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.6.0","media":[]},{"id":"rel_7vCMJ-E_eUgS0gU3qhitm","version":"3.5.2","title":"3.5.2","summary":"## What's new?\r\n* Update paper links to HF papers by @qgallouedec in https://github.com/huggingface/transformers.js/pull/1318\r\n* Allow older (legacy) ...","content":"## What's new?\r\n* Update paper links to HF papers by @qgallouedec in https://github.com/huggingface/transformers.js/pull/1318\r\n* Allow older (legacy) BPE models to be detected even when the type is not specified in https://github.com/huggingface/transformers.js/pull/1314\r\n* Fix WhisperTextStreamer when `return_timestamps` is true (correctly ignore printing of timestamp tokens) in https://github.com/huggingface/transformers.js/pull/1327\r\n* Improve typescript exports and expose common types in https://github.com/huggingface/transformers.js/pull/1325\r\n\r\n## New Contributors\r\n* @qgallouedec made their first contribution in https://github.com/huggingface/transformers.js/pull/1318\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.5.1...3.5.2","publishedAt":"2025-05-30T19:32:31.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.5.2","media":[]},{"id":"rel_GOBf_uDoHA_aFi6o34V4a","version":"3.5.1","title":"3.5.1","summary":"## What's new?\r\n\r\n* Add support for Qwen3 in https://github.com/huggingface/transformers.js/pull/1300.\r\n\r\n    Example usage:\r\n    ```js\r\n    import { ...","content":"## What's new?\r\n\r\n* Add support for Qwen3 in https://github.com/huggingface/transformers.js/pull/1300.\r\n\r\n    Example usage:\r\n    ```js\r\n    import { pipeline, TextStreamer } from \"@huggingface/transformers\";\r\n    \r\n    // Create a text generation pipeline\r\n    const generator = await pipeline(\r\n      \"text-generation\",\r\n      \"onnx-community/Qwen3-0.6B-ONNX\",\r\n      { dtype: \"q4f16\", device: \"webgpu\" },\r\n    );\r\n    \r\n    // Define the list of messages\r\n    const messages = [\r\n      { role: \"user\", content: \"If 5 brog 5 is 1, and 4 brog 2 is 2, what is 3 brog 1?\" },\r\n    ];\r\n    \r\n    // Generate a response\r\n    const output = await generator(messages, {\r\n        max_new_tokens: 1024,\r\n        do_sample: true,\r\n        top_k: 20,\r\n        temperature: 0.7,\r\n        streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true}),\r\n    });\r\n    console.log(output[0].generated_text.at(-1).content);\r\n    ```\r\n\r\n\r\n    Try out the [online demo](https://huggingface.co/spaces/webml-community/qwen3-webgpu):\r\n\r\n\r\n    https://github.com/user-attachments/assets/d5262390-b70b-4310-b4f3-98be0af79cca\r\n\r\n* Add support for D-FINE in https://github.com/huggingface/transformers.js/pull/1303\r\n    \r\n    Example usage:\r\n\r\n    ```js\r\n    import { pipeline } from \"@huggingface/transformers\";\r\n    \r\n    const detector = await pipeline(\"object-detection\", \"onnx-community/dfine_s_coco-ONNX\");\r\n    \r\n    const image = \"https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg\";\r\n    const output = await detector(image, { threshold: 0.5 });\r\n    console.log(output);\r\n    ```\r\n    \r\n    See list of supported models: https://huggingface.co/models?library=transformers.js&other=d_fine&sort=trending\r\n\r\n\r\n* Introduce global inference chain (+ other WebGPU fixes) in https://github.com/huggingface/transformers.js/pull/1293\r\n* fix: `RawImage.fromURL` error when input file url by @himself65 in https://github.com/huggingface/transformers.js/pull/1288\r\n* [bugfix] tokenizers respect padding: true with non-null max_length by @dwisdom0 in https://github.com/huggingface/transformers.js/pull/1284\r\n\r\n## New Contributors\r\n* @himself65 made their first contribution in https://github.com/huggingface/transformers.js/pull/1288\r\n* @dwisdom0 made their first contribution in https://github.com/huggingface/transformers.js/pull/1284\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.5.0...3.5.1","publishedAt":"2025-05-03T04:00:02.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.5.1","media":[]},{"id":"rel_SO75BfcfjNX07VE7SIIxS","version":"3.5.0","title":"3.5.0","summary":"# 🔥 Transformers.js v3.5\r\n\r\n<h2 id=\"improvements\">🛠️ Improvements</h2>\r\n\r\n* Fix error when dtype in config is unset by @hans00 in https://github.com...","content":"# 🔥 Transformers.js v3.5\r\n\r\n<h2 id=\"improvements\">🛠️ Improvements</h2>\r\n\r\n* Fix error when dtype in config is unset by @hans00 in https://github.com/huggingface/transformers.js/pull/1271\r\n* [audio utils] fix fft_bin_width computation in https://github.com/huggingface/transformers.js/pull/1274\r\n* Fix bad words logits processor in https://github.com/huggingface/transformers.js/pull/1278\r\n* Implement LRU cache for BPE tokenizer in https://github.com/huggingface/transformers.js/pull/1283\r\n* Return buffer instead of file_path if cache unavailable for model loading by @PrafulB in https://github.com/huggingface/transformers.js/pull/1280\r\n* Use custom cache over FSCache if specified by @PrafulB in https://github.com/huggingface/transformers.js/pull/1285\r\n* Support device-level configuration across all devices by @ibelem in https://github.com/huggingface/transformers.js/pull/1276\r\n\r\n<h2 id=\"new-contributors\">🤗 New contributors</h2>\r\n\r\n* @PrafulB made their first contribution in https://github.com/huggingface/transformers.js/pull/1280\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.4.2...3.5.0","publishedAt":"2025-04-16T16:37:21.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.5.0","media":[]},{"id":"rel_tga6Qqj5M9EwSQB6GolYW","version":"3.4.2","title":"3.4.2","summary":"## What's new?\r\n* Add support for RF-DETR and RT-DETRv2 in https://github.com/huggingface/transformers.js/pull/1260\r\n* Optimize added token split in h...","content":"## What's new?\r\n* Add support for RF-DETR and RT-DETRv2 in https://github.com/huggingface/transformers.js/pull/1260\r\n* Optimize added token split in https://github.com/huggingface/transformers.js/pull/1261 and https://github.com/huggingface/transformers.js/pull/1265\r\n* Support loading local models using relative paths, absolute paths, and model directory in https://github.com/huggingface/transformers.js/pull/1268\r\n\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.4.1...3.4.2","publishedAt":"2025-04-02T00:40:59.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.4.2","media":[]},{"id":"rel_GHSiN0XGvYArVJWYfvS5t","version":"3.4.1","title":"3.4.1","summary":"## What's new?\r\n* Add support for SNAC (Multi-Scale Neural Audio Codec) in https://github.com/huggingface/transformers.js/pull/1251\r\n* Add support for...","content":"## What's new?\r\n* Add support for SNAC (Multi-Scale Neural Audio Codec) in https://github.com/huggingface/transformers.js/pull/1251\r\n* Add support for Metric3D (v1 & v2) in https://github.com/huggingface/transformers.js/pull/1254\r\n* Add support for Gemma 3 text in https://github.com/huggingface/transformers.js/pull/1229. _Note: Only Node.js execution is supported for now._\r\n* Safeguard against background removal pipeline precision issues in https://github.com/huggingface/transformers.js/pull/1255. Thanks to @LuSrodri for reporting the issue!\r\n* Allow RawImage to read from all types of supported sources by @BritishWerewolf in https://github.com/huggingface/transformers.js/pull/1244\r\n* Update pipelines.md api docs in https://github.com/huggingface/transformers.js/pull/1256\r\n* Update extension example to use latest version by @fs-eire in https://github.com/huggingface/transformers.js/pull/1213\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.4.0...3.4.1","publishedAt":"2025-03-25T22:30:54.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.4.1","media":[]},{"id":"rel_3fcGaD71-2iRm_ifVa8oZ","version":"3.4.0","title":"3.4.0","summary":"# 🚀  Transformers.js v3.4 — Background Removal Pipeline, Ultravox DAC, Mimi, SmolVLM2, LiteWhisper.\r\n\r\n- [🖼️ Background Removal Pipeline](#new-pipel...","content":"# 🚀  Transformers.js v3.4 — Background Removal Pipeline, Ultravox DAC, Mimi, SmolVLM2, LiteWhisper.\r\n\r\n- [🖼️ Background Removal Pipeline](#new-pipeline)\r\n- [🤖 New models: Ultravox DAC, Mimi, SmolVLM2, LiteWhisper](#new-models)\r\n- [🛠️ Other improvements](#other-improvements)\r\n- [🤗 New contributors](#new-contributors)\r\n\r\n<h2 id=\"new-pipeline\">🖼️ New Background Removal Pipeline</h2>\r\n\r\nRemoving backgrounds from images is now as easy as:\r\n```js\r\nimport { pipeline } from \"@huggingface/transformers\";\r\nconst segmenter = await pipeline(\"background-removal\", \"onnx-community/BEN2-ONNX\");\r\nconst output = await segmenter(\"input.png\");\r\noutput[0].save(\"output.png\"); // (Optional) Save the image\r\n```\r\n\r\nYou can find the full list of compatible models [here](https://huggingface.co/models?library=transformers.js&other=background-removal), which will continue to grow in future! 🔥 For more information, check out https://github.com/huggingface/transformers.js/pull/1216.\r\n\r\n<h2 id=\"new-models\">🤖 New models</h2>\r\n\r\n* Ultravox for audio-text-to-text generation (https://github.com/huggingface/transformers.js/pull/1207). See [here](https://huggingface.co/models?library=transformers.js&other=ultravox) for the list of supported models.\r\n  \r\n  <details>\r\n  \r\n  <summary>\r\n  See example usage\r\n  </summary>\r\n  \r\n  ```js\r\n  import { UltravoxProcessor, UltravoxModel, read_audio } from \"@huggingface/transformers\";\r\n  \r\n  const processor = await UltravoxProcessor.from_pretrained(\r\n    \"onnx-community/ultravox-v0_5-llama-3_2-1b-ONNX\",\r\n  );\r\n  const model = await UltravoxModel.from_pretrained(\r\n    \"onnx-community/ultravox-v0_5-llama-3_2-1b-ONNX\",\r\n    {\r\n      dtype: {\r\n        embed_tokens: \"q8\", // \"fp32\", \"fp16\", \"q8\"\r\n        audio_encoder: \"q4\", // \"fp32\", \"fp16\", \"q8\", \"q4\", \"q4f16\"\r\n        decoder_model_merged: \"q4\", // \"q8\", \"q4\", \"q4f16\"\r\n      },\r\n    },\r\n  );\r\n  \r\n  const audio = await read_audio(\"http://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/mlk.wav\", 16000);\r\n  const messages = [\r\n    {\r\n      role: \"system\",\r\n      content: \"You are a helpful assistant.\",\r\n    },\r\n    { role: \"user\", content: \"Transcribe this audio:<|audio|>\" },\r\n  ];\r\n  const text = processor.tokenizer.apply_chat_template(messages, {\r\n    add_generation_prompt: true,\r\n    tokenize: false,\r\n  });\r\n  \r\n  const inputs = await processor(text, audio);\r\n  const generated_ids = await model.generate({\r\n    ...inputs,\r\n    max_new_tokens: 128,\r\n  });\r\n  \r\n  const generated_texts = processor.batch_decode(\r\n    generated_ids.slice(null, [inputs.input_ids.dims.at(-1), null]),\r\n    { skip_special_tokens: true },\r\n  );\r\n  console.log(generated_texts[0]);\r\n  // \"I can transcribe the audio for you. Here's the transcription:\\n\\n\\\"I have a dream that one day this nation will rise up and live out the true meaning of its creed.\\\"\\n\\n- Martin Luther King Jr.\\n\\nWould you like me to provide the transcription in a specific format (e.g., word-for-word, character-for-character, or a specific font)?\"\r\n  ```\r\n  </details>\r\n\r\n* DAC and Mimi for audio tokenization/neural audio codecs (https://github.com/huggingface/transformers.js/pull/1215). See [here](https://huggingface.co/models?library=transformers.js&other=dac) for the list of supported DAC models and [here](https://huggingface.co/models?library=transformers.js&other=mimi) for the list of supported Mimi models.\r\n\r\n  <details>\r\n  \r\n  <summary>\r\n  See example usage\r\n  </summary>\r\n    \r\n    DAC:\r\n    ```js\r\n    import { DacModel, AutoFeatureExtractor } from '@huggingface/transformers';\r\n    \r\n    const model_id = \"onnx-community/dac_16khz-ONNX\";\r\n    const model = await DacModel.from_pretrained(model_id);\r\n    const feature_extractor = await AutoFeatureExtractor.from_pretrained(model_id);\r\n    \r\n    const audio_sample = new Float32Array(12000);\r\n    \r\n    // pre-process the inputs\r\n    const inputs = await feature_extractor(audio_sample);\r\n    {\r\n        // explicitly encode then decode the audio inputs\r\n        const encoder_outputs = await model.encode(inputs);\r\n        const { audio_values } = await model.decode(encoder_outputs);\r\n        console.log(audio_values);\r\n    }\r\n    \r\n    {\r\n        // or the equivalent with a forward pass\r\n        const { audio_values } = await model(inputs);\r\n        console.log(audio_values);\r\n    }\r\n    ```\r\n    \r\n    Mimi:\r\n    ```js\r\n    import { MimiModel, AutoFeatureExtractor } from '@huggingface/transformers';\r\n    \r\n    const model_id = \"onnx-community/kyutai-mimi-ONNX\";\r\n    const model = await MimiModel.from_pretrained(model_id);\r\n    const feature_extractor = await AutoFeatureExtractor.from_pretrained(model_id);\r\n    \r\n    const audio_sample = new Float32Array(12000);\r\n    \r\n    // pre-process the inputs\r\n    const inputs = await feature_extractor(audio_sample);\r\n    {\r\n        // explicitly encode then decode the audio inputs\r\n        const encoder_outputs = await model.encode(inputs);\r\n        const { audio_values } = await model.decode(encoder_outputs);\r\n        console.log(audio_values);\r\n    }\r\n    \r\n    {\r\n        // or the equivalent with a forward pass\r\n        const { audio_values } = await model(inputs);\r\n        console.log(audio_values);\r\n    }\r\n    ```\r\n  </details>\r\n  \r\n* SmolVLM2, a lightweight multimodal model designed to analyze image and video content (https://github.com/huggingface/transformers.js/pull/1196). See [here](https://huggingface.co/models?library=onnx&other=smolvlm&sort=trending) for the list of supported models. Usage is identical to SmolVLM.\r\n* LiteWhisper for automatic speech recognition (https://github.com/huggingface/transformers.js/pull/1219). See [here](https://huggingface.co/models?library=transformers.js&other=lite-whisper&sort=trending) for the list of supported models. Usage is identical to Whisper.\r\n\r\n\r\n<h2 id=\"other-improvements\">🛠️ Other improvements</h2>\r\n\r\n* Add support for multi-chunk external data files in https://github.com/huggingface/transformers.js/pull/1212\r\n* Fix package export by @fs-eire in https://github.com/huggingface/transformers.js/pull/1161\r\n* Add NFD normalizer in https://github.com/huggingface/transformers.js/pull/1211. Thanks to @adewdev for reporting!\r\n* Documentation improvements by @viksit in https://github.com/huggingface/transformers.js/pull/1184\r\n* Optimize conversion script in https://github.com/huggingface/transformers.js/pull/1204 and https://github.com/huggingface/transformers.js/pull/1218\r\n* Use Float16Array instead of Uint16Array for kvcache when available in https://github.com/huggingface/transformers.js/pull/1208\r\n\r\n<h2 id=\"new-contributors\">🤗 New contributors</h2>\r\n\r\n* @axrati made their first contribution in https://github.com/huggingface/transformers.js/pull/602\r\n* @viksit made their first contribution in https://github.com/huggingface/transformers.js/pull/1184\r\n* @tangkunyin made their first contribution in https://github.com/huggingface/transformers.js/pull/1203\r\n\r\n**Full Changelog**: https://github.com/huggingface/transformers.js/compare/3.3.3...3.4.0","publishedAt":"2025-03-07T12:04:56.000Z","url":"https://github.com/huggingface/transformers.js/releases/tag/3.4.0","media":[]}],"pagination":{"page":1,"pageSize":20,"totalPages":5,"totalItems":84},"summaries":{"rolling":{"windowDays":90,"summary":"Transformers.js shipped v4 with a ground-up rewrite of its WebGPU backend in C++, developed in partnership with the ONNX Runtime team. The new runtime expands operator support across roughly 200 existing model architectures plus new v4-exclusive designs, and enables the same transformers.js code to run across diverse JavaScript environments including browsers and beyond.","releaseCount":1,"generatedAt":"2026-04-07T17:29:40.319Z"},"monthly":[{"year":2026,"month":3,"summary":"Transformers.js reached v4.0.0 with a complete rewrite of its WebGPU runtime in C++, built in collaboration with the ONNX Runtime team. The new backend expanded operator support across ~200 existing model architectures plus new v4-exclusive ones, enabling the same code to run across diverse JavaScript environments.","releaseCount":1,"generatedAt":"2026-04-07T17:29:42.154Z"}]}}