can we configure gemini's realtime model vad inste...
# ask-ai
c
can we configure gemini's realtime model vad insted of using a seperate stt and MultilingualModel
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Gemini's real-time model VAD is super easy to set up and use right away—no need for a separate STT or MultilingualModel. Out of the box, Gemini comes with built-in VAD-based turn detection that's both cost-effective and straightforward for most situations. If you're looking for something a bit more advanced, like context-aware turn detection for multilingual support or extra accuracy, you can turn off Gemini's VAD and switch to LiveKit's MultilingualModel. Just a heads-up, this option does need a bit more setup, including a separate STT plugin, since the MultilingualModel depends on transcribed text to detect turns. Would you like me to walk you through configuring Gemini’s default VAD, or help you get started with the MultilingualModel and STT setup? Just let me know! Sources: How does end-of-utterance detection work in conversations? | Gemini Live API integration guide | LiveKit Docs | Turn detection and interruptions | LiveKit Docs | Agents Core Architecture | livekit/livekit_composite | DeepWiki | Agent Testing & Evaluation | livekit/livekit_composite | DeepWiki
c
yeah go on, give me a sample code
t
Here’s a handy little code snippet to help you set up Gemini's default VAD for real-time turn detection:
Copy code
from livekit.plugins import google

# Create an AgentSession with Gemini's real-time model
session = AgentSession(
    llm=google.beta.realtime.RealtimeModel(
        model="gemini-2.0-flash-exp",  # Specify the Gemini model
        voice="Puck",  # Choose a voice
        instructions="You are a helpful assistant",  # Set assistant instructions
    ),
)

# Gemini's built-in VAD is enabled by default, so no extra setup is needed.
# The session will automatically take care of turn detection using Gemini's VAD.
This setup uses Gemini's built-in VAD, which is the default and recommended way to keep things simple and cost-effective. If you want, I’m here to help with a sample for a different setup using MultilingualModel and STT—just let me know!
c
Um, actually I want to customize the Gemini's realtime model VAD configuration
t
Hey there! Just a heads-up: Gemini's built-in VAD doesn’t currently let you tweak settings like
threshold
,
prefix_padding_ms
, or
silence_duration_ms
through the LiveKit API. It comes with a default setup that’s turned on automatically, and the only thing you can do right now is turn it off if you want to use a different turn detection system—like LiveKit’s MultilingualModel with an STT plugin. If you’re looking for more detailed VAD customization, you might want to check out the Gemini Live API directly, outside of LiveKit’s integration. I’m here to help if you want some pointers on setting up another turn detection system or if you have a specific customization in mind. Just let me know! Sources: Gemini Live API integration guide | LiveKit Docs | Azure OpenAI Realtime API and LiveKit | LiveKit Docs | Adjusting Model Parameters | LiveKit Docs
c
can't we change the { "setup": { "realtimeInputConfig": { "automaticActivityDetection": { "enabled": true, // Set to false to disable VAD "sensitivity": "MEDIUM" // Example sensitivity level, consult API reference for valid options } } } } ?
t
Hey there! Just a quick heads-up: the sensitivity parameter (
realtimeInputConfig.automaticActivityDetection.sensitivity
) isn’t officially confirmed as something you can tweak for Gemini's VAD in the LiveKit API. You can totally turn off automatic activity detection if you want, but there isn’t any documented way to fine-tune sensitivity or other settings like
threshold
or
silence_duration_ms
for Gemini’s built-in VAD. If you’re hoping to catch quieter speech or cut down on false triggers, one idea is to try a client-side VAD or bring in a separate STT plugin that lets you customize turn detection. I’m happy to help you set that up or chat more about what you’re aiming for with sensitivity tweaks—just let me know! Sources: livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/vad.py | VoicePipelineAgent | LiveKit Docs | Voice activity detection (VAD) parameters | LiveKit Docs | OpenAI Realtime API integration guide | LiveKit Docs | Azure OpenAI Realtime API and LiveKit | LiveKit Docs