Hello, Im using livekit in my project. For stt im ...
# ask-ai
m
Hello, Im using livekit in my project. For stt im using deepgram and for llm and tts im using google. Im having one problem that during conversation it get silent and when i say hello it assistant comes back like hello yes im here. It happens rare but it does happen. So what would be the best direction to look or tune?
t
Thanks for reaching out, Fahad. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for sharing the details about the intermittent silences you're experiencing. It sounds like this might be related to how endpointing is handled in Deepgram's STT or some timing settings in LiveKit. Let’s walk through a few steps together to help you investigate and fine-tune things: • Deepgram Endpointing: You might want to try adjusting the
endpointing_ms
parameter (which is set to 25ms by default). Increasing it to somewhere between 100-200ms can help reduce those false end-of-speech triggers. Alternatively, setting it to 0 will disable server-side endpointing altogether. • LiveKit Timing Parameters: Tweaking parameters like
min_endpointing_delay
(default 0.5s) and
max_endpointing_delay
(default 3.0s) can make a big difference in handling pauses and preventing premature turn completions. • Transcript Handling: It’s a good idea to check that final transcripts are being processed without delay by keeping an eye on the
commit_user_turn
function, and adjusting transcript timeouts if needed. • Latency: If possible, placing agents closer to your AI service providers can really help cut down on network delays. If you’d like, I’m here to provide detailed instructions on how to configure these settings or assist you further with troubleshooting. Just let me know! Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/stt.py | Live Conversations with AI using ChatGPT and WebRTC | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki
m
min_endpointing_delay And max_endpointing_delay in my case is default.
t
I see that your
min_endpointing_delay
and
max_endpointing_delay
are currently set to their default values. A helpful next step would be to take a closer look at Deepgram's
endpointing_ms
parameter. By default, it’s set to 25ms, which can sometimes be a bit too quick and might cause the system to think speech has ended earlier than it actually has. It might be a good idea to try increasing
endpointing_ms
to somewhere between 100-200ms. This gives a little more room for natural pauses in speech without mistakenly triggering an end-of-speech signal. Another option is to turn off server-side endpointing by setting
endpointing_ms
to 0, and instead use LiveKit’s voice activity detection (VAD) to manage this. If you’d like, I’m here to help walk you through adjusting this parameter in your Deepgram setup. Just let me know!
m
Oh ok that i dont if i have endpoint_ms greater then 0 then vad would not be used?
t
I’m happy to help clarify this for you! When you set
endpointing_ms
to a value greater than 0, Deepgram’s server-side endpointing takes the lead over LiveKit’s voice activity detection (VAD). This means Deepgram will decide when the speech ends based on the
endpointing_ms
setting you’ve chosen, and LiveKit’s VAD won’t be used for that part. Alternatively, if you set
endpointing_ms
to 0, Deepgram’s endpointing is turned off, so LiveKit’s VAD steps in to handle detecting the end of speech. If you’d like, I’d be glad to walk you through the benefits of each option or assist you in setting up the one that fits your needs best. Just let me know!
m
Yes please.
t
Here’s a friendly breakdown of the two approaches to help you decide what works best for you: • Using Deepgram's Endpointing (
endpointing_ms > 0
):
◦ Deepgram will take care of detecting the end of speech based on the
endpointing_ms
value you set. ◦ Pros: This can make things simpler by reducing the need to rely on LiveKit's VAD. It’s especially handy if Deepgram's endpointing fits well with your specific use case. ◦ Cons: If the
endpointing_ms
value is set too low, it might mistakenly detect pauses as the end of speech. On the other hand, if it’s too high, responses might feel a bit delayed. • Disabling Deepgram's Endpointing (
endpointing_ms = 0
):
◦ This lets LiveKit's VAD handle the end-of-speech detection instead. ◦ Pros: You get more control to fine-tune speech detection thresholds and timing directly within LiveKit, which is great if you want to customize it closely for your app. ◦ Cons: It does mean you’ll need to carefully adjust LiveKit's VAD settings to avoid any false alarms or missed detections. To set these up: 1. In your Deepgram configuration, adjust the
endpointing_ms
parameter: ◦ Choose a higher value (like 100-200ms) if you want to use Deepgram's endpointing. ◦ Set it to 0 if you prefer to disable Deepgram's endpointing and rely on LiveKit's VAD. 1. If you go with LiveKit's VAD, make sure to tune parameters such as
min_silence_duration
to fit your needs. If you’d like, I’m here to guide you through the detailed steps or help with any other questions you might have!