average-knife-77348
10/30/2025, 8:57 PMaverage-knife-77348
10/30/2025, 8:58 PMI'm glad you're exploring how to configure LiveKit to send all audio directly to Deepgram and handle chunking without needing an external VAD like Silero. You can achieve this smoothly using the deepgram.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:
Install the Plugin: Simply run pip install livekit-plugins-deepgram to add the Deepgram plugin.
Authentication: Make sure to set your Deepgram API key in the environment variable DEEPGRAM_API_KEY. This keeps things secure and ready to go.
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!early-fall-57331
10/30/2025, 9:21 PMstt=deepgram.STTv2(),
# Disable VAD and strictly rely on Flux for detecting interruptions
# vad=silero.VAD.load(),
turn_detection="stt",
# Use Flux eager turn detection for quick responses
preemptive_generation=True,average-knife-77348
10/30/2025, 9:23 PMearly-fall-57331
10/30/2025, 9:24 PMsession = AgentSession(
stt=deepgram.STTv2(),
llm=openai.LLM(
model="gpt-4.1-2025-04-14",
temperature=0,
service_tier="priority",
),
tts=deepgram.TTS(
model="aura-2-thalia-en",
),
# Disable VAD and strictly rely on Flux for detecting interruptions
# vad=silero.VAD.load(),
turn_detection="stt",
# Use Flux eager turn detection for quick responses
preemptive_generation=True,
)average-knife-77348
10/30/2025, 9:25 PMaverage-knife-77348
10/30/2025, 9:30 PMearly-fall-57331
10/30/2025, 9:30 PMaverage-knife-77348
10/30/2025, 9:31 PMearly-fall-57331
10/30/2025, 9:32 PMproud-match-31207
10/31/2025, 8:23 AMrefined-appointment-81829
10/31/2025, 3:41 PMearly-fall-57331
10/31/2025, 3:50 PMproud-match-31207
11/01/2025, 8:01 AM