mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(fix) if litellm-proxy-budget set use it
This commit is contained in:
parent
3d890ff396
commit
51d658e878
1 changed files with 7 additions and 1 deletions
|
@ -4608,7 +4608,13 @@ async def global_spend():
|
|||
if user_response is not None:
|
||||
if isinstance(user_response, list) and len(user_response) > 0:
|
||||
total_proxy_budget = user_response[0].get("max_budget", 0.0)
|
||||
|
||||
litellm_proxy_budget_spend = user_response[0].get("spend", None)
|
||||
if (
|
||||
litellm_proxy_budget_spend is not None
|
||||
and litellm_proxy_budget_spend > 0.0
|
||||
):
|
||||
# if the user has spend on litellm-proxy-budget, use that to show $spend/max budget
|
||||
total_spend = litellm_proxy_budget_spend
|
||||
return {"spend": total_spend, "max_budget": total_proxy_budget}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue