From 7995fd7c98bf6fe3a058edfb60c64b05fc330622 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 27 Mar 2025 16:44:46 -0700 Subject: [PATCH] fix DBSpendUpdateWriter --- litellm/proxy/db/db_spend_update_writer.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/litellm/proxy/db/db_spend_update_writer.py b/litellm/proxy/db/db_spend_update_writer.py index af1d3294c50..ecafdcc3dff 100644 --- a/litellm/proxy/db/db_spend_update_writer.py +++ b/litellm/proxy/db/db_spend_update_writer.py @@ -1,3 +1,10 @@ +""" +Module responsible for + +1. Writing spend increments to either in memory list of transactions or to redis +2. Reading increments from redis or in memory list of transactions and committing them to db +""" + import asyncio import os import traceback @@ -12,6 +19,12 @@ from litellm.proxy.utils import PrismaClient, ProxyUpdateSpend, hash_token class DBSpendUpdateWriter: + """ + Module responsible for + + 1. Writing spend increments to either in memory list of transactions or to redis + 2. Reading increments from redis or in memory list of transactions and committing them to db + """ @staticmethod async def update_database( # noqa: PLR0915