Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Streaming broken for Gemini? #4408

Closed
paul-gauthier opened this issue Jun 25, 2024 · 1 comment
Closed

[Bug]: Streaming broken for Gemini? #4408

paul-gauthier opened this issue Jun 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@paul-gauthier
Copy link
Contributor

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

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)
for chunk in 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

@paul-gauthier paul-gauthier added the bug Something isn't working label Jun 25, 2024
@paul-gauthier
Copy link
Contributor Author

This appears fixed in the latest litellm v1.40.26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant