From 9d575bc2c9c41bddadceb58b437053e4a712c385 Mon Sep 17 00:00:00 2001 From: OpenClaw Assistant Date: Sat, 21 Feb 2026 19:32:06 +0000 Subject: [PATCH] fix: exclude complexity_router from auto_router check The _is_auto_router_deployment() was matching all auto_router/* models, causing complexity_router to fail initialization. Now it explicitly excludes auto_router/complexity_router which has its own handler. --- litellm/router.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/router.py b/litellm/router.py index 5f2e42c3fea..a15e91f5bd0 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -6227,10 +6227,13 @@ class Router: def _is_auto_router_deployment(self, litellm_params: LiteLLM_Params) -> bool: """ - Check if the deployment is an auto-router deployment. + Check if the deployment is an auto-router deployment (semantic router). Returns True if the litellm_params model starts with "auto_router/" + but NOT "auto_router/complexity_router" (which uses complexity routing). """ + if litellm_params.model.startswith("auto_router/complexity_router"): + return False # This is handled by complexity_router if litellm_params.model.startswith("auto_router/"): return True return False