I am getting the following error: "initializing pr...
# ask-ai
m
I am getting the following error: "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 296, "timestamp": "2026-04-21T151028.786620+00:00"} "starting voice assistant for participant JamesCarter", "level": "INFO", "name": "voice-assistant", "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151029.226807+00:00"} "RoomInputOptions and RoomOutputOptions are deprecated, use RoomOptions instead", "level": "WARNING", "name": "livekit.agents", "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151029.677139+00:00"} "failed to generate LLM completion, retrying in 0.1s\nTraceback (most recent call last):\n File \"/home/appuser/.local/lib/python3.11/site-packages/httpx/_transports/default.py\", line 101, in map_httpcore_exceptions\n yield\n File \"/home/appuser/.l "failed to generate LLM completion, retrying in 2.0s\nTraceback (most recent call last):\n File \"/home/appuser/.local/lib/python3.11/site-packages/httpx/_transports/default.py\", line 101, in map_httpcore_exceptions\n yield\n File \"/home/appuser/.l "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 296, "elapsed_time": 3.34, "timestamp": "2026-04-21T151032.122408+00:00"} "failed to generate LLM completion, retrying in 2.0s\nTraceback (most recent call last):\n File \"/home/appuser/.local/lib/python3.11/site-packages/httpx/_transports/default.py\", line 101, in map_httpcore_exceptions\n yield\n File \"/home/appuser/.l "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7948120000000001, "threshold": 0.7, "timestamp": "2026-04-21T151033.777678+00:00"} "STT metrics", "level": "INFO", "name": "livekit.agents", "model_name": "nova-3", "model_provider": "Deepgram", "audio_duration": 4.55, "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151034.714455+00:00"} "Error in _llm_inference_task\nTraceback (most recent call last):\n File \"/home/appuser/.local/lib/python3.11/site-packages/httpx/_transports/default.py\", line 101, in map_httpcore_exceptions\n yield\n File \"/home/appuser/.local/lib/python3.11/sit "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.2906636000000001, "threshold": 0.7, "timestamp": "2026-04-21T151036.278659+00:00"} "STT metrics", "level": "INFO", "name": "livekit.agents", "model_name": "nova-3", "model_provider": "Deepgram", "audio_duration": 5.0, "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151039.716764+00:00"} "STT metrics", "level": "INFO", "name": "livekit.agents", "model_name": "nova-3", "model_provider": "Deepgram", "audio_duration": 5.0, "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151044.717274+00:00"} "STT metrics", "level": "INFO", "name": "livekit.agents", "model_name": "nova-3", "model_provider": "Deepgram", "audio_duration": 5.05, "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151049.766968+00:00"} "STT metrics", "level": "INFO", "name": "livekit.agents", "model_name": "nova-3", "model_provider": "Deepgram", "audio_duration": 5.05, "pid": 266, "job_id": "AJ_tYd335XzS336", "room_id": "RM_57T53Wtfj3dh", "timestamp": "2026-04-21T151054.814188+00:00"} How to fix it?
✅ 1
t
Thanks for reaching out, shreyasraoinna. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your logs showing repeated "failed to generate LLM completion" entries, the deprecation warning for RoomInputOptions/RoomOutputOptions, and the worker capacity messages. What to check and do next 1) LLM connection failures (primary cause) • Verify your LLM provider API key and endpoint are correct in the environment used by the agent process. • Confirm outbound HTTPS to the LLM endpoint is allowed (firewall, proxy, DNS). The httpx transport trace indicates network/HTTP connection failures. • Add or tune timeouts and retry settings for the LLM client (or use the provided connection options) so transient network errors are handled gracefully. • Configure a fallback LLM provider or adapter so requests can route to a backup when the primary fails. 2) Deprecated Room options • Replace usage of
RoomInputOptions
/
RoomOutputOptions
with
RoomOptions
when creating session/room configs to remove the warning. 3) Worker capacity • The logs show workers hit the capacity threshold (load ~0.79 > 0.7). Add more worker instances for the agent or reduce other load on the machine to avoid marking workers unavailable. • Ensure agent hosts aren’t running extra processes that compete for CPU/memory. 4) Diagnostics to run now (quick) • From the agent host, curl the LLM API endpoint with the same credentials to confirm connectivity. • Check agent process environment variables for the correct API key and endpoint. • Review agent logs immediately before/after the httpx traceback for any specific HTTP error codes (timeouts, DNS, TLS, 4xx/5xx). • Restart one agent after verifying config to confirm behavior. If you want, share: • the LLM provider you’re using, • the agent host network environment (behind proxy/VPC/firewall), • and a sanitized snippet of the full httpx traceback (showing the HTTP error/code) I’ll use those details to give exact commands and config snippets to fix the connection and recommend scaling options. Sources: livekit-agents/livekit/agents/llm/llm.py | Agent session | LiveKit Documentation | Agents Framework | livekit/livekit_composite | DeepWiki | Troubleshooting 401 Unauthorized and Token Errors | LiveKit | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit, with interactive elements
m
I am using Azure Openai for the LLM and the TTS
t
Thanks — since you’re using Azure OpenAI for both LLM and TTS, focus on three areas: Azure auth/config, network/connectivity, and worker scaling. I’ll highlight the shortest actionable checks and fixes. 1) Verify Azure auth & config • Ensure env vars are set correctly:
AZURE_OPENAI_API_KEY
(or
AZURE_OPENAI_AD_TOKEN
),
AZURE_OPENAI_ENDPOINT
(note spelling), and
OPENAI_API_VERSION
. • Confirm you’re calling Azure-mode helpers (e.g.,
openai.LLM.with_azure()
/
openai.TTS.with_azure()
). 2) Confirm network connectivity • From the agent host, run a quick curl to the Azure endpoint with your key to test connectivity and response: ◦ curl -v -H "api-key: $AZURE_OPENAI_API_KEY" "$AZURE_OPENAI_ENDPOINT/openai/deployments/deployment/chat/completions?api-version=$OPENAI_API_VERSION" • Check for DNS, firewall, proxy, or TLS errors in the curl output. The httpx trace indicates an HTTP/connection failure rather than an STT problem. • If you’re inside a VPC or behind a proxy, ensure outbound HTTPS to Azure OpenAI is allowed. 3) Tune timeouts, retries, and fallbacks • Increase client timeouts and retry settings for httpx/Azure calls so transient network blips don’t immediately fail. • Configure a fallback adapter or a secondary Azure deployment/provider so the agent can route requests when the primary fails. • Reduce request payloads if needed (lower
max_tokens
or shorter prompts) to reduce latency. 4) Handle TTS failures separately • If TTS can fail independently, add a fallback voice/provider or a short pre-recorded clip to avoid dead air when synthesis times out. 5) Fix deprecated Room options • Replace
RoomInputOptions
/
RoomOutputOptions
with
RoomOptions
in your agent/room setup to remove warnings. 6) Address worker capacity • Logs show worker load exceeded the threshold. Add more agent worker instances or lighten host load so workers aren’t marked unavailable. If you want, share any one of these (sanitized): • the curl output to the Azure endpoint (including HTTP status / error), • the exact env var names/values (masked) you’ve set, • or the httpx traceback lines showing the HTTP error code I’ll provide the exact curl/timeout config and a minimal code snippet for Azure-mode LLM/TTS or advise next steps based on the error details you paste. Sources: Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Sequential Pipeline Architecture for Voice Agents | LiveKit | Azure OpenAI LLM plugin guide | LiveKit Documentation | Azure OpenAI TTS plugin guide | LiveKit Documentation | Azure OpenAI Realtime API and LiveKit | LiveKit Documentation, with interactive elements