Which TTS models in Livekit Agents allow streaming...
# ask-ai
b
Which TTS models in Livekit Agents allow streaming response from LLM instead of waiting for full response
t
Thanks for reaching out, Amey. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
PlayAI TTS and ElevenLabs TTS in LiveKit Agents natively support streaming LLM responses, allowing audio to be generated incrementally as the LLM produces output. OpenAI TTS does not support streaming and requires the full response before audio generation begins. For TTS providers that do not natively support streaming, the LiveKit Agents framework automatically wraps them with an adapter that tokenizes the LLM output into sentences and streams audio as each chunk is ready. This means you can achieve streaming-like behavior with most TTS models, even if they don't support it natively. • Native streaming support: PlayAI TTS, ElevenLabs TTS • No native streaming: OpenAI TTS (adapter used for chunked streaming) Other TTS providers may also work with streaming via the adapter system, but PlayAI and ElevenLabs are confirmed to support true native streaming. Sources: livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/tts.p... | plugins/openai/src/models.ts | Text-to-speech (TTS) integrations | LiveKit Docs
b
Which models in eleven labs support streaming? Or is it all models?
t
Hey there! Great news about ElevenLabs TTS models and LiveKit Agents. We've made streaming LLM responses super smooth – it works with every single model, no restrictions. Pretty cool, right? Here are all the awesome models you can use: •
eleven_monolingual_v1
•
eleven_multilingual_v1
•
eleven_multilingual_v2
•
eleven_turbo_v2
•
eleven_turbo_v2_5
•
eleven_flash_v2_5
•
eleven_flash_v2
•
eleven_v3
We're using WebSocket connections to the ElevenLabs API, which means you can generate real-time audio as your LLM works its magic. It's like having a super-smart, instant voice generator right at your fingertips! Sources: livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/model... | plugins/elevenlabs/CHANGELOG.md
b
This is what i’m using tts=elevenlabs.TTS( model=“eleven_multilingual_v2” ), Do i need to add any parameter to explicitly support streaming?
t
Hey there! When you set up
elevenlabs.TTS
with the
model="eleven_multilingual_v2"
, you'll be happy to know that streaming comes built-in by default. No extra steps needed – it's super easy! Here's a quick example to show you how simple it is:
Copy code
from livekit.plugins import elevenlabs

tts = elevenlabs.TTS(model="eleven_multilingual_v2")
stream = tts.stream()  # Streaming is ready to go right out of the box
Pro tip: There's an optional
streaming_latency
parameter you can play with to fine-tune performance, but don't worry – the default setup already has streaming for LLM responses covered. We've got you! Sources: examples/other/text-to-speech/elevenlabs_tts.py | ElevenLabs TTS integration guide | LiveKit Docs
b
I am using it as part of AgentSession, do i need to call .stream()
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!