Skip to content

Commit 6a9ebe8

Browse files
committed
Don't submit a task to a thread if streaming logging is disabled
1 parent 7216983 commit 6a9ebe8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

litellm/litellm_core_utils/streaming_handler.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,11 +1619,12 @@ def __next__(self): # noqa: PLR0915
16191619
completion_start_time=datetime.datetime.now()
16201620
)
16211621
## LOGGING
1622-
executor.submit(
1623-
self.run_success_logging_and_cache_storage,
1624-
response,
1625-
cache_hit,
1626-
) # log response
1622+
if not litellm.disable_streaming_logging:
1623+
executor.submit(
1624+
self.run_success_logging_and_cache_storage,
1625+
response,
1626+
cache_hit,
1627+
) # log response
16271628
choice = response.choices[0]
16281629
if isinstance(choice, StreamingChoices):
16291630
self.response_uptil_now += choice.delta.get("content", "") or ""

0 commit comments

Comments
 (0)