Transformers 5.24: Power-User Guide to the Cache Rename and New Models

Last updated: November 25, 2026

Transformers 5.24, released by Hugging Face on November 21, 2026, renames the past_key_values and cache_params arguments to a single cache argument, adds ten new model architectures including Inkling 2 Mini and Omnilingual ASR, and now requires peft 0.22.0 or later. The 5.24.1 patch on November 24 fixes vLLM compatibility.

Contents

What is new in Transformers 5.24

Hugging Face published Transformers v5.24.0 on GitHub on November 21, 2026, at about 7:28 a.m. ET, and the v5.24.1 patch on November 24 at about 11:13 a.m. ET. PyPI lists 5.24.1 as the current version. This release follows the one covered in our Transformers 5.23 guide, which introduced the unified exporters API. Version 5.24 is mostly about models and one large API cleanup, so it matters most to anyone with custom generation loops, remote-code models or a serving stack built on the library.

Change What it means for you
cache argument Replaces past_key_values and cache_params in forward, generate and every output
Ten new architectures Inkling 2 Mini, Apertus 1.5, WavTokenizer, Dory, HY4-VL, Omnilingual ASR, Lara Mini, SarvamMLA, SarvamMoE, EXAONE
Shared multimodal outputs Multimodal generative models return common output classes
peft>=0.22.0 Required for cache name compatibility
Exporter safety Pickled .pt2 programs now need trust_remote_code=True
5.24.1 patch vLLM and remote-code compatibility, Llama 4 and Dory fixes

New models in 5.24.0

The release notes list these additions:

  • Inkling 2 Mini (Thinking Machines Lab): a text and image model with 24 decoder layers, where layers 6 to 17 run three times. The model documentation shows a loop_num_passes setting (default 3, minimum 1) for the variable-loop research checkpoint, so you can trade speed for quality. Our Inkling 2 Mini guide covers the model itself.
  • Omnilingual ASR (Meta FAIR): speech recognition for more than 1,600 languages in 300M, 1B, 3B and 7B sizes, with a CTC head or a Llama-decoder head. The documentation shows an optional language hint passed to apply_transcription_request.
  • SarvamMLA and SarvamMoE: the architectures of Sarvam-105B and Sarvam-30B. SarvamMLA supports contexts up to 131K tokens, according to the notes. See our Sarvam-105B guide.
  • HY4-VL: Hunyuan V4 vision-language with image and video input, related to the models in our Hy4 open weights guide.
  • Apertus 1.5, WavTokenizer, Dory, Lara Mini and EXAONE: Apertus 1.5 reads text, images and audio but outputs text only; Dory is a looped NVIDIA model whose loop count can change at inference time; Lara Mini weights are non-commercial (CC BY-NC-SA 4.0) and gated; EXAONE checkpoints no longer need trust_remote_code=True.

The cache rename: past_key_values becomes cache

Attention models called their cache past_key_values, while Mamba-style and linear-attention models called it cache_params. Hybrid models had to handle both. In 5.24 the single name cache is used in model forward signatures, generate, prepare_inputs_for_generation, the masking utilities and every ModelOutput. The KV cache documentation already shows the new form, for example model.generate(**inputs, cache=cache) with a DynamicCache.

The change is backward compatible for now. Old names are converted with a one-time deprecation warning, outputs.past_key_values still returns the cache, and output classes can still be built with the old field names. Model forward accepts the old names until v5.40.0 and generate until v6.0.0. Passing an old name together with cache raises a ValueError. Custom Cache subclasses that override update should accept the new kwargs argument.

Other breaking changes

  • Multimodal outputs. Generative multimodal models now return shared classes such as MultimodalCausalLMOutputWithPast. Code that checks for a model-specific output class needs updating.
  • Mask utilities removed. modeling_attn_mask_utils.py was removed in 5.24.0; remote-code models should import from transformers.masking_utils. The 5.24.1 patch restored the file as a one-off to unblock vLLM.
  • LayoutLMv3. It now uses the attention interface, so SDPA and flex attention work.
  • Exporters. ONNX, OpenVINO and ExecuTorch programs load without trust_remote_code, but pickled .pt2 programs, which can run arbitrary code, now require it.

