melodic-hamburger-67426
08/05/2025, 5:09 AMtall-airline-16756
08/05/2025, 5:09 AMtall-airline-16756
08/05/2025, 5:09 AMmelodic-hamburger-67426
08/05/2025, 5:13 AMtall-airline-16756
08/05/2025, 5:15 AMmelodic-hamburger-67426
08/05/2025, 5:17 AMtts=deepgram.TTS(
model="aura-2-andromeda-en",
api_key= '3489f8e1b657714fb31c5cc8b2a1ae1075c90723',
encoding= 'linear16',
sample_rate= 24000,
),
This is the code i am usingtall-airline-16756
08/05/2025, 5:17 AMfrom livekit.plugins import deepgram
# Initialize Deepgram TTS with connection pooling
tts = deepgram.TTS(
model="aura-2-andromeda-en",
api_key="YOUR_DEEPGRAM_API_KEY",
)
# Connection pooling is handled internally
tts._pool = utils.ConnectionPool[aiohttp.ClientWebSocketResponse](
connect_cb=tts._connect_ws,
close_cb=tts._close_ws,
max_session_duration=3600,
mark_refreshed_on_get=False,
)
# Prewarm connections
tts.prewarm()
This way, your connections get reused smoothly, which helps a lot. Also, keep an eye on your request patterns and consider adding retry logic with back-off to gracefully handle those rate limits. If you want, I’m here to help you through it—just let me know!
Sources: livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.pymelodic-hamburger-67426
08/06/2025, 2:09 PM