witty-kangaroo-6889
09/29/2025, 2:09 AMtall-airline-16756
09/29/2025, 2:09 AMtall-airline-16756
09/29/2025, 2:10 AMwitty-kangaroo-6889
09/29/2025, 2:11 AMtall-airline-16756
09/29/2025, 2:11 AMreduce_latency option can help by skipping text normalization. You might also want to tweak settings like sample_rate and speed_alpha.
• Minimize Connection Time: Generating a warm access token during user login and dispatching the agent process in parallel can really help reduce startup latency.
• Monitor Performance: The Agents Metrics API is a handy tool for analyzing latency metrics and pinpointing any bottlenecks.
• Operational Observability: Don’t forget to use LiveKit Cloud’s dashboard to keep an eye on session analytics and quality metrics. If you’re on a paid plan, you’ll also benefit from cold start prevention for quicker responses.
I hope these suggestions make your agent more responsive! If you want to dive deeper into any of these points or have other questions, just let me know—I’m here to help!
Sources: Agent speech and audio | LiveKit Docs | Deploy and scale agents on LiveKit Cloud | Rime integration guide | LiveKit Docs | Web and mobile frontends | LiveKit Docs | Web and mobile frontends | LiveKit Docswitty-kangaroo-6889
09/29/2025, 2:17 AMtall-airline-16756
09/29/2025, 2:18 AMpreemptive_generation parameter to True when you initialize the AgentSession. Here’s a friendly example to guide you through it:
async def entrypoint(ctx: JobContext):
session = AgentSession(
vad=ctx.proc.userdata["vad"],
llm=openai.LLM(model="gpt-4o-mini"),
stt=deepgram.STT(model="nova-3", language="multi"),
tts=openai.TTS(voice="ash"),
# Enable preemptive generation to reduce response latency
preemptive_generation=True,
# Use LiveKit's turn detection model for better control
turn_detection=MultilingualModel(),
)
await session.start(agent=MyAgent(), room=ctx.room)
Here are a couple of important points to keep in mind to make this work smoothly:
• The STT node should return the final transcript faster than the VAD emits the end_of_speech event.
• Make sure the turn detection model is enabled for improved control.
With preemptive generation enabled, your agent will start crafting a response based on the final transcript right away. And if anything changes in the chat context or tools, the preemptive response will be gracefully canceled and replaced with an updated one.
If you have any questions or would like me to walk you through any part of this, please don’t hesitate to ask. I’m here to help!
Sources: Docs::Agents | Agent speech and audio | LiveKit Docs | examples/voice_agents/fast-preresponse.py | Agent speech and audio | LiveKit Docs