How to upgrade safely

The installation guide says Transformers is tested on Python 3.11+ and PyTorch 2.6+. These steps apply the 5.24 notes:

  1. Use a virtual environment. Create or activate one so the upgrade does not affect other projects.
  2. Upgrade. Run pip install -U "transformers[torch]" and, if you use adapters, pip install -U "peft>=0.22.0".
  3. Check the version. Run python -c "import transformers; print(transformers.__version__)" and confirm it prints 5.24.1.
  4. Find deprecation warnings. Run your test suite and look for the one-time cache warning to locate old argument names.
  5. Rename arguments. Replace past_key_values= and cache_params= with cache=, and outputs.past_key_values with outputs.cache.
  6. Check custom code. Move imports to transformers.masking_utils and replace model-specific multimodal output checks with the shared classes.

What 5.24.1 fixes

According to the 5.24.1 notes, the patch fixes backward compatibility of the cache rename for remote code, restores modeling_attn_mask_utils, exposes past_key_values in MBartDecoderLayer.forward, fixes a Llama 4 crash on missing image outputs and the Dory static cache, allows expert parallelism alone with tp_plan={}, and fixes strided checkpoint reads on PyTorch 2.9. If you serve models with vLLM, our vLLM 0.33 guide covers that engine.

Other 5.24 fixes cover sampled beam search, TextStreamer spacing for Chinese, Japanese and Korean text, static cache in assisted decoding, continuous batching under torch.inference_mode(), and transformers serve listing loaded models at /v1/models.

Transformers 5.24 vs. 5.23

Area Transformers 5.23 (Nov. 13) Transformers 5.24 (Nov. 21, patch Nov. 24)
Headline feature Unified exporters API Single cache argument name
New models Inkling2, JEV, LFM3, LFM3-VL, Dots 3 Note Preview, IQuestCoder, InternLM3 Inkling 2 Mini, Omnilingual ASR, Sarvam, HY4-VL, Apertus 1.5 and five more
Exporters New export, share and run workflow .pt2 pickles need trust_remote_code
Dependencies No new minimum peft version listed peft>=0.22.0 required

The 5.23 column is based on the v5.23.0 release notes. For hosted inference instead of local runs, see our Hugging Face OpenRouter routing guide.

Limitations. The rename is a deprecation, not a removal, so warnings will appear until code is updated. Remote-code models on the Hub may lag behind. Model weights keep their own licenses, and the release notes do not give benchmarks or hardware requirements for the new models.

Frequently asked questions

What is the latest version of Hugging Face Transformers?

As of November 25, 2026, the latest release on PyPI is Transformers 5.24.1, a patch published on November 24. It follows Transformers 5.24.0, which came out on November 21 with new models and the cache argument rename.

Does Transformers 5.24 break my code that uses past_key_values?

Not yet. The old past_key_values and cache_params names are renamed to cache automatically with a one-time deprecation warning. Model forward accepts the old names until v5.40.0 and generate until v6.0.0. Passing an old name and cache together raises a ValueError.

Which new models does Transformers 5.24 support?

Version 5.24.0 adds Inkling 2 Mini, Apertus 1.5, WavTokenizer, Dory, HY4-VL, Omnilingual ASR, Lara Mini, SarvamMLA for Sarvam-105B, SarvamMoE for Sarvam-30B and EXAONE. Ling 3.1 Flash now loads natively through BailingHybrid.

What does the Transformers 5.24.1 patch fix?

Transformers 5.24.1 restores compatibility pieces that vLLM and remote-code models need, including modeling_attn_mask_utils. It also fixes a Llama 4 forward crash, the Dory static cache, expert parallelism with an empty tp_plan and strided checkpoint reads on PyTorch 2.9.

How much does Transformers cost?

Transformers is a free, open-source Python library. PyPI lists it under the Apache 2.0 license. Costs come only from the hardware or cloud service you run models on, and some model weights, such as Lara Mini, carry their own license terms.

Sources

Featured image: Hugging Face logo, public domain, via Wikimedia Commons. Hugging Face is a trademark of Hugging Face, Inc. FreeAnswers is not affiliated with Hugging Face.

Related answers

Leave a Comment