You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
litellm.completion() seems to output only 1 token from Gemini when stream=True is provided. Other models work fine. Non-streaming works fine with Gemini.
Relevant log output
import litellm
model = "gemini/gemini-1.5-pro"
messages=[{"role": "user", "content": "What model are you"}]
comp = litellm.completion(model=model, messages=messages, stream=True)
print(comp)
forchunkin comp:
print(chunk)
# Outputs only 1 token worth of output:<litellm.utils.CustomStreamWrapper object at 0x1090b4690>
ModelResponse(id='chatcmpl-6d4c29f3-66c0-4155-a065-1f17c2ad7f34', choices=[StreamingChoices(finish_reason=None, index=0, delta=Delta(content='I', role='assistant', function_call=None, tool_calls=None), logprobs=None)], created=1719346052, model='gemini-1.5-pro', object='chat.completion.chunk', system_fingerprint=None)
ModelResponse(id='chatcmpl-6d4c29f3-66c0-4155-a065-1f17c2ad7f34', choices=[StreamingChoices(finish_reason='stop', index=0, delta=Delta(content=None, role=None, function_call=None, tool_calls=None), logprobs=None)], created=1719346054, model='gemini-1.5-pro', object='chat.completion.chunk', system_fingerprint=None)
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered:
What happened?
litellm.completion() seems to output only 1 token from Gemini when
stream=True
is provided. Other models work fine. Non-streaming works fine with Gemini.Relevant log output
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: