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(passthrough): log when streaming spend-tracking flush fails to schedule
Cursor Agent3791abf4bbc9
diff --git a/litellm/passthrough/main.py b/litellm/passthrough/main.pyindex 9b669d1c2c8..c4c9aea6f64 100644--- a/litellm/passthrough/main.py+++ b/litellm/passthrough/main.py@@ -21,6 +21,7 @@ import httpxfrom httpx._types import CookieTypes, QueryParamTypes, RequestFilesimport litellm+from litellm._logging import verbose_loggerfrom litellm.litellm_core_utils.get_llm_provider_logic import get_llm_providerfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerfrom litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandler@@ -405,8 +406,13 @@ def _sync_streaming(raw_bytes=raw_bytes,provider_config=provider_config,)- except Exception:- pass+ except Exception as e:+ verbose_logger.exception(+ "Failed to schedule passthrough spend-tracking flush "+ "in _sync_streaming; %d buffered chunks dropped: %s",+ len(raw_bytes),+ e,+ )async def _async_streaming(@@ -450,5 +456,10 @@ async def _async_streaming(provider_config=provider_config,))- except Exception:- pass+ except Exception as e:+ verbose_logger.exception(+ "Failed to schedule passthrough spend-tracking flush "+ "in _async_streaming; %d buffered chunks dropped: %s",+ len(raw_bytes),+ e,+ )