mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 16:19:29 +00:00
Merge pull request #14816 from leventov/no-streaming-logging
Fix concurrency/scaling when many Python threads do streaming using *sync* completions
This commit is contained in:
@@ -1619,11 +1619,12 @@ class CustomStreamWrapper:
|
||||
completion_start_time=datetime.datetime.now()
|
||||
)
|
||||
## LOGGING
|
||||
executor.submit(
|
||||
self.run_success_logging_and_cache_storage,
|
||||
response,
|
||||
cache_hit,
|
||||
) # log response
|
||||
if not litellm.disable_streaming_logging:
|
||||
executor.submit(
|
||||
self.run_success_logging_and_cache_storage,
|
||||
response,
|
||||
cache_hit,
|
||||
) # log response
|
||||
choice = response.choices[0]
|
||||
if isinstance(choice, StreamingChoices):
|
||||
self.response_uptil_now += choice.delta.get("content", "") or ""
|
||||
|
||||
@@ -935,7 +935,7 @@ class HTTPHandler:
|
||||
if litellm.force_ipv4:
|
||||
return HTTPTransport(local_address="0.0.0.0")
|
||||
else:
|
||||
return None
|
||||
return getattr(litellm, 'sync_transport', None)
|
||||
|
||||
|
||||
def get_async_httpx_client(
|
||||
|
||||
Reference in New Issue
Block a user