From f04eeccead85036ba9086fed632457ec952f2e8b Mon Sep 17 00:00:00 2001 From: michaelxer Date: Mon, 8 Jun 2026 23:58:02 +0700 Subject: [PATCH] fix: log warning on ImportError in zero-cost model check The ImportError was silently swallowed, making it hard to diagnose when the zero-cost exemption couldn't run. Add a warning log so operators can see when the check is skipped. --- litellm/proxy/hooks/max_budget_limiter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/hooks/max_budget_limiter.py b/litellm/proxy/hooks/max_budget_limiter.py index bf53edd1faf..817a039294d 100644 --- a/litellm/proxy/hooks/max_budget_limiter.py +++ b/litellm/proxy/hooks/max_budget_limiter.py @@ -94,7 +94,10 @@ class _PROXY_MaxBudgetLimiter(CustomLogger): ) return except ImportError: - pass + verbose_proxy_logger.warning( + "MaxBudgetLimiter: ImportError when checking zero-cost model; " + "skipping exemption and enforcing budget limit." + ) raise ProxyRateLimitError( detail="Max budget limit reached.",