From 7ba3430365f7f1b9177b326f3e92d88928aedcd7 Mon Sep 17 00:00:00 2001 From: YC Yen-Ching Tseng Date: Thu, 20 Aug 2026 08:56:51 +0200 Subject: [PATCH] Fix Grok-2 nightly: derive image-understanding capability from is_multimodal (#33730) --- python/sglang/srt/configs/model_config.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index 1afb405c2..2d8def57d 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -460,13 +460,17 @@ class ModelConfig: self.is_audio_model = enable_multimodal and is_audio_model( self.hf_config.architectures ) - # TODO: requires further polishing + # Gated on `is_multimodal` because this flag is advertised via /model_info + # and drives the VLM warmup request, while the OpenAI serving layer rejects + # media input for models that are not `is_multimodal`. A text-only model + # with an auto-populated `vision_config` (see above) would otherwise warm up + # with an image request that its own serving layer answers with 400. # Key on the tower, not the attribute: several config classes default # vision_config to None, which presence alone would read as image-capable # (MuseGlimmerConfig's text-only layouts are one such case). + # TODO: requires further polishing self.is_image_understandable_model = ( - enable_multimodal - and not self.is_lm_only + self.is_multimodal and getattr(self.hf_config, "vision_config", None) is not None )