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
Merge branch 'BerriAI:main' into gemini-adapter-fixes
Henry H Wang7c4439ba0a28
diff --cc litellm/router.pyindex ec1360c3603,9dcdca288fa..9ae87316476--- a/litellm/router.py+++ b/litellm/router.py@@@ -404,14 -404,19 +404,19 @@@ class Routerself.default_max_parallel_requests = default_max_parallel_requestsself.provider_default_deployment_ids: List[str] = []self.pattern_router = PatternMatchRouter()- self.team_pattern_routers: Dict[str, PatternMatchRouter] = (- {}- ) # {"TEAM_ID": PatternMatchRouter}+ self.team_pattern_routers: Dict[+ str, PatternMatchRouter+ ] = {} # {"TEAM_ID": PatternMatchRouter}self.auto_routers: Dict[str, "AutoRouter"] = {}+ # Initialize model_group_alias early since it's used in set_model_list+ self.model_group_alias: Dict[str, Union[str, RouterModelGroupAliasItem]] = (+ model_group_alias or {}+ ) # dict to store aliases for router, ex. {"gpt-4": "gpt-3.5-turbo"}, all requests with gpt-4 -> get routed to gpt-3.5-turbo group+# Initialize model ID to deployment index mapping for O(1) lookupsself.model_id_to_deployment_index_map: Dict[str, int] = {}-+if model_list is not None:# Build model index immediately to enable O(1) lookups from the startself._build_model_id_to_deployment_index_map(model_list)