diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 8e30444ea..6b8ac5277 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -81,6 +81,10 @@ MIMO_V2_MODEL_ARCHS = ( "MiMoV2ForCausalLM", "MiMoV2FlashForCausalLM", ) +LLAMA4_MODEL_ARCHS = ( + "Llama4ForConditionalGeneration", + "Llama4ForCausalLM", +) SAMPLING_BACKEND_CHOICES = {"flashinfer", "pytorch", "ascend"} @@ -2034,7 +2038,7 @@ class ServerArgs: logger.warning( "Disable hybrid SWA memory for Step3p5ForCausalLM model with hierarchical cache" ) - elif "Llama4" in model_arch and self.device != "cpu": + elif model_arch in LLAMA4_MODEL_ARCHS and self.device != "cpu": # Auto-select attention backend for Llama4 if not specified if self.attention_backend is None: if is_sm100_supported():