Skip to content

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]

fix(proxy): resolve pass-through log dispatch lazily so instance patches still apply

yassin82ead979616b
diff --git a/litellm/proxy/pass_through_endpoints/success_handler.py b/litellm/proxy/pass_through_endpoints/success_handler.py
index 59d853a3df8..7141bf1d156 100644
--- a/litellm/proxy/pass_through_endpoints/success_handler.py
+++ b/litellm/proxy/pass_through_endpoints/success_handler.py
@@ -61,7 +61,7 @@ class PassThroughEndpointLogging:
self.transcribe_passthrough_logging_handler: Final = (
transcribe_handler if transcribe_handler is not None else TranscribePassthroughLoggingHandler()
)
- self._log_dispatch: Final = log_dispatch if log_dispatch is not None else self._handle_logging
+ self._injected_log_dispatch: Final = log_dispatch
self.TRACKED_VERTEX_METHOD_ROUTES = (
"generateContent",
"streamGenerateContent",
@@ -103,6 +103,10 @@ class PassThroughEndpointLogging:
# Vertex AI Live API WebSocket
self.TRACKED_VERTEX_AI_LIVE_ROUTES = ["/vertex_ai/live"]
+ @property
+ def _log_dispatch(self) -> PassThroughLogDispatch:
+ return self._injected_log_dispatch if self._injected_log_dispatch is not None else self._handle_logging
+
async def _handle_logging(
self,
logging_obj: LiteLLMLoggingObj,