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.
This commit is contained in:
michaelxer 2026-06-08 23:58:02 +07:00
parent 8ac6721641
commit f04eeccead

View file

@ -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.",