vllm - 💡(How to fix) Fix Gemma 4 support: model_type `gemma4` not recognized [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#38868Fetched 2026-04-08 02:34:28
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1subscribed ×1

Google released the Gemma 4 model family (gemma-4-E2B-it, gemma-4-E4B-it) which introduces a new model_type: gemma4. This model type was added in transformers >= 5.5.0, but vLLM currently ships with an older version.

Error Message

The checkpoint you are trying to load has model type `gemma4` but Transformers does not recognize this architecture.

Root Cause

Google released the Gemma 4 model family (gemma-4-E2B-it, gemma-4-E4B-it) which introduces a new model_type: gemma4. This model type was added in transformers >= 5.5.0, but vLLM currently ships with an older version.

Code Example

The checkpoint you are trying to load has model type `gemma4` but Transformers does not recognize this architecture.

---

vllm serve 2imi9/gemma-4-E2B-it-NVFP4A16
RAW_BUFFERClick to expand / collapse

Summary

Google released the Gemma 4 model family (gemma-4-E2B-it, gemma-4-E4B-it) which introduces a new model_type: gemma4. This model type was added in transformers >= 5.5.0, but vLLM currently ships with an older version.

Error

The checkpoint you are trying to load has model type `gemma4` but Transformers does not recognize this architecture.

Steps to reproduce

vllm serve 2imi9/gemma-4-E2B-it-NVFP4A16

Or with any Gemma 4 model (e.g. google/gemma-4-E2B-it, google/gemma-4-E4B-it).

Key details

  • Gemma 4 is a multimodal model (vision + audio + text) using AutoModelForImageTextToText
  • Architecture includes vision_tower, audio_tower, embed_vision, embed_audio modules
  • Requires transformers >= 5.5.0 for gemma4 model type registration

Related

  • vllm-project/llm-compressor#2562 — same transformers version issue in llm-compressor
  • vllm-project/llm-compressor#2561 — Gemma 4 NVFP4A16 quantization example

extent analysis

TL;DR

Upgrade the transformers library to version 5.5.0 or later to support the gemma4 model type.

Guidance

  • Verify the current version of transformers installed in the project using pip show transformers or conda list transformers.
  • Check the compatibility of the gemma4 model with the current version of transformers and consider upgrading if necessary.
  • Review the related issues (vllm-project/llm-compressor#2562 and vllm-project/llm-compressor#2561) for additional context and potential workarounds.
  • Test the model with the updated transformers version to ensure compatibility and resolve the error.

Example

No code snippet is provided as it is not explicitly supported by the issue, but the command to upgrade transformers using pip would be: pip install --upgrade transformers

Notes

The solution assumes that the issue is solely due to the version of transformers being older than 5.5.0. If other factors are contributing to the error, additional troubleshooting may be necessary.

Recommendation

Upgrade to a version of transformers that supports the gemma4 model type (i.e., 5.5.0 or later), as this is the most direct solution to the error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix Gemma 4 support: model_type `gemma4` not recognized [1 participants]