The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(router): simplify optional forecast retention
Tin Chi Lo1b9fb3467954
diff --git a/litellm/router_strategy/complexity_router/complexity_router.py b/litellm/router_strategy/complexity_router/complexity_router.pyindex c42c5435c6e..f0fef3974f4 100644--- a/litellm/router_strategy/complexity_router/complexity_router.py+++ b/litellm/router_strategy/complexity_router/complexity_router.py@@ -1839,12 +1839,10 @@ class ComplexityRouter(CustomLogger):masked_tier_litellm_params: Final = mask_credentials_in_payload(tier_litellm_params)if isinstance(masked_tier_litellm_params, Mapping):decision["tier_litellm_params"] = masked_tier_litellm_params- if previous_decision is None:- return decisionforecast_fields: Final = MappingProxyType({field: value- for field, value in previous_decision.items()+ for field, value in (previous_decision.items() if previous_decision is not None else ())if field.startswith("classifier_") or field == "heuristic_v2_forecast"})