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
refactor(spend_tracking): type the get_logging_payload parameters
yassine06c81665f2d
diff --git a/litellm/proxy/db/db_spend_update_writer.py b/litellm/proxy/db/db_spend_update_writer.pyindex 357d69d1371..c13b852484e 100644--- a/litellm/proxy/db/db_spend_update_writer.py+++ b/litellm/proxy/db/db_spend_update_writer.py@@ -257,8 +257,8 @@ class DBSpendUpdateWriter:# Completion object fieldskwargs: dict | None,completion_response: object,- start_time: datetime | None,- end_time: datetime | None,+ start_time: datetime,+ end_time: datetime,response_cost: float | None,) -> bool:"""Record the request's spend, answering whether its cost still needs charging.diff --git a/litellm/proxy/spend_tracking/spend_tracking_utils.py b/litellm/proxy/spend_tracking/spend_tracking_utils.pyindex df8e18c3c56..52900c33745 100644--- a/litellm/proxy/spend_tracking/spend_tracking_utils.py+++ b/litellm/proxy/spend_tracking/spend_tracking_utils.py@@ -378,7 +378,11 @@ def _looks_like_model_name(model: str) -> bool:def get_logging_payload(- kwargs, response_obj, start_time, end_time, llm_router: "Router | None" = None+ kwargs: dict | None,+ response_obj: object,+ start_time: datetime,+ end_time: datetime,+ llm_router: "Router | None" = None,) -> SpendLogsPayload:if kwargs is None:kwargs = {}