Merge pull request #1618 from BerriAI/litellm_sagemaker_cost_tracking_fixes

fix(utils.py): fix sagemaker cost tracking for streaming
This commit is contained in:
Krish Dholakia 2024-01-25 19:01:57 -08:00 committed by GitHub
commit 612f74a426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 282 additions and 79 deletions

View file

@ -718,6 +718,9 @@ async def update_database(
existing_spend_obj = await custom_db_client.get_data(
key=id, table_name="user"
)
verbose_proxy_logger.debug(
f"Updating existing_spend_obj: {existing_spend_obj}"
)
if existing_spend_obj is None:
existing_spend = 0
existing_spend_obj = LiteLLM_UserTable(