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]

stream response (#5516)

Stefan Bokarev258b96211cd6
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py
index 537ca15a477..87c11f1fd3f 100644
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@ -868,6 +868,15 @@ class Logging:
model = self.model
messages = self.model_call_details["input"]
kwargs = self.model_call_details
+
+ # this only logs streaming once, complete_streaming_response exists i.e when stream ends
+ if self.stream:
+ if "complete_streaming_response" not in kwargs:
+ continue
+ else:
+ print_verbose("reaches helicone for streaming logging!")
+ result = kwargs["complete_streaming_response"]
+
heliconeLogger.log_success(
model=model,
messages=messages,