mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix(proxy_server.py): fix track cost callback
This commit is contained in:
parent
80e3798a15
commit
f5f12d204e
1 changed files with 10 additions and 6 deletions
|
@ -1094,12 +1094,16 @@ async def update_database(
|
|||
|
||||
## CHECK IF USER PROJECTED SPEND > SOFT LIMIT
|
||||
soft_budget_cooldown = existing_spend_obj.soft_budget_cooldown
|
||||
if existing_spend_obj.soft_budget_cooldown == False and (
|
||||
if (
|
||||
existing_spend_obj.soft_budget_cooldown == False
|
||||
and existing_spend_obj.litellm_budget_table is not None
|
||||
and (
|
||||
_is_projected_spend_over_limit(
|
||||
current_spend=new_spend,
|
||||
soft_budget_limit=existing_spend_obj.litellm_budget_table.soft_budget,
|
||||
)
|
||||
== True
|
||||
)
|
||||
):
|
||||
key_alias = existing_spend_obj.key_alias
|
||||
projected_spend, projected_exceeded_date = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue