From cebf45994b6f3b260ae93d4d411e8cda7a732436 Mon Sep 17 00:00:00 2001 From: Xuchun Shang Date: Fri, 22 Aug 2025 17:49:52 +0800 Subject: [PATCH] [bugfix] Make --enable-hierarchical-cache and --disable-radix-cache mutually exclusive (#9452) Signed-off-by: Xuchun Shang --- python/sglang/srt/server_args.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 27de75400..32f0caa38 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -715,6 +715,12 @@ class ServerArgs: "1" if self.disable_outlines_disk_cache else "0" ) + if self.enable_hierarchical_cache and self.disable_radix_cache: + raise ValueError( + "The arguments enable-hierarchical-cache and disable-radix-cache are mutually exclusive " + "and cannot be used at the same time. Please use only one of them." + ) + @staticmethod def add_cli_args(parser: argparse.ArgumentParser): # Model and tokenizer