I'm using OpenAI's `RealtimeModel` for both STT+LL...
# ask-ai
m
I'm using OpenAI's
RealtimeModel
for both STT+LLM, and I'm using a separate model for TTS. What turn detection model should I use for the lowest latency possible with my setup?
t
Thanks for reaching out, Anas. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To get the lowest latency when using OpenAI's
RealtimeModel
for STT+LLM alongside a separate model for TTS, it’s best to stick with the built-in turn detection that the
RealtimeModel
offers. This way, you can avoid the extra delay that comes from using external turn detection models. Here’s how you can do it: just set up the turn detection right inside the
RealtimeModel
using its
turn_detection
option. For example, try the
server_vad
mode with a short
silence_duration_ms
(like 200ms) to keep things snappy. Or, if you want something that’s also quick but helps reduce interruptions during speech, the
semantic_vad
mode is a great choice. On the other hand, using an external turn detection model—like LiveKit's turn-detector plugin—means you'd need a separate STT service, which can add quite a bit of latency. So, for your setup, it’s best to avoid that route. Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | OpenAI Realtime API integration guide | LiveKit Docs | Turn detection and interruptions | LiveKit Docs | Realtime model integrations | LiveKit Docs
m
is it a good idea to combine it with _`input_audio_noise_reduction`, or would that add a lot of latency?_
t
Great question! The latency impact of turning on
input_audio_noise_reduction
with OpenAI's
RealtimeModel
isn’t specifically documented. Noise reduction is definitely a handy feature, but how much it affects latency can really depend on how it’s set up and your particular environment. My best advice is to try running your pipeline both with and without
input_audio_noise_reduction
enabled. That way, you can see firsthand how it performs and decide if it fits your latency needs. Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime... | OpenAI and LiveKit | LiveKit Docs