From e6c4e38b0a64ad96da0a5f8c46f8811bbc27935a Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 21 Feb 2026 12:20:31 -0800 Subject: [PATCH] fix(router): remove or {} masking None complexity_router_config --- litellm/router.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 45030d7991d..bf1284011de 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -6303,18 +6303,20 @@ class Router: """ # Import here to match AutoRouter pattern and avoid circular imports # (ComplexityRouter is a CustomLogger subclass that imports litellm internals) - from litellm.router_strategy.complexity_router.complexity_router import ComplexityRouter + from litellm.router_strategy.complexity_router.complexity_router import ( + ComplexityRouter, + ) complexity_router_config: Optional[ dict - ] = deployment.litellm_params.complexity_router_config or {} + ] = deployment.litellm_params.complexity_router_config default_model: Optional[ str ] = deployment.litellm_params.complexity_router_default_model - + # If no default model specified, try to get from config tiers - if default_model is None: + if default_model is None and complexity_router_config: tiers = complexity_router_config.get("tiers", {}) # Use MEDIUM tier as fallback default default_model = tiers.get("MEDIUM") or tiers.get("SIMPLE")