mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
(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:
parent
ce6465c9df
commit
64b46e32cf
7 changed files with 261 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue