average-knife-77348
10/30/2025, 7:03 AMtall-airline-16756
10/30/2025, 7:03 AMtall-airline-16756
10/30/2025, 7:04 AMaverage-knife-77348
10/30/2025, 7:05 AMtall-airline-16756
10/30/2025, 7:05 AMdeepgram.STT() plugin, which takes care of audio segmentation in 50ms chunks and streams it to Deepgram via WebSocket. This means you don’t have to worry about external VAD for basic transcription—it’s all handled for you!
Here’s a friendly step-by-step to get you started:
1. Install the Plugin: Simply run pip install livekit-plugins-deepgram to add the Deepgram plugin.
2. Authentication: Make sure to set your Deepgram API key in the environment variable DEEPGRAM_API_KEY. This keeps things secure and ready to go.
3. Configure and Stream Audio: Use the deepgram.STT() plugin to stream audio directly. It smartly handles chunking and endpointing for you. Here’s an example to illustrate:
import asyncio
from livekit import rtc
from livekit.plugins import deepgram
async def entrypoint(ctx):
stt = deepgram.STT(interim_results=True, endpointing_ms=3000)
audio_stream = rtc.AudioStream(ctx.track)
stt_stream = stt.stream()
asyncio.create_task(recognize_task(stt_stream))
async for frame in audio_stream:
stt_stream.push_frame(frame)
async def recognize_task(stt_stream):
async for event in stt_stream:
if event.is_final:
print("Final Transcript:", event.alternatives[0].text)
await stt_stream.aclose()
One of the great features here is Deepgram’s built-in endpointing (like endpointing_ms=3000), which detects silence for you. This means you can simplify your setup by removing the external VAD, making your pipeline cleaner and more efficient.
If you’d like, I’m here to help you with any part of this setup or answer any questions you might have. Just let me know!
Sources: examples/voice_agents/realtime_turn_detector.py | AI Agents Framework | livekit/livekit_composite | DeepWiki | pipeline-stt/transcriber/README.md | Deepgram STT plugin guide | LiveKit Docs