mirror of https://github.com/aliasrobotics/cai.git
Fix duplicate API calls causing hang with Anthropic streaming
Remove duplicate litellm.acompletion() calls that were causing every streaming request to make two identical API calls, with the first result being discarded. This doubled latency and caused apparent hanging behavior, especially noticeable with Anthropic API.
This commit is contained in:
parent
e38ac2b031
commit
df882783ca
|
|
@ -3305,7 +3305,6 @@ class OpenAIChatCompletionsModel(Model):
|
|||
try:
|
||||
if stream:
|
||||
# Standard LiteLLM handling for streaming
|
||||
ret = await litellm.acompletion(**kwargs)
|
||||
stream_obj = await litellm.acompletion(**kwargs)
|
||||
|
||||
response = Response(
|
||||
|
|
@ -3359,7 +3358,6 @@ class OpenAIChatCompletionsModel(Model):
|
|||
kwargs["messages"] = messages
|
||||
# Retry once, silently
|
||||
if stream:
|
||||
ret = await litellm.acompletion(**kwargs)
|
||||
stream_obj = await litellm.acompletion(**kwargs)
|
||||
response = Response(
|
||||
id=FAKE_RESPONSES_ID,
|
||||
|
|
|
|||
Loading…
Reference in New Issue