mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
(fix) _update_team_db
This commit is contained in:
parent
985409aefb
commit
3ca856fe39
1 changed files with 5 additions and 0 deletions
|
@ -1247,6 +1247,11 @@ async def update_database(
|
|||
# Calculate the new cost by adding the existing cost and response_cost
|
||||
new_spend = existing_spend + response_cost
|
||||
|
||||
if existing_spend_obj is None:
|
||||
spend_per_model = {}
|
||||
else:
|
||||
spend_per_model = existing_spend_obj.model_spend or {}
|
||||
|
||||
# track cost per model, for the given team
|
||||
spend_per_model = existing_spend_obj.model_spend or {}
|
||||
current_model = kwargs.get("model")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue