-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[Bug]: Stream TTS via proxy by deferring OpenAI streaming context; add verify script #14892
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
base: main
Are you sure you want to change the base?
Conversation
…ing context managers, allowing for efficient byte iteration without buffering.
…g for efficient byte iteration without prematurely closing the upstream stream. This change enhances the async audio speech functionality while maintaining compatibility with existing synchronous behavior.
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…leaner test setup in TTS deferred streaming tests
…ehavior and ensure proper streaming iteration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to test_litellm/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krrishdholakia will do. No idea why builds fail, the tests run for me locally.
Do we need to update the documentation? I don't really think so since, the patch only enables what is already possible using the OpenAI endpoint directly. |
…ction for speech calls and add unit tests for verification
There's still some issues regarding spend logging in the streaming context. Will push a fix. |
Fixes #14891
Summary
aiter_bytes()
consumption and iterate the async iterator correctly. Keep sync speech() unchanged. Add a small script to verify streaming behavior.Changes
aiter_bytes()
openswith_streaming_response.create(...)
and yields chunks.scripts/verify_tts_streaming.py
to validate headers, time-to-first-byte, and bytes received.tests/test_litellm/test_tts_deferred_streaming.py
to minimally validate deferred streaming yields bytes (skipped if async plugin missing).Checklist
Notes