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
fix(router): freeze retained forecast fields for lint
Tin Chi Lo7980a8f65fec
diff --git a/litellm/router_strategy/complexity_router/complexity_router.py b/litellm/router_strategy/complexity_router/complexity_router.pyindex f1ce00317d3..58ce61ba7aa 100644--- a/litellm/router_strategy/complexity_router/complexity_router.py+++ b/litellm/router_strategy/complexity_router/complexity_router.py@@ -1841,11 +1841,13 @@ class ComplexityRouter(CustomLogger):decision["tier_litellm_params"] = masked_tier_litellm_paramsif previous_decision is None:return decision- forecast_fields: Final = {- field: value- for field, value in previous_decision.items()- if field.startswith("classifier_") or field == "heuristic_v2_forecast"- }+ forecast_fields: Final = MappingProxyType(+ {+ field: value+ for field, value in previous_decision.items()+ if field.startswith("classifier_") or field == "heuristic_v2_forecast"+ }+ )return cast( # cast-ok: retaining optional keys from a typed decision preserves their declared valuesStandardLoggingRoutingDecision, {**forecast_fields, **decision})