Hey guys Im trying to setup voice phone agent When...
# ask-ai
m
Hey guys Im trying to setup voice phone agent When using openai or gemini real time its very fast and good. But when using stt llm tts pipeline using gemini or openai models its very very slow … seconds to get answers and bad answers. Response time in real time is less than 1.5 sec on phone In pipeline is more than 4-5 sec
t
Thanks for reaching out, Jeremy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about the slow STT→LLM→TTS pipeline (4–5s) versus the fast realtime path (<1.5s). A few likely causes and quick actions you can try now: • Endpointing/turn detection: if the agent waits too long for speech end it adds seconds. Check your
min_endpointing_delay
/
max_endpointing_delay
and reduce them if safe. • Preemptive generation: enable preemptive generation in your
AgentSession
so LLM/TTS processing can start on partial transcripts rather than waiting for full endpointing. • Network proximity: make sure your agent instance is co-located near the LLM/STT/TTS service region (or use LiveKit Inference) to cut API round-trip time. • Streaming vs full-utterance: use streaming transcription and incremental LLM responses where possible instead of waiting for full utterances. • TTS/STT settings: for TTS, try latency-reduction options (e.g.,
reduce_latency=True
for Rime) and ensure STT frame sizes are tuned for low-latency streaming. • Observability: enable Agent Observability to see per-turn timing (STT, LLM TTFT, TTS TTFB) and identify the largest bottleneck. To pinpoint the cause, can you tell me: 1. Are you calling OpenAI/Gemini APIs directly or using LiveKit Inference? 2. Is preemptive generation enabled in your
AgentSession
? 3. Where is your agent deployed relative to the models (region/data center)? 4. Can you enable Agent Observability and share which stage (STT / LLM / TTS) shows the largest delay? 5. Which exact models and key config values are you using (STT model, LLM model, TTS plugin, endpointing timeouts)? Tell me those details and I’ll give specific config changes and next steps to cut the pipeline latency. Sources: How can I reduce latency in voice agents using STT, TTS and LLM? | examples/dtmf | livekit/livekit_composite | DeepWiki | examples/bank-ivr | livekit/livekit_composite | DeepWiki | Agent speech and audio | LiveKit docs | Agent session | LiveKit docs