The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix DBSpendUpdateWriter
Ishaan Jaff7995fd7c98bf
diff --git a/litellm/proxy/db/db_spend_update_writer.py b/litellm/proxy/db/db_spend_update_writer.pyindex 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 asyncioimport osimport traceback@@ -12,6 +19,12 @@ from litellm.proxy.utils import PrismaClient, ProxyUpdateSpend, hash_tokenclass 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+ """@staticmethodasync def update_database( # noqa: PLR0915