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): import retry helpers inside their functions to break CodeQL import cycles
yassin10be7e01d4ac
diff --git a/litellm/router.py b/litellm/router.pyindex a46ffa83b05..31ea81e35be 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -241,7 +241,6 @@ from litellm.types.router import (ModelGroupInfo,OptionalPreCallChecks,PreRoutingStrategy,- RetryAttemptRecord,RetryPolicy,RouterCacheEnum,RouterErrors,@@ -8362,6 +8361,8 @@ class Router:"""When a retry or fallback happens, record which model group, deployment and attempt just failed and why"""+ from litellm.types.router import RetryAttemptRecord+_metadata_var: Final = "litellm_metadata" if "litellm_metadata" in kwargs else "metadata"request_metadata: Final[Mapping[str, object]] = kwargs[_metadata_var]model_group: Final = kwargs.get("model")diff --git a/litellm/utils.py b/litellm/utils.pyindex a0e910a1616..cc1c52d1c78 100644--- a/litellm/utils.py+++ b/litellm/utils.py@@ -81,7 +81,7 @@ from litellm.constants import (PROVIDERS_THAT_AUTHENTICATE_ON_PROVIDER_INFO,TOOL_CHOICE_OBJECT_TOKEN_COUNT,)-from litellm.litellm_core_utils.core_helpers import max_retries_per_request_hit, normalize_drop_params+from litellm.litellm_core_utils.core_helpers import normalize_drop_paramsfrom litellm.litellm_core_utils.fallback_generalizations import (match_capability_generalizations,)@@ -1500,6 +1500,8 @@ def post_call_processing(def client(original_function):+ from litellm.litellm_core_utils.core_helpers import max_retries_per_request_hit+Rules: Final = litellm_utils.Rulesrules_obj: Final = Rules()