vllm-project/vllm · error · ValueError

The model is not multimodal.

Error message

The model is not multimodal.

What it means

get_multimodal_config() returns the MultiModalConfig only for multimodal models; it raises ValueError('The model is not multimodal.') when the config's multimodal_config is None. The docstring marks this as the expected failure mode for text-only models.

Source

Thrown at vllm/config/model.py:1630

            # used by e.g. Mamba2, NemotronH, Zamba
            chunk_size = getattr(self.hf_text_config, "chunk_size", None)

        # Since Mamba1 does not have a chunk notion
        # we use a default chunk size of 2048.
        if chunk_size is None:
            chunk_size = 2048

        return chunk_size

    def get_multimodal_config(self) -> MultiModalConfig:
        """
        Get the multimodal configuration of the model.

        Raises:
            ValueError: If the model is not multimodal.
        """
        if self.multimodal_config is None:
            raise ValueError("The model is not multimodal.")

        return self.multimodal_config

    def try_get_generation_config(self) -> dict[str, Any]:
        """
        This method attempts to retrieve the non-default values of the
        generation config for this model.

        The generation config can contain information about special tokens, as
        well as sampling parameters. Which is why this method exists separately
        to `get_diff_sampling_param`.

        Returns:
            A dictionary containing the non-default generation config.
        """
        if self.generation_config in {"auto", "vllm"}:
            config = try_get_generation_config(
                self.hf_config_path or self.model,

View on GitHub (pinned to c794754062)

Solutions

  1. Guard the call: check config.multimodal_config is not None (or use is_multimodal_model / the model type) before calling get_multimodal_config().
  2. Use the correct multimodal checkpoint (e.g. a -VL / -Vision variant) if MM processing was intended.

Example fix

# before
mm_cfg = model_config.get_multimodal_config()
# after
if model_config.multimodal_config is not None:
    mm_cfg = model_config.get_multimodal_config()
else:
    mm_cfg = None
Defensive patterns

Strategy: type-guard

Validate before calling

mm_cfg = (model_config.get_multimodal_config()
          if model_config.multimodal_config is not None else None)

Type guard

def is_multimodal(model_config) -> bool:
    return model_config.multimodal_config is not None

Prevention

When it happens

Trigger: Calling ModelConfig.get_multimodal_config() on a text-only LLM (e.g. Llama) — any component assuming multimodality (processor registration, MM profiling) hits this.

Common situations: Writing generic code that unconditionally fetches the MM config for every model; passing a text-only model to a multimodal serving pipeline; forgetting that multimodal_config is Optional on ModelConfig.

Related errors


AI-assisted analysis of vllm-project/vllm@c794754062 (2026-08-14). Data as JSON: /api/errors/674bf97644e95551. Report an issue: GitHub.