mammoth-fountain-26720
12/24/2025, 3:18 PMtall-airline-16756
12/24/2025, 3:18 PMtall-airline-16756
12/24/2025, 3:18 PMpip install "livekit-agents[cartesia]" or the plugin you use).
• Check your TTS config: model and voice IDs are correct and the provider API key/env vars are set.
• From the agent host, test reachability to the TTS service (curl or simple client) to rule out network/API errors.
2) Inspect TTS error details
• Share the full traceback lines around the TTS failures (the snippet shows the file path but not the root error). That will tell us if it’s auth/network/timeouts or an internal plugin error.
3) Address worker capacity (load)
• The log shows load 0.997 and threshold 0.7 — the worker marks itself unavailable when load > threshold.
• Short-term: increase the AgentServer load_threshold if your machine can safely handle more:
◦ Example: create the server with AgentServer(load_threshold=0.95) (only if CPU/memory allow).
• Better: scale horizontally — run additional agent workers (same agent_name) so jobs distribute across instances.
• Consider a custom load_fnc if the default measurement is too conservative for your environment.
4) Reduce resource pressure
• Ensure no other heavy processes share the agent host.
• Pre-warm or reuse TTS resources if your plugin supports it to avoid repeat initializations.
• If using large models locally, consider moving TTS to a hosted provider or a dedicated machine with more CPU/RAM.
5) Observability & retries
• Enable agent observability/logging to capture metrics around job queue length, CPU/memory at failure time, and TTS response times.
• If TTS failures are transient, increase retry interval/backoff to reduce spike load that can push the worker over threshold.
If you want, next steps I can help with
• Review the full TTS traceback you paste here and point to the exact cause.
• Suggest exact config/code change to increase load_threshold or add a custom load_fnc.
• Recommend a scaling plan (how many workers, deployment pattern) based on your expected concurrency and host specs.
Which of the checklist items have you tried, and can you paste the full TTS traceback (the lines after the file path) and your current `AgentServer`/agent config?
Sources: Agent server options | LiveKit docs | Agents Framework | livekit/livekit_composite | DeepWiki | TTS Metrics | LiveKit docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal|mammoth-fountain-26720
12/24/2025, 3:19 PMtall-airline-16756
12/24/2025, 3:20 PMlivekit/agents/tts/tts.py. That will show whether the error is auth, timeout, model load failure, or something else.
3) Reduce retry pressure
• Temporarily increase the TTS retry backoff so retries don’t rapidly spike load (e.g., longer exponential backoff). This prevents retry storms that can push load over threshold.
4) Address worker capacity
• The log shows load ~0.997 > threshold 0.7, then later 0.53 < 0.7 — the worker is oscillating. To fix:
◦ Short-term: raise load_threshold (for example to 0.9) only if your host has headroom.
◦ Best: run additional agent workers (same agent_name) so jobs are distributed horizontally.
◦ Consider a custom load_fnc if the default metric is too conservative for your environment.
5) Reduce per-job resource usage
• If TTS uses local heavy models, move TTS to a dedicated machine or hosted API to avoid saturating the agent host.
• Pre-warm TTS resources if supported by your plugin to avoid repeated costly initializations.
6) Add observability
• Enable more detailed agent logs/metrics around CPU, memory, queue length and TTS latency to correlate the TTS failures with resource spikes.
If you paste:
• The full TTS traceback (exact error message)
• Which TTS plugin/provider you use
• Your agent config snippet showing AgentServer settings (if modified)
I’ll give the exact next fix (auth or network steps, config snippet to change, or scaling recommendation).mammoth-fountain-26720
12/24/2025, 3:27 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/24/2025, 3:28 PMopenai.TTS.with_azure — confirm this and the deployment name you configured.)
• Can you paste the full traceback text that follows the lines in livekit/agents/tts/tts.py? The trace will show whether it’s an auth, timeout, or model error.
Immediate, safe steps you can take now 1) Verify Azure TTS auth & endpoint
• Ensure AZURE_OPENAI_API_KEY and AZURE_OPENAI_ENDPOINT (or the variables your code uses) are set in the agent process environment and accessible to the runtime.
• Confirm the Azure deployment name and model/voice exist and match the values in openai.TTS.with_azure(model="tts", voice="nova", api_version="2024-02-15-preview", azure_endpoint=AZURE_OPENAI_ENDPOINT, api_key=AZURE_OPENAI_API_KEY).
2) Test connectivity / call Azure TTS directly
• From the agent host, run a quick request using curl or the Azure SDK to the same endpoint/credentials to confirm reachability and response (this isolates network/auth from LiveKit code).
3) Capture the exact TTS error
• Paste the full traceback (the exception message and cause). Common outcomes:
◦ Auth error -> invalid key or missing scope
◦ 4xx/5xx from Azure -> model or voice name mismatch or service-side error
◦ Timeout/connection error -> network/DNS issues or blocked egress
4) Reduce retry pressure while debugging
• Temporarily increase the TTS retry backoff or reduce retry frequency so retries don’t create a retry storm.
• If your TTS plugin supports configuring backoff, set longer intervals while you troubleshoot.
5) Mitigate worker load oscillation
• Short-term: raise AgentServer load_threshold (e.g., 0.9) only if the host CPU/memory can handle it.
• Medium/long-term: run multiple agent workers with the same agent_name to distribute jobs horizontally; this is the recommended fix for spikes.
• Consider offloading TTS to a separate dedicated worker or hosted TTS service if you run local heavy models.
6) Small code/config checks in your snippet
• Your openai.TTS.with_azure(...) call looks syntactically fine — confirm you pass azure_endpoint and api_key (or environment equivalents). If you rely solely on env vars, verify the process sees them.
• You prewarm VAD; ensure you also prewarm any heavy TTS model instances if the plugin supports it to avoid initialization cost per job.
If you send:
• The full TTS traceback text
• Confirmation of the Azure deployment name and whether you’re using env vars or passing credentials directly
• Host CPU/RAM and whether other heavy processes are running
I’ll pinpoint the exact fix (auth change, endpoint/model correction, or scaling/config snippet to change).
Sources: Agents Framework | livekit/livekit_composite | DeepWiki | Azure OpenAI TTS plugin guide | LiveKit docs | Agents (Python) | livekit/livekit_composite | DeepWiki | Deploy and scale agents on LiveKit Cloud | LiveKit Pricing