From 7bffc5dc25e17887c998e74acf98a72bb67baaa4 Mon Sep 17 00:00:00 2001 From: Neelabh Sinha Date: Sun, 9 Nov 2025 23:42:02 -0800 Subject: [PATCH] [Fix] Add validation for served model name to reserve `:` for LoRA adapter syntax (#12912) Co-authored-by: neelabhsinha --- python/sglang/srt/server_args.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 463a78514..dd5bc924c 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -3678,6 +3678,13 @@ class ServerArgs: None, }, "moe_dense_tp_size only support 1 and None currently" + # Check served model name to not have colon as it is reserved for LoRA adapter syntax + assert ":" not in self.served_model_name, ( + "served_model_name cannot contain a colon (':') character. " + "The colon is reserved for the 'model:adapter' syntax used in LoRA adapter specification. " + f"Invalid value: '{self.served_model_name}'" + ) + # Check LoRA self.check_lora_server_args()