(feat) provider budget routing improvements (#6827)

* minor fix for provider budget

* fix raise good error message when budget crossed for provider budget

* fix test provider budgets

* test provider budgets

* feat - emit llm provider spend on prometheus

* test_prometheus_metric_tracking

* doc provider budgets
This commit is contained in:
Ishaan Jaff 2024-11-19 21:25:08 -08:00 committed by GitHub
parent ce6465c9df
commit 64b46e32cf
7 changed files with 261 additions and 20 deletions

View file

@ -88,6 +88,9 @@ def _get_prometheus_logger_from_callbacks() -> Optional[PrometheusLogger]:
"""
from litellm.integrations.prometheus import PrometheusLogger
for _callback in litellm._async_success_callback:
if isinstance(_callback, PrometheusLogger):
return _callback
for _callback in litellm.callbacks:
if isinstance(_callback, PrometheusLogger):
return _callback