[Model] Add VaultGemma via Transformers modeling backend (#49803)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

Harry Mellor committed Jul 25, 2026 at 17:54 UTC 26d725c334429dd86b3d1a9271fbb5e16e03c9ef
6 files changed +8 -17
docs/models/supported_models.md
+1
@@ -464,6 +464,7 @@ Some models are supported only via the [Transformers modeling backend](#transfor
464 | `Olmo2ForCausalLM` | OLMo2 | `allenai/OLMo-2-0425-1B`, etc. | ✅︎ | ✅︎ |
465 | `SmolLM3ForCausalLM` | SmolLM3 | `HuggingFaceTB/SmolLM3-3B` | ✅︎ | ✅︎ |
466 | `Starcoder2ForCausalLM` | Starcoder2 | `bigcode/starcoder2-3b`, `bigcode/starcoder2-7b`, `bigcode/starcoder2-15b`, etc. | ✅︎ | ✅︎ |
467 +| `VaultGemmaForCausalLM` | VaultGemma | `google/vaultgemma-1b` | ✅︎ | ✅︎ |
468
469 !!! note
470 Currently, the ROCm version of vLLM supports Mistral and Mixtral only for context lengths up to 4096.
tests/models/registry.py
+1
@@ -557,6 +557,7 @@ _TEXT_GENERATION_EXAMPLE_MODELS = {
557 "TeleFLMForCausalLM": _HfExamplesInfo(
558 "CofeAI/FLM-2-52B-Instruct-2407", trust_remote_code=True
559 ),
560 + "VaultGemmaForCausalLM": _HfExamplesInfo("google/vaultgemma-1b"),
561 "Zamba2ForCausalLM": _HfExamplesInfo("Zyphra/Zamba2-7B-instruct"),
562 "MiMoForCausalLM": _HfExamplesInfo("XiaomiMiMo/MiMo-7B-RL", trust_remote_code=True),
563 "MiMoV2FlashForCausalLM": _HfExamplesInfo(
vllm/engine/arg_utils.py
+3 -5
@@ -102,10 +102,7 @@ from vllm.logger import init_logger, suppress_logging
102 from vllm.platforms import CpuArchEnum, current_platform
103 from vllm.plugins import load_general_plugins
104 from vllm.ray.lazy_utils import is_in_ray_actor, is_ray_initialized
105 -from vllm.transformers_utils.config import (
106 - is_interleaved,
107 - maybe_override_with_speculators,
108 -)
105 +from vllm.transformers_utils.config import maybe_override_with_speculators
106 from vllm.transformers_utils.repo_utils import get_model_path
107 from vllm.transformers_utils.utils import is_cloud_storage
108 from vllm.utils.argparse_utils import (
@@ -1908,7 +1905,8 @@ class EngineArgs:
1905 self._set_default_chunked_prefill_and_prefix_caching_args(model_config)
1906 self._set_default_reasoning_config_args()
1907 sliding_window: int | None = None
1911 - if not is_interleaved(model_config.hf_text_config):
1908 + layer_types = getattr(model_config.hf_text_config, "layer_types", None)
1909 + if layer_types is None or all(lt == "sliding_attention" for lt in layer_types):
1910 # Only set CacheConfig.sliding_window if the model is all sliding
1911 # window. Otherwise CacheConfig.sliding_window will override the
1912 # global layers in interleaved sliding window models.
vllm/model_executor/models/qwen2.py
+2 -2
@@ -55,7 +55,7 @@ from vllm.model_executor.layers.vocab_parallel_embedding import (
55 VocabParallelEmbedding,
56 )
57 from vllm.sequence import IntermediateTensors
58 -from vllm.transformers_utils.config import is_interleaved, set_default_rope_theta
58 +from vllm.transformers_utils.config import set_default_rope_theta
59 from vllm.v1.attention.backend import AttentionType
60
61 from .interfaces import (
@@ -345,7 +345,7 @@ class Qwen2Model(nn.Module, EagleModelMixin):
345 quant_config = vllm_config.quant_config
346
347 # TODO (@robertgshaw2): see if this can be moved out
348 - if is_interleaved(vllm_config.model_config.hf_text_config):
348 + if len(set(getattr(config, "layer_types", []))) > 1:
349 assert config.max_window_layers == config.num_hidden_layers, (
350 "Sliding window for some but all layers is not supported. "
351 "This model uses sliding window but `max_window_layers` = {} "
vllm/model_executor/models/registry.py
+1
@@ -659,6 +659,7 @@ _TRANSFORMERS_SUPPORTED_MODELS = {
659 "Olmo2ForCausalLM": ("transformers", "TransformersForCausalLM"),
660 "SmolLM3ForCausalLM": ("transformers", "TransformersForCausalLM"),
661 "Starcoder2ForCausalLM": ("transformers", "TransformersForCausalLM"),
662 + "VaultGemmaForCausalLM": ("transformers", "TransformersForCausalLM"),
663 # Multimodal models
664 "Emu3ForConditionalGeneration": (
665 "transformers",
vllm/transformers_utils/config.py
-10
@@ -600,16 +600,6 @@ def is_encoder_decoder(config: PretrainedConfig) -> bool:
600 return _is_encoder_decoder(config) or _is_encoder_decoder(config.get_text_config())
601
602
603 -def is_interleaved(config: PretrainedConfig) -> bool:
604 - """
605 - Detect if the model with this config is used with interleaved attention.
606 - """
607 - text_config = config.get_text_config()
608 - if layer_types := getattr(text_config, "layer_types", None):
609 - return len(set(layer_types)) > 1
610 - return False
611 -
612 -
603 def _maybe_update_auto_config_kwargs(kwargs: dict[str, Any], model_type: str):
604 """
605 Update kwargs for AutoConfig initialization based on model_type