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
(minor latency fixes / proxy) - use verbose_proxy_logger.debug() instead of litellm.print_verbose (#7664)
Ishaan Jaff6df8faf15f23
diff --git a/litellm/proxy/hooks/cache_control_check.py b/litellm/proxy/hooks/cache_control_check.pyindex 4cf1668c220..6e3fbf84fab 100644--- a/litellm/proxy/hooks/cache_control_check.py+++ b/litellm/proxy/hooks/cache_control_check.py@@ -4,8 +4,8 @@from fastapi import HTTPException-import litellmfrom litellm import verbose_logger+from litellm._logging import verbose_proxy_loggerfrom litellm.caching.caching import DualCachefrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.proxy._types import UserAPIKeyAuth@@ -16,10 +16,6 @@ class _PROXY_CacheControlCheck(CustomLogger):def __init__(self):pass- def print_verbose(self, print_statement):- if litellm.set_verbose is True:- print(print_statement) # noqa-async def async_pre_call_hook(self,user_api_key_dict: UserAPIKeyAuth,@@ -28,7 +24,7 @@ class _PROXY_CacheControlCheck(CustomLogger):call_type: str,):try:- self.print_verbose("Inside Cache Control Check Pre-Call Hook")+ verbose_proxy_logger.debug("Inside Cache Control Check Pre-Call Hook")allowed_cache_controls = user_api_key_dict.allowed_cache_controlsif data.get("cache", None) is None:diff --git a/litellm/proxy/hooks/max_budget_limiter.py b/litellm/proxy/hooks/max_budget_limiter.pyindex 9697efff7b8..4b59f603d3e 100644--- a/litellm/proxy/hooks/max_budget_limiter.py+++ b/litellm/proxy/hooks/max_budget_limiter.py@@ -1,7 +1,7 @@from fastapi import HTTPException-import litellmfrom litellm import verbose_logger+from litellm._logging import verbose_proxy_loggerfrom litellm.caching.caching import DualCachefrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.proxy._types import UserAPIKeyAuth@@ -12,10 +12,6 @@ class _PROXY_MaxBudgetLimiter(CustomLogger):def __init__(self):pass- def print_verbose(self, print_statement):- if litellm.set_verbose is True:- print(print_statement) # noqa-async def async_pre_call_hook(self,user_api_key_dict: UserAPIKeyAuth,@@ -24,7 +20,7 @@ class _PROXY_MaxBudgetLimiter(CustomLogger):call_type: str,):try:- self.print_verbose("Inside Max Budget Limiter Pre-Call Hook")+ verbose_proxy_logger.debug("Inside Max Budget Limiter Pre-Call Hook")cache_key = f"{user_api_key_dict.user_id}_user_api_key_user_id"user_row = await cache.async_get_cache(cache_key, parent_otel_span=user_api_key_dict.parent_otel_spandiff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.pyindex fc68830e872..31ea9c80b73 100644--- a/litellm/proxy/utils.py+++ b/litellm/proxy/utils.py@@ -472,8 +472,8 @@ class ProxyLogging:2. /embeddings3. /image/generation"""- print_verbose("Inside Proxy Logging Pre-call hook!")- ### ALERTING ###+ verbose_proxy_logger.debug("Inside Proxy Logging Pre-call hook!")+ ## ALERTING ###asyncio.create_task(self.slack_alerting_instance.response_taking_too_long(request_data=data))@@ -517,6 +517,8 @@ class ProxyLogging:_callback is not Noneand isinstance(_callback, CustomLogger)and "async_pre_call_hook" in vars(_callback.__class__)+ and _callback.__class__.async_pre_call_hook+ != CustomLogger.async_pre_call_hook):response = await _callback.async_pre_call_hook(user_api_key_dict=user_api_key_dict,