livekit.agents._exceptions.APIStatusError: Error c...
# ask-ai
f
livekit.agents._exceptions.APIStatusError: Error code: 503 - {'error': {'message': 'The engine is currently overloaded. Please try again later.', 'type': 'server_error', 'param': None, 'code': None}, 'usage': {'type': 'duration', 'seconds': 0}} (status_code=503, request_id=req_65fa93003360430b9b01df5903f577c4, body={'message': 'The engine is currently overloaded. Please try again later.', 'type': 'server_error', 'param': None, 'code': None}, retryable=True) {"tts": "livekit.plugins.openai.stt.STT", "attempt": 1, "streamed": false, "pid": 6071, "job_id": "AJ_gHC95FLFxUwW"}     raise APITimeoutError() from None
t
Thanks for reaching out, Tushar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry you're encountering the error code 503 with the message "The engine is currently overloaded." This usually means the service is temporarily overwhelmed and can't handle requests right now. Let's walk through some steps together to help resolve this: 1. Check SIP Configuration: If this happens during outbound SIP calls, double-check that your SIP trunk settings are correct. For instance, make sure you're using the right provider endpoint like
<http://sip.telnyx.com|sip.telnyx.com>
without any extra subdomains. 2. Adjust Audio Frame Buffer: If the issue relates to audio processing, try increasing the
queue_size_ms
parameter to somewhere between 1000 and 2000ms. This helps buffer incoming audio and can prevent the queue from getting overwhelmed. 3. Monitor Worker Load: If agent worker overload seems to be the cause, keep an eye on CPU usage. If it goes over 75%, it might be a good idea to scale out by adding more worker instances or tweaking the load threshold. 4. Retry External Plugin Requests: For errors coming from external services like AWS, Gladia, or LLM endpoints, implementing exponential backoff retry logic can be really helpful since these errors are often temporary and can succeed on a retry. 5. LiveKit Cloud Monitoring: If you're using LiveKit Cloud and keep seeing 503 errors, it might be necessary to reach out for support, as the system handles infrastructure overloads automatically but persistent issues may require escalation. Please feel free to reach out if you'd like me to walk you through any of these steps or if you want to share more about your setup. I'm here to help! Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | agents/src/_exceptions.ts | LiveKit | SIP troubleshooting guide | LiveKit Docs | Getting Help | livekit/livekit_composite | DeepWiki