mammoth-fountain-26720
12/29/2025, 3:08 PMtall-airline-16756
12/29/2025, 3:08 PMtall-airline-16756
12/29/2025, 3:09 PMtts, llm, and room options). You can redact API keys.
While you gather that, quick checks you can run now:
• Replace deprecated options: switch from `input_options`/`output_options` to room_options = RoomOptions(...).
• Verify the TTS plugin is installed and credentials set (e.g., pip install livekit-plugins-elevenlabs and ELEVENLABS_API_KEY set).
• Test TTS and LLM individually (simple API call) to confirm auth/network.
• Check host CPU/RAM during failures — the logs show worker load near 1.0; if the host is saturated, inference requests time out.
• Add connection retries/timeouts via conn_options for both tts and llm to reduce transient failures.
Send the four items above (provider names, hosting, and the AgentSession code) and I’ll give exact changes and the minimal code fixes to resolve the errors.
Sources: https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal/signup| | Agent session | LiveKit docs | Amazon Polly TTS plugin guide | LiveKit docs | Agents (Python) | livekit/livekit_composite | DeepWiki | Custom agent deployments | LiveKit docsmammoth-fountain-26720
12/29/2025, 3:12 PMBVCTelephony for best results
noise_cancellation=noise_cancellation.BVC(),
),
)
await session.say("Hey, how can I help you today?", allow_interruptions=True)tall-airline-16756
12/29/2025, 3:12 PMroom_options=RoomOptions(...) instead of room_input_options=... when starting the session.
1. Correct Azure/OpenAI provider usage
• Your LLM config looks like an Azure OpenAI client but is passed as openai.LLM.with_azure(...) — keep that (it’s fine). For TTS with Azure, use the Azure-specific constructor consistently: openai.TTS.with_azure(...) is correct, but ensure the model and api_version match what your Azure deployment expects (you had model="tts" and api_version="2024-02-15-preview").
1. Ensure required environment variables / keys are set
• Confirm these are set and correct: AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY. If using OpenAI-native TTS, you’d set OPENAI_API_KEY instead. Missing/invalid keys cause the synth/LLM failures.
1. Add connection options (retries/timeouts) to TTS and LLM to reduce transient failures
• Use conn_options with reasonable max_retries and timeout for both llm and tts.
1. Check host load and resource limits
• The logs show worker load ~0.995. Reduce concurrent jobs or increase instance resources. High CPU/RAM will cause timeouts in TTS/LLM calls.
Minimal corrected code (apply these changes)
from livekit.agents.voice.room_io import RoomOptions
from livekit.agents import ConnectionOptions
agent = Agent(
instructions=system_instructions,
stt=deepgram.STT(),
llm=openai.LLM.with_azure(
azure_deployment="gpt-4o",
model="gpt-4o",
azure_endpoint=AZURE_OPENAI_ENDPOINT,
api_key=AZURE_OPENAI_API_KEY,
api_version="2024-12-01-preview",
conn_options=ConnectionOptions(max_retries=3, timeout=30.0),
),
tts=openai.TTS.with_azure(
model="tts", # confirm this matches your Azure deployment name
voice="nova",
api_version="2024-02-15-preview",
api_key=AZURE_OPENAI_API_KEY,
azure_endpoint=AZURE_OPENAI_ENDPOINT,
conn_options=ConnectionOptions(max_retries=3, timeout=30.0),
instructions="Speak slowly in a calm and soothing voice.",
),
tools=[...],
)
session = AgentSession(
userdata=MySessionInfo(...),
vad=vad_instance,
)
await session.start(
agent=agent,
room=ctx.room,
room_options=RoomOptions(
noise_cancellation=noise_cancellation.BVC(),
),
)
Troubleshooting steps to run now
• Test Azure TTS and Azure LLM from a small standalone script on the same host to confirm credentials and network reachability.
• Monitor CPU/memory while running a test call; if CPU is near 100% increase instance size or reduce concurrent agent jobs.
• If you still see retry messages, capture one full failure stack trace for TTS and one for LLM (the full exception text) and paste it here.
If you want, paste the exact values you set for `model`/`deployment` in Azure (redact keys) and confirm whether the agent runs on your own server or LiveKit Cloud — I’ll validate the model names/api_version and suggest any remaining adjustments.mammoth-fountain-26720
12/29/2025, 3:14 PM