Repository navigation
Releases
Release v5.26.0
New Model additions
Qwen4
Qwen4 is a model that combines Gated DeltaNet and Qwen Sparse Attention with GatedResidual connections and a dense SwiGLU feed-forward network. In Hugging Face Transformers, Qwen4ForCausalLM handles text generation, and Qwen4ForConditionalGeneration handles image and video inputs. The documentation shows usage with the Qwen/Qwen4-27B checkpoint.
Links: Documentation
Qwen4 MoE
Qwen4 MoE uses the mixture-of-experts and per-layer embedding architecture described in Qwen4-Exp. Qwen4MoeForCausalLM handles text generation, and Qwen4MoeForConditionalGeneration handles image and video inputs. The documentation gives no further detail on the model's capabilities, training, or sizes.
Links: Documentation
Molmo3
Molmo3 is a family of open vision-language models from the Allen Institute for AI (Ai2), focused on spatial and 3D understanding and grounding. It accepts single images, multiple images and videos. It uses the Molmo2 architecture: a SigLIP 2-initialized vision transformer, an adapter that pools patch features into image tokens, and a Qwen3-initialized text decoder. A grounding head, introduced by MolmoPoint, generates grounding tokens instead of text coordinates. With it, the model can point to objects in images and videos, track objects in videos, segment objects, estimate depth or surface normals at a point, and predict 3D boxes.
Links: Documentation | Paper
WeatherNext 2
WeatherNext 2 is a global weather forecasting model from Google DeepMind and Google Research. It generates ensemble forecasts in six-hour steps and predicts atmospheric conditions and tropical cyclone diagnostics. Transformers now supports the full-resolution 0.25° checkpoints and a lighter 1° Mini model, with community-converted weights available in the WeatherNext2 collection.
Links: Documentation
Liquid Codec
Liquid Codec is the speech codec of LFM3-Audio by Liquid AI. It converts 24 kHz audio into 12 codebooks of 2016 codes at 12.5 Hz and decodes the codes back to audio. It consists of a causal LFM3 encoder, a finite scalar quantizer, and a causal LFM3 decoder followed by an inverse STFT head that synthesizes the waveform. It supports batched processing with right padding and streaming decoding.
Links: Documentation
Breaking changes
- ðĻ [PR3] [Modular Cleanup] *RotaryEmbedding canonical parents and renaming (#50537) by @itazap
- ðĻ [
Indexer] Refactor Indexers (#51202) by @vasqu
Kernels
This release updates Hub kernel integrations and compatibility: it moves to mamba-ssm v6 and flash-attn4 v2 (which no longer need pip-installed einops), fixes the sonic-moe revision/version, and adjusts kernels that didn't meet Transformers' standards. It also re-enables the Atlas Gated DeltaNet kernels for Qwen3.5/3.6/3.8 on GB10 and Strix Halo, now that
- [Atlas Inference] Re-enable the Atlas GDN hub kernels cache rename and backward fixed (#51665) by @AzeezIsh in [#51665]
- [
kernels] fix sonicmoe revision/version (#51647) by @vasqu in [#51647] - [
Kernels] Adjust kernels compat (#51621) by @vasqu in [#51621] - [kernels] Use mamba-ssm v6 and flash-attn4 v2 (#51587) by @kashif in [#51587]
Attention
This release fixes several attention-related issues. The deferred generate check is now handled correctly for linear attention and encoder-decoder models, which keeps them compatible with the default cudagraphs compile config. Flash Attention is re-enabled for Gemma 4 checkpoints that don't use bidirectional attention over images (E2B and E4B), and still raises an error for those that do. Flash Attention also no longer drops queries in non-causal cross-attention when the keys are
- Fix deferred generate check for linear attention & encoder-decoder models (#51675) by @Cyrilvallez in [#51675]
- Allow Flash Attention for Gemma 4 checkpoints without bidirectional attention over images (#51558) by @albertvillanova in [#51558]
- Flash attention: keep every query in non-causal cross-attention with padded keys (#51280) by @arywk40-hue in [#51280]
Bugfixes and improvements
- Add mtp (#51701) by @vasqu in [#51701]
- Experts: per-expert post norms through
_apply_post_expert_norm, Ergo on the stock experts backends (#51615) by @IlyasMoutawwakil in [#51615] - Left-pad prompts in the SmolVLM mixed-batch example (#51686) by @stefanielizeth73-art in [#51686]
- Fix export after the indexer refactor (#51687) by @IlyasMoutawwakil in [#51687]
- [docs] Fix the code blocks in the video classification guide (#51534) by @AlexxRussell in [#51534]
- [CI] Update team members for the daily CI new-failure report (#51691) by @ydshieh in [#51691]
- [serge] Fix 2 integration tests regressed by commit 52bac5d (PR #50897) (#51660) by @sergereview[bot] in [#51660]
- OpenVINO exporter: keep rms_norm, col2im and repeat_interleave whole on OpenVINO 2026.5 (#51674) by @IlyasMoutawwakil in [#51674]
- [docs] Native FSDP2 (#51649) by @stevhliu in [#51649]
- Bump doc-builder workflow (#51641) by @stevhliu in [#51641]
- AMD Radeon R9700 CI: report to production channel + dataset (#51676) by @Abdennacer-Badaoui in [#51676]
- AMD CI: add Radeon AI Pro R9700 (gfx1201) lane (#51583) by @Abdennacer-Badaoui in [#51583]
- Add config defaults checker in repo consistency (#51366) by @zucchini-nlp in [#51366]
- Continuous batching: fill the host block table through numpy (#51358) by @qgallouedec in [#51358]
- Fix Gemma3n sparse MLP synchronization in eager CUDA inference (#51077) by @hlin99 in [#51077]
- [ALM] allow inputs_embeds + input_features (#51492) by @eustlb in [#51492]
- Fix the Mistral 3 batched inference examples (#51591) by @AyhamJo7 in [#51591]
- [docs] Fix undefined names in the task guide code blocks (#51582) by @AlexxRussell in [#51582]
- Fix activate_past_recording default value (#51640) by @Cyrilvallez in [#51640]
- [tests_fetcher] Trigger processor tests of models using another model's preprocessor via the auto mappings (#51624) by @ydshieh in [#51624]
- Keep packed sequences apart in the Qwen3.8-Flash-Next n-gram shift (#51576) by @albertvillanova in [#51576]
- OpenVINO exporter: fix exports on OpenVINO 2026.5 (#51584) by @IlyasMoutawwakil in [#51584]
- Fix Gemma 4 per-layer inputs under tensor parallelism (#51566) by @dacorvo in [#51566]
- Fix shared mutable defaults in SubConfigSpec (#51616) by @sushmanthreddy in [#51616]
- FIX (#51623) by @zucchini-nlp in [#51623]
- Fix device movement (#51622) by @Cyrilvallez in [#51622]
- fix scaling once and forever (#51609) by @zucchini-nlp in [#51609]
- Refresh Ergo chat fixtures for the released tool schema (#51598) by @younggyoseo in [#51598]
- Fix TimesFM's ONNX export comparison for fully padded patches. (#51610) by @sywangyi in [#51610]
- Fix video
smart_resizeto compute the pixel budget with padded frame counts (#51155) by @11098489 in [#51155] - Sum the MoE experts' top-k outputs without a float32 copy of all rows (#51491) by @eilamc14 in [#51491]
- cohere processor fix (#51254) by @ebezzam in [#51254]
- Update dev (#51586) by @vasqu in [#51586]
Significant community contributions
The following contributors have made significant changes to the library over the last release:
Patch release v5.25.1
Patch release v5.25.1
A mix of very different issues, some tokenizers, modeling, and kernels. See the full list below:
- Honor tokenizer-configured control-token sanitization in chat templates (#51599) by @younggyoseo
- Fix Gemma 4 per-layer inputs under tensor parallelism (#51566) by @dacorvo
- Fix activate_past_recording default value (#51640) by @Cyrilvallez
- [kernels] Use mamba-ssm v6 and flash-attn4 v2 (#51587) by @kashif
- [Kernels] Adjust kernels compat (#51621) by @vasqu
Full Changelog: v5.25.0...v5.25.1
Release v5.25.0
Release v5.25.0
New Model additions
Ergo
Amazon Ergo is a frontier open-weights model for software engineering and agentic workflows. Ergo is designed to tackle complex, long-running tasks while being fast and cost efficient. Ergo is a 1.1 trillion parameter mixture-of-experts model with 55 billion active parameters and a 1M-token context window.
Links: Documentation | Model weights | Official Post
Kolibri1_1
Kolibri 1.1 is Aleph Alpha's successor to Kolibri 1. It is a causal language model that keeps the mixture-of-experts layers and sliding-window attention layers of Kolibri 1, and uses dense MLPs in its first two layers. Every fifth layer is an "indexed_attention" layer that sparsely attends to the whole context. Each query sees the first 8 tokens, the 128 most recent tokens, and the 2048 highest-scoring other keys. Keys and values are rounded to NVFP4. The Transformers version is a reference implementation that supports only the eager and SDPA attention implementations.
Links: Documentation
- Add kolibri 1.1 (#51176) by @Cyrilvallez in #51176
MiniCPM5-15B-A2.5B
MiniCPM5-15B-A2.5B is a decoder-only mixture-of-experts language model with 15 billion total parameters and 2.5 billion active parameters per token. It uses gated grouped-query attention. The first decoder layer has a dense feed-forward network, and each later layer combines a shared expert with 16 routed experts selected from 160 per token.
Links: Documentation
PI0.5
PI0.5 is a vision-language-action model for robot manipulation from Physical Intelligence. It keeps the PI0 layout: a PaliGemma backbone reads the camera images and the prompt, and a smaller Gemma action expert predicts a chunk of actions with flow matching. Compared to PI0, the robot state is discretized into 256 bins and written into the text prompt rather than projected into the action expert, and the action expert receives the denoising timestep through adaptive RMS norms.
Links: Documentation | Paper
Param2Moe
Param2Moe is the architecture behind Param-2-17B-MoE-A2.4B, a Mixture of Experts language model from BharatGen AI. It has 17B total parameters, with 2.4B active per token, and supports English, Hindi, and 21 Indian languages. It uses grouped-query attention with QK normalization and full rotary position embeddings. Its hybrid MoE design has a dense first layer, then routes each token to 6 of 64 experts plus 2 always-active shared experts, using sigmoid routing with expert bias correction. The architecture is the same as GLM-4-MoE, so the auto classes load it with the GLM-4-MoE implementation and only the config is specific to Param2Moe.
Links: Documentation
- Add support for BharatGen's Param2MoE model architecture (#46395) by @bhargav-patel-29 in #46395
LLaVA-OneVision-1.5
LLaVA-OneVision-1.5 is a vision-language model that pairs a native-resolution vision encoder with a Qwen3 language backbone. The vision encoder adds a learned class token to each image, applies full attention, removes the class token, and merges spatial patches into visual features for the language model, which uses standard one-dimensional rotary positions over the combined image and text sequence. The accompanying paper presents an open framework for training vision-language models from scratch at reduced cost. It reports that the 8B model exceeds Qwen2.5-VL-7B on 18 of 27 benchmarks and the 4B model exceeds Qwen2.5-VL-3B on all 27. Transformers supports the 4B and 8B Instruct checkpoints.
Links: Documentation | Paper
Ovis2.5
Ovis2.5, from AIDC-AI, is a multimodal model for image, video, and text understanding. It combines a native-resolution vision encoder, which keeps variable-resolution visual inputs as a sequence of patches rather than fixed-resolution tiles, with a visual tokenizer and a Qwen3 language backbone. It also offers an optional thinking prompt format for tasks that benefit from a longer reasoning response.
Links: Documentation | Paper
- Add Ovis2.5 model support (#47659) by @sushmanthreddy in #47659
Kernels becomes a default dependency
Starting with this release, kernels is a base dependency of Transformers and is automatically installed with pip install transformers. Kernels are now enabled by default when loading models with from_pretrained, bringing out-of-the-box performance improvements to operations such as RMSNorm and RoPE, with particularly noticeable benefits for models using linear attention, such as Qwen3.5.
Another benefit is that Flash Attention is now available out of the box on supported hardware. Simply pass attn_implementation="flash_attention_2" when loading a model, and Transformers will automatically fall back to the corresponding Hub kernel if the Flash Attention package is not installed.
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen3.5-4B",
device_map="auto",
attn_implementation="flash_attention_2",
)No separate installation of flash-attn or kernels is required.
To restore the previous behavior, pass use_kernels=False to from_pretrained.
Breaking changes
Molmo2VideoProcessor now samples frames the same way as the Hub processor's sample_frames (e.g. 21 instead of 19 frames for a 9.72 s video at 25 fps), so video inputs and outputs may differ from earlier releases; no code changes are required, but cached results should be regenerated.
Molmo2's image and video processors now compute image_token_pooling and video_token_pooling indices per item, with no offset from earlier items in the same call, so items can be cached, split, or concatenated safely. Code that relied on batch-global offsets must be updated, because the model now applies them.
Kernels are now enabled by default (use_kernels defaults to True in from_pretrained), so supported layers such as RoPE, RMSNorm, activations, and Mamba/FLA may load Hub kernels automatically; this requires a compatible kernels release, and you should pass use_kernels=False to keep the previous behavior.
Sub-processor loading was reworked to resolve from the nested processor dict, which adds a public ProcessorMixin.from_dict classmethod and deprecates the old non-keyword argument passing; custom processors or remote code that relied on the old arguments should migrate to the new keyword-based flow.
- ðĻ Rework slightly subprocessor loading (#50428) by @zucchini-nlp
The causal conv1d, Mamba scan, and Mamba2 SSD steps in linear attention layers are now exposed as three kernelizable seams, so runtimes such as vLLM can replace them with kernelize;
-
ðĻ Make the causal conv1d, Mamba scan and Mamba2 SSD of linear attention layers kernelizable (#49186) by @hmellor
-
ðĻ [modular fix] remove failing freeze_encoder (#51252) by @ebezzam
-
ðĻ [PR2] [Modular Cleanup] *Norm canonicals and renaming (#50523) by @itazap
Kernels
This release updates the kernels integration: it removes the legacy megablocksmoe kernel and the incorrect FalconMamba mamba_inner_fn kernel, bumps the minimum kernels version, and moves the fla hub kernel to v3. It also adds ROCm support for the deformable attention kernel, loads Hub kernels set on sub-configs in set_attn_implementation, and keeps the tensor-parallel gradient all-
- [
Kernels] Remove last remains of megablocksmoe (#51541) by @vasqu in [#51541] - Load Hub kernels set on a sub-config in set_attn_implementation (#51504) by @albertvillanova in [#51504]
- Fix a kernel registration leak between tests in tests/kernels (#51415) by @ydshieh in [#51415]
- [CI] Fix tests after default kernels (#47773) - part 5: flash attention with float32 (idefics2, diffllama) (#51455) by @ydshieh in [#51455]
- [CI] Fix tests after default kernels (#47...
Patch release v5.24.1
Patch release v5.24.1
A patch to fix a bunch of stuff for vLLM, a few distributed issues, and some model fixes (llama4, dory); see the full list
vLLM related
- Fix backward compatibility of the cache rename for remote code (#51085) by @hmellor
- Restore modeling_attn_mask_utils for remote code (one-off to unblock vLLM) (#51124) by @hmellor
- Expose past_key_values in MBartDecoderLayer.forward signature for remote code (#51177) by @hmellor
- [OmniASR] Support a padding_mask kept on the CPU in the audio encoder (#51100) by @El-euchidali
Model fixes
- Fix Llama4 forward crash on missing image_outputs (#51144) by @kylesayrs
- Fix dory static cache (#50993) by @ArthurZucker
Distributed
- Allow expert parallelism alone with tp_plan={} (#50996) by @3outeille
- Fix strided checkpoint reads on PyTorch 2.9 (#51042) by @satsuki2486441738
Full Changelog: v5.24.0...v5.24.1
Release v5.24.0
Release v5.24.0
New Model additions
Inkling 2 Mini
Inkling 2 Mini is a multimodal model from Thinking Machines Lab that accepts text and image inputs and generates text outputs. It is a smaller sibling of Inkling 2 Small, added in v5.23.0. It has 24 decoder layers instead of 48, and compensates with a looping mechanism in which layers 6 to 17 run three times. A learned message-passing mechanism mixes the residuals of the previous pass into the attention and mixture-of-experts inputs of each loop layer. The decoder has a hidden size of 2304 and routes each token to 8 of 128 experts. The image encoder, tokenizer and processor are the same as Inkling 2 Small's.
A research checkpoint (TML-d24-varloop-research) has the same architecture but supports a variable number of loop passes. Fewer passes are faster, and more passes improve quality. Both checkpoints contain NVFP4 and MXFP8 quantized layers, which are dequantized at load time.
Links: Documentation | Blog Post | HF Blog Post
Apertus 1.5
Apertus 1.5 is a multimodal model from the Swiss AI Initiative that accepts text, images and audio and generates text. It extends the Apertus language model with the EMU3.5 vision tokenizer for images and WavTokenizer for audio. The EMU3.5 tokenizer is an image-only VQGAN with the same encoder as Chameleon's, and it assigns codes by the largest inner product with the codebook. The media tokenizers turn images and audio into discrete tokens, which the language backbone processes alongside text in a shared input vocabulary. The output vocabulary contains only text tokens, so image and audio generation are not supported.
Links: Documentation
- Apertus 1.5: add model (#47662) by @RaphaelKreft
WavTokenizer
WavTokenizer encodes 24 kHz mono audio into discrete tokens using a single codebook, at 40 or 75 tokens per second depending on the checkpoint, and reconstructs audio from those tokens. WavTokenizerModel encodes and decodes, and WavTokenizerEncoderModel only encodes. Speech, music/audio and unified checkpoints are available. The 40-token-per-second variant is the audio tokenizer of Apertus 1.5. Training the codec is not supported.
Links: Documentation | Paper
- Apertus 1.5: add model (#47662) by @RaphaelKreft
Dory
Dory is a looped (latent-recurrent) language model from NVIDIA. It uses a normalized-GPT architecture with interleaved sliding-window and full attention layers. A shared block of layers is applied repeatedly, so Dory can spend more compute per token. The loop count can be changed at inference time on the same checkpoint to trade speed against quality.
Links: Documentation | Paper (nGPT)
HY4-VL
HY4-VL (Hunyuan V4 Vision-Language) combines the HYV4 mixture-of-experts text backbone with a vision encoder for image-text and video-text generation. It supports dynamic-resolution visual inputs and uses multimodal rotary position embeddings (mRoPE) to represent temporal and spatial positions. It builds on the Qwen2-VL design and shares its vision patch merger with HunYuan-VL.
Links: Documentation
Omnilingual ASR
Omnilingual ASR is a suite of multilingual speech-recognition models from Meta FAIR that covers more than 1,600 languages. Each model pairs a Wav2Vec2-style audio encoder with one of two heads:
- CTC (
OmniASRForCTC): a linear projection to the vocabulary, decoded non-autoregressively with greedy CTC. - Audio language model (
OmniASRForConditionalGeneration): audio embeddings are projected into a Llama decoder that generates the transcription. It optionally takes a language code (e.g."eng_Latn"), which generally improves transcription quality.
Both variants come in 300M, 1B, 3B and 7B sizes.
Links: Documentation | CTC Documentation | Paper
Lara Mini
Lara Mini is a multilingual base language model from Translated with 7.2B total and 0.6B active parameters per token. It is a hybrid of linear-time recurrent layers, sliding-window attention and a few global attention layers, each followed by a fine-grained mixture of experts. The weights are released under the CC BY-NC-SA 4.0 license (non-commercial use) in a gated repository.
Links: Documentation | Paper
SarvamMLA
SarvamMLA is the architecture of Sarvam-105B, a 105B-parameter mixture-of-experts language model from Sarvam AI. It combines Multi-head Latent Attention (MLA) with sparse MoE routing: 128 routed experts with 8 active per token, plus 1 shared expert. It uses sigmoid routing with group-based top-k selection and YaRN rotary embeddings for contexts up to 131K tokens. The architecture is the same as DeepSeek-V3, with a custom configuration.
Links: Documentation
- Add SarvamMLA model (sarvamai/sarvam-105b) (#44569) by @aashay-sarvam
SarvamMoE
SarvamMoE is the architecture of Sarvam-30B, Sarvam AI's 30B-parameter mixture-of-experts model. It uses grouped-query attention with QK normalization, and 128 routed experts with 6 active per token, plus 1 shared expert. The architecture is the same as GLM-4-MoE, so the auto classes load it with the GLM-4-MoE implementation and only SarvamMoEConfig is specific to SarvamMoE.
Links: Documentation
EXAONE
EXAONE covers the EXAONE 3.0, EXAONE 3.5 and EXAONE Deep language models from LG AI Research. Their architecture is the same as Llama, so the auto classes load them with LlamaModel and LlamaForCausalLM, and only ExaoneConfig is specific to EXAONE. The released checkpoints are renamed to the Llama names when loading and back when saving, so they no longer need trust_remote_code=True.
Links: Documentation
Model updates
- Ling 3.1 Flash now loads natively through
BailingHybrid, like Ling 3.0 in v5.20.0 (#49737) by @icavan - Beam gains a
BeamForTokenClassificationhead (#50634) by @AymenKallala
Breaking changes
Cache renaming: past_key_values / cache_params â cache (#50585, #50730)
past_key_values and cache_params are renamed to cache across the library. The old names still work with a deprecation warning; see the dedicated section below.
- ðĻðĻ Rename
past_key_values/cache_paramstocache(#50585) by @Cyrilvallez - Bump minimal peft version for cache name compatibility (#50730) by @Cyrilvallez
Attention models used to call their cache past_key_values, while Mamba-style and linear-attention models called it cache_params. Hybrid models therefore had to juggle two names for the same object. There is now a single name, cache, everywhere: model forward signatures, generate, prepare_inputs_for_generation, the masking utilities, and every ModelOutput.
# Before
outputs = model(input_ids, past_key_values=past_key_values, use_cache=True)
next_cache = outputs.past_key_values
# Now
outputs = model(input_ids, cache=cache, use_cache=True)
next_cache = outputs.cache- Fully backward compatible for now:
past_key_values=/cache_params=are renamed tocacheautomatically, with a one-time deprecation warning. Modelforwardandprepare_inputs_for_generationaccept the old names until v5.40.0, andgenerateaccepts them until v6.0.0. Passing both an old name andcacheraises aValueError. - Outputs too:
outputs.past_key_values,outputs.cache_paramsandoutputs["past_key_values"]still return the cache. Output classes can also still be built with the old field names (e.g.CausalLMOutputWithPast(past_key_values=...)), so most remote-code models keep working unchanged. - Custom code: models defined outside the library should rename their arguments to
cache. Layers now callcache.update(key_states, value_states, layer_idx, kwargs=kwargs), so customCachesubclasses that overrideupdateshould accept the extrakwargsargument.
ðĻ peft>=0.22.0 is now required.
ð Docs: https://huggingface.co/docs/transformers/main/en/kv_cache
Multimodal Outputs
Generative multimodal models now return shared output classes (MultimodalBaseModelOutputWithPast, MultimodalCausalLMOutputWithPast, and their MoE variants) instead of one output class per model. Code that checks for a model-specific output class should switch to these.
- ðĻ Multimodal Model Output for generative LMs (#50379) by @zucchini-nlp
modeling_attn_mask_utils.py...
Release v5.23.0
Release v5.23.0
New Model additions
Inkling2
Inkling 2 Small is a multimodal model from Thinking Machines Lab that accepts text and image inputs and generates text outputs, and it is intended for use in English and other languages and across multiple coding languages. Its language backbone has 48 mixture-of-experts decoder layers, each routing tokens to 8 of 384 experts, for 594B total and 17B active parameters. It keeps the Inkling decoder (learned relative attention, short causal convolutions, mixture-of-experts layers) and adds block attention residuals, gated attention with a learned sink, and dynamic key/value convolutions. Images are encoded by a Perception Encoder-based vision transformer and projected into the language model embeddings, one embedding per 40x40 pixel patch.
Links: Documentation | Blog Post
JEV
JEV is a decision head that scores single-token labels with a linear layer at the last token of the prompt, soft-capped like the logits of a language model head. JevForDecision is the model of the checkpoint and its head, and it reads the head files shipped next to the weights (head.safetensors and judge_config.json for JEV). The same head is also used by GEV and reads the 255 answer codes of pplx-decider and d3, and it can be run through the experimental decision pipeline or directly with decide.
Note: JEV and the decision pipeline are currently experimental. Their APIs, configuration, and behavior may change as development continues. They should be used with caution in production environments.
Links: Documentation
- Add Jev + decision core (#50054) by @ArthurZucker in #50054
LFM3
LFM3 is the third generation of Liquid Foundation Models from Liquid AI. Like LFM2, it is a hybrid architecture that combines gated short convolutions with grouped-query attention, with the attention layers split between full-attention and sliding-window layers. The attention layers apply RMSNorm to the query and key heads and gate their output with a per-head sigmoid. Every layer applies a sandwich norm to the operator and feed-forward outputs before the residual addition.
Links: Documentation
- [Model] LFM3 Family: LFM3-Text (#50322) by @paulpak58 in #50322
Dots 3 Note Preview
Dots 3 Note Preview is a mixture-of-experts causal language model that accepts native text, image, video, and audio inputs. It uses a shared vision encoder for images and videos and a Whisper-style audio encoder, and both encoders project their outputs into the language model's hidden space before autoregressive text generation. BF16 and FP8 inference are supported.
Links: Documentation
- Add dots3-note Preview model support (#47844) by @miraclezqc in #47844
LFM3-VL
LFM3-VL is a vision-language model family from Liquid AI, built on the LFM3 language model. It takes images and videos at their native resolution together with text. It combines a hybrid vision encoder (a linear patchifier, gated depthwise 2D convolution layers, and bidirectional grouped-query attention layers with 2D rotary embeddings) with a projector and an LFM3 language model. The projector merges each 2x2 block of patch features into one language token through a layer norm and a two-layer MLP.
Links: Documentation
- [Model] LFM3 Family: LFM3-VL (#50392) by @paulpak58 in #50392
IQuestCoder
IQuest-Coder-V1 is a family of code language models developed by IQuest Lab, available in 7B, 14B and 40B sizes with base, instruct and thinking variants. Its architecture is the same as Llama, so the Transformers auto classes load it with LlamaModel and LlamaForCausalLM, and only IQuestCoderConfig is specific to IQuestCoder. The looped IQuest-Coder-V1-*-Loop-* checkpoints use a different architecture and aren't supported.
Links: Documentation
InternLM3
InternLM3 is an 8B instruction-tuned language model developed by Shanghai AI Laboratory (checkpoint: internlm/internlm3-8b-instruct). Its architecture is the same as Llama, so the auto classes load it with the Llama implementation (LlamaModel and LlamaForCausalLM), and only InternLM3Config is specific to InternLM3. The config names the attention biases qkv_bias and the output projection and MLP biases bias. InternLM3Config loads these as attention_bias and mlp_bias and requires them to be equal, as they are in the released checkpoints.
Links: Documentation
Breaking changes
- ðĻ Remove the
ep_routerexpert-parallel style (#49615) by @IlyasMoutawwakil - ðĻ Run MXFP4 GPT-OSS experts through
ep_dispatch_experts(#49613) by @IlyasMoutawwakil - ðĻ
deepgemm_megamoeEP implementation for DeepGEMM Mega MoE (#49606) by @IlyasMoutawwakil - ðĻ Slim down
[audio]to torchaudio + soundfile + soxr (drop librosa and phonemizer) (#50610) by @eustlb - ðĻ Deprecate Wav2Vec2ProcessorWithLM and pyctcdecode/kenlm LM decoding (#50408) by @eustlb
- ðĻ Exporters:
ExportedModel, Hub save/load, one backend registry (#50029) by @IlyasMoutawwakil - ðĻ Move processing defaults to class (#49089) by @guarin
- ðĻ [
kernels] Bump version (#50307) by @vasqu - ðĻ Finally drop rope deltas from ModelOutput! (#50153) by @zucchini-nlp
- ðĻ Safe-ize pi0 graphs (#50160) by @molbap
- ðĻ [serve][breaking] update attn for mac users (#49730) by @SunMarc
- ðĻ build and expand once the tp/ep_plan/fsdp_plan (#49527) by @3outeille
Exporters: export, share and run any model on its backend (#50029, #50032, #50309, #50311)
exporters.mp4
Every export now returns an ExportedModel. You call it like the original model (same kwargs, same output class), push it to the Hub, and load it back on the backend's own runtime. The same API covers Dynamo, ONNX Runtime, OpenVINO and ExecuTorch.
from transformers import AutoModel, AutoTokenizer
from transformers.exporters import ExportedModel, OnnxConfig, OnnxExporter
model = AutoModel.from_pretrained("google/embeddinggemma-2")
tokenizer = AutoTokenizer.from_pretrained("google/embeddinggemma-2")
inputs = tokenizer(["Exporters are here!"], return_tensors="pt")
exported = OnnxExporter().export(model, inputs, OnnxConfig(dynamic=True, ort_fusions="cuda"))
exported.push_to_hub("my-org/embeddinggemma-2-onnx")
exported_model = ExportedModel.from_pretrained("my-org/embeddinggemma-2-onnx", device="cuda")
outputs = exported_model(**inputs) # same output class as model(**inputs)- Fused for the runtime:
OnnxConfig(ort_fusions="cpu" | "cuda" | "webgpu" | "dml")rewrites the graph into ONNX Runtime's fused transformer ops at export time: attention,GroupQueryAttentionover the KV cache, rotary, norms andMoE. OpenVINO exports now hit OpenVINO's fused CPU kernels for attention, RoPE, MoE experts and compressed int8/int4 weights, which makes decode 2.4â3.9Ã faster than before. - Faster than
torch.compile: on EmbeddingGemma2 (8 Ã 128 tokens), ONNX Runtime with the TensorRT EP is 7.6Ã faster than eager PyTorch and 1.4Ã faster thantorch.compileon an A100. OpenVINO is 4.1Ã faster than eager and 2.2Ã faster thantorch.compileon a Xeon Platinum 8570 (4.9Ã and 2.6Ã with int8 weights). - Shareable: an export saves and loads like a model, optionally in a
subfolderof the model repo. Itsexport.jsonrecords the config, input shapes, package versions and I/O names. Quantized exports (PT2E, NNCF, ONNX Runtime) save and run the same way.
ðĻ export() returns an ExportedModel, and an ONNX program is an onnx_ir.Model. OnnxConfig's and OpenVINOConfig's output_path options are gone in favour of save_pretrained. Custom backends register with register_backend.
ð Docs: https://huggingface.co/docs/transformers/main/en/exporters
Vision
This release fixes a range of vision-model bugs: classification pipelines now respect problem_type, and several models get corrected behavior (Step3.7 RoPE axis order, MiniMax-M3-VL packed attention isolation, Qwen VL positions with reused caches, PaddleOCR-VL interpolation alignment, Kosmos2 SDPA masking, and Emu3 float image handling). Chunked prefill now keeps image inputs on the
- fix(pipelines): respect problem_type in image and video classification pipelines (#50582) by @surendra902 in [#50582]
- Fix Step3.7 vision RoPE spatial W/H axis order (#50547) by @caohch-1 in [#50547]
- Raise ValueError for out-of-range float images in convert_to_rgb (#50487) by @n24q02m in [#50487]
- CI: install OpenVINO and NNCF in the daily GPU ...
Patch release v5.22.2
Patch release v5.22.2
Some in between patch for security and distributed fixes. See the included commits ðĪ
- [Distributed] Set device_id only for NCCL (#50281) by @michaelbenayoun and @3outeille
- Harden our Jinja sandboxing (#50431) by @Rocketknight1
Full Changelog: v5.22.1...v5.22.2
Patch release v5.22.1
v5.22.0: Mistral Large 4 (Le Chonk)
New Models
Mistral Large 4 (Le Chonk)
Mistral Large 4 is Mistral's largest and most capable model to date: a 1 trillion-parameter natively multimodal Mixture-of-Experts model with 49 billion active parameters per token (52 billion including embeddings and output layers), trained from scratch on 3,800 NVIDIA Grace Blackwell GPUs in Mistral's own datacenters in Europe.
Mistral Large 4 unifies instruction following, reasoning, coding, and agentic workflows in a single set of weights. While a generalist model, it shows especially good performance on workloads such as cybersecurity, finance, and law, and it surpasses frontier closed models on visual grounding. It is natively fluent in 160+ languages, including every official language of the European Union.
Key Features
Mistral Large 4 includes the following architectural choices:
- ~1T total / ~52B active parameters: granular Mixture-of-Experts with 128 routed experts (4 active per token) and 1 shared expert.
- 1M context length, for long-context workloads.
- Multimodal input: accepts text and image input, with text output. Pixtral-style vision encoder trained to handle variable image sizes and aspect ratios.
- Instruct and Reasoning functionalities with function calls, reasoning effort configurable per request.
Mistral Large 4 offers the following capabilities:
- Reasoning Mode: three reasoning efforts â
low,medium,high(default) â so the same model can answer a quick chat reply or work through a complex agentic run. - Vision: analyzes images, charts, technical drawings, and documents, with state-of-the-art visual grounding among open weights.
- Multilingual: natively fluent in 160+ languages, including all official languages of the European Union.
- System Prompt: strong adherence and support for system prompts.
- Agentic: native function calling, JSON output, and strict JSON schema enforcement.
- Cybersecurity: state of the art among open-weight models for security work, while refusing malicious requests.
- Large Context Window: supports a 1M context window.
The model is released under the Mistral Ecosystem Open-Weight License: a modified version of the MIT license, for both commercial and non-commercial use â operating a Model-as-a-Service business requires a separate commercial license with Mistral.
Recommended Settings
- Reasoning Effort:
'low'/'medium'/'high'â default is'high'.- Use
reasoning_effort="high"for complex prompts and agentic usage,'low'for fast chat replies and'medium'for day to day usage.
- Sampling: for all reasoning efforts, we recommend the following sampling parameters:
temperature=1.0top_p=0.95
- System Prompt: define a clear environment and use case, including guidance on how to effectively leverage tools in agentic systems.
- Tools: keep the set of tools well-defined and limit their number to the minimum required for the use case.
- Context: the checkpoint supports a 1M context window.
Breaking changes
- ðĻ Separate EP logic into its own file (#49679) by @3outeille
Quantization
FP8 quantized models can now be used for adapter training (such as LoRA with PEFT). Backward passes were added to the dense and grouped FP8 matmuls, and is_trainable is now True. Backward also dequantizes experts in chunks and skips autograd at inference, which cuts peak memory in the MoE layer backward from about 28.9 GiB to 2.8 GiB at 8k tokens. Separately, the AMD CI image now install
- FP8 backward: chunked expert dequant, skip autograd.Function at inference (#50117) by @ArthurZucker in [#50117]
- Train adapters on top of FP8 weights (#50031) by @qgallouedec in [#50031]
- [AMD CI] Install onnxscript, bitsandbytes and peft in the AMD image (#50046) by @Abdennacer-Badaoui in [#50046]
Bugfixes and improvements
- Processor unnecessary warnings (#49812) by @zucchini-nlp in [#49812]
- Fix boolean padding in ClapFeatureExtractor (#23648) (#49960) by @rudy-07 in [#49960]
- [Fix] Count cropping of an uninitialized layer as a no-op (#50104) by @remi-or in [#50104]
- [loading] Allow
PermuteForRopeto act on single tensors while renaming (#50092) by @Cyrilvallez in [#50092] - Add Nemotron 3.5 Transcribe (#50084) by @eustlb in [#50084]
- [Nemotron3Diarization] add left context support (#49283) by @eustlb in [#49283]
- [Janus] Fix processor iterating a string prompt character by character (#50044) by @tarekziade in [#50044]
- fix(config): forward token kwarg to get_config_dict in PreTrainedConfig.from_pretrained (#50081) by @ydshieh in [#50081]
- Fix
rope_scalingsetter for configs that assign it during init (#50080) by @hmellor in [#50080] - [timesfm] Fix fp16 overflow on pad_val in _forward_transform (#50021) by @tarekziade in [#50021]
- Update dev version (#50068) by @albertvillanova in [#50068]
- Pin the shared Hub MIC fleet dataset (#49802) by @tarekziade in [#49802]
- [docs] NVIDIA/Intel/CPU (#49650) by @stevhliu in [#49650]
- Document how to handle non-persistent buffer initialization in custom models (#49880) by @Tialo in [#49880]
- Remove legacy benchmark/ and disable automatic benchmark runs (#50040) by @tarekziade in [#50040]
- Remove deprecation cycle for candidate generators (#50034) by @Cyrilvallez in [#50034]
- Fix test pil import leak (#49915) by @guarin in [#49915]
- fix: preserve NumPy integer label dtypes in default data collators (#49900) by @BlazeSR10hawk in [#49900]
- [ESMFold2] Don't build the MSA encoder for checkpoints without one (#49890) by @jimburtoft in [#49890]
- [minimax_m3_vl] Gate the integration tests on total accelerator memory (#50025) by @tarekziade in [#50025]
- Fix: Add kwargs in LFM2.5 conv layers (#50022) by @younesbelkada in [#50022]
- Forward code_revision to every pipeline loader (#49832) by @Rocketknight1 in [#49832]
- [moshi] Skip Moshiko integration tests whose checkpoint is gone (#50017) by @tarekziade in [#50017]
- Keep a capturing group's escapes when reversing a conversion pattern (#49772) by @IlyasMoutawwakil in [#49772]
- perf(ci): skip the lazy blob fetch in
git blameon a partial clone (#50007) by @nrenvo in [#50007] - fix(canary): set layerdrop=0.0 in test tester to prevent flaky test (#50012) by @ydshieh in [#50012]
- add a WA to Dockerfile for XPU (#50008) by @kaixuanliu in [#50008]
- pipelines: defer eager model imports in text_to_audio and token_classification (#50001) by @ydshieh in [#50001]
- [exporters] resolve @register_patch paths lazily to avoid eager model imports (#50000) by @ydshieh in [#50000]
- [Fix] Remove useless kwargs (#49966) by @remi-or in [#49966]
- Fix model's config attr naming (#49898) by @zucchini-nlp in [#49898]
Significant community contributions
The following contributors have made significant changes to the library over the last release:
- @tarekziade
- Fix
_init_weightsgaps in 7 audio models and enabletest_can_init_all_missing_weightsfor them (#49386) - Fix image backend equivalence tests for Pillow 13 (#50105)
- [Janus] Fix processor iterating a string prompt character by character (#50044)
- [timesfm] Fix fp16 overflow on pad_val in _forward_transform (#50021)
- Pin the shared Hub MIC fleet dataset (#49802)
- Remove legacy benchmark/ and disable automatic benchmark runs (#50040)
- [minimax_m3_vl] Gate the integration tests on total accelerator memory (#50025)
- [moshi] Skip Moshiko integration tests whose checkpoint is gone (#50017)
- Fix
- @eustlb
Patch release v5.21.1
Patch release v5.21.1
** Fix rope_scaling setter for configs that assign it during init (#50080 )
We broke remote code loading in vllm, this fixes it sorry everyone!