loud-daybreak-64654
02/20/2026, 11:13 AMtall-airline-16756
02/20/2026, 11:13 AMtall-airline-16756
02/20/2026, 11:13 AMagent_name or room prefix.
◦ If agent_name is set in the agent, automatic dispatch is disabled — you must dispatch explicitly.
1. Observe whether models are loading slowly
◦ If your agent loads STT/LLM/TTS models on-demand, model load time can cause the 10s connection timeout.
◦ Prewarm models at startup or bake them into the container image to avoid per-call delays.
Common causes and how to fix them
• Agent worker not running or not registered
◦ Start the agent in production/dev mode and confirm it registers; ensure agent_name matches dispatch rules.
• Network/firewall restrictions
◦ Allow outbound TCP/443 and UDP for WebRTC; ensure TURN is allowed. Use the connection test to identify failures.
• Latency to AI services (STT/LLM/TTS)
◦ Deploy the agent in a region near the AI provider endpoints.
◦ Consider LiveKit Inference (co-locates model access) if you need lower latency.
• Single or overloaded workers
◦ Run multiple workers per agent_name for redundancy and scaling.
◦ Increase CPU/memory or scale horizontally if workers are CPU-bound or slow.
• 10-second dispatch timeout
◦ Prewarm models during agent startup or in a setup/prewarm function.
◦ Increase resources or pre-download model artifacts in your container image.
What I need from you to diagnose further Please share any of the following (as available):
• Recent agent logs around a call attempt (paste the relevant error block).
• Are you using SIP/telephony or direct WebRTC?
• The DigitalOcean region of your droplet.
• Which AI providers you call for STT/LLM/TTS (OpenAI, Deepgram, ElevenLabs, etc.).
• Whether you run a single worker or multiple workers per agent.
If you can paste a short log snippet showing the join attempt and any error lines, I can point to the exact problem and a concrete fix.
Sources: Agents telephony integration | LiveKit Documentation | SIP Lifecycle Management Agent | LiveKit Documentation | How can I reduce latency in voice agents using STT, TTS and LLM? | LiveKit | examples/drive-thru | livekit/livekit_composite | DeepWiki | Introducing LiveKit Inference: A unified model interface for voice AIloud-daybreak-64654
02/20/2026, 11:25 AMtall-airline-16756
02/20/2026, 11:26 AMLIVEKIT_API_KEY and LIVEKIT_API_SECRET.
• Purchase a domain (or use an existing one) and plan to provision TLS (Let’s Encrypt is fine).
2) Prepare cloud-init (recommended for one-click Droplet setup)
• Use the LiveKit cloud-init Ubuntu YAML template and edit it with your API key/secret and TLS cert/key.
• Template source: https://github.com/livekit/livekit-server/blob/master/deploy/cloud-init.ubuntu.yaml
• Place the edited YAML in the Droplet “User Data” field during creation so the server boots with LiveKit installed and configured.
3) Create the Droplet
• Choose an Ubuntu LTS image.
• Pick a region close to your users (and any AI services you’ll call).
• Paste your edited cloud-init YAML into “User Data” and create the Droplet.
4) Configure DNS and TLS
• Create an A record pointing your domain (e.g., livekit.example.com) to the Droplet public IP.
• Ensure the TLS certificate and key are installed (cloud-init can install them if provided, or use Certbot after boot).
5) Open required firewall/ports
• Allow TCP 443 (HTTPS / WSS).
• Allow UDP for WebRTC (Media) and any additional LiveKit ports your deployment requires (check your cloud-init or server config for exact ports, commonly UDP/TCP 7882/7880/7881 depending on config).
• Ensure outbound TCP/443 is allowed (for TURN, STUN, and API calls).
6) Verify the server
• Use the LiveKit connection test: https://livekit.io/connection-test
• Generate a test token and connect via a LiveKit SDK client to confirm publishing/subscribing works.
7) If you run agents or AI models
• Deploy agents on droplets in regions near the AI provider endpoints (OpenAI, Deepgram, etc.) to reduce latency.
• Prewarm models at startup or bake models into the container image to avoid per-call load delays.
If you prefer Kubernetes (DOKS)
• Create a DOKS cluster.
• Install Helm and follow the LiveKit Kubernetes deployment guide.
• Use an Ingress/LoadBalancer with TLS (Cert-Manager for Let’s Encrypt).
• Helm charts and manifests let you scale LiveKit and manage rolling updates.
Or use LiveKit Cloud (managed)
• LiveKit Cloud handles scaling, TLS, and media routing for you and is the easiest path if you don’t want to manage infrastructure.
What I can help with next
• If you want, I can provide a ready-to-edit cloud-init YAML snippet tailored for DigitalOcean with placeholders for your API keys and TLS files.
• Or I can walk you through the Kubernetes Helm commands for a DOKS install.
• Tell me which option (Droplet vs DOKS vs Cloud) and whether you plan to run agents, and I’ll provide the exact next steps and example configs. Sources: Running LiveKit on AWS | Agent deployment overview | LiveKit Documentationloud-daybreak-64654
02/20/2026, 11:27 AMtall-airline-16756
02/20/2026, 11:28 AMnode agent.js / tsx agent.ts start.
◦ If you use a container, run it with an interactive entrypoint and tail logs (docker run --rm -it ...).
1. Confirm runtime env vars are present and correct at process runtime:
◦ Verify LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET are set in the same environment used to start the agent (not just in .env files that may not be loaded at runtime).
◦ Confirm any AI provider keys (e.g., DEEPGRAM_API_KEY) are set if the agent initializes those services on startup.
Quick checks you can run now
• Run: curl/wscat to the LiveKit WSS URL from inside the droplet to confirm outbound TLS connectivity:
◦ wscat example: wscat -c <wss://mock-interview-up2y2ttf.livekit.cloud> (or curl -v <https://mock-interview-up2y2ttf.livekit.cloud/health> if a health endpoint exists)
• Check the process exit reason from the host (systemd/journald or Docker):
◦ For systemd: journalctl -u your-agent.service -n 200 --no-pager
◦ For Docker: docker logs <container-id> --details
• Confirm there’s no OOM/killed-by-kernel event:
◦ dmesg | grep -i kill or dmesg | grep -i oom
Likely root causes & targeted fixes
1. Missing/invalid API key or secret
◦ Symptom: agent can open a socket but is rejected when trying to authenticate/register.
◦ Fix: Ensure LIVEKIT_API_KEY and LIVEKIT_API_SECRET are present and correct in the runtime environment. If you recently rotated keys, update the deployed env.
1. Uncaught exception in startup code
◦ Symptom: silent exit after model load.
◦ Fix: Enable debug logs and run interactively to capture stack traces. Ensure start mode runs the server registration code path (cli.runApp or equivalent) — not a dev-only or download-only branch.
1. Network blocking or TLS handshake failure
◦ Symptom: WSS connect attempts may time out or be interrupted.
◦ Fix: Confirm outbound TCP/443 from the droplet is allowed. Ensure any company firewall or DO VPC rules permit outbound TLS to *.livekit.cloud.
1. Cold start/model load latency & dispatch timeout
◦ Symptom: agent takes too long to become ready and LiveKit dispatch times out.
◦ Fix: Pre-download models during image build (e.g., run pnpm download-files in your Dockerfile) or add a prewarm function so heavy models load at process start, not per-call.
1. Container/process lifecycle issues (if using Docker)
◦ Symptom: container exit code 128 due to entrypoint issues or signal handling.
◦ Fix: Ensure your Dockerfile uses a non-root user correctly, and the CMD/ENTRYPOINT forwards signals. Use a proper process manager or run directly in foreground so logs propagate.
Concrete steps I recommend you run next
1. Re-run the agent with debug and paste the logs from the debug session (from startup through the exit).
2. Verify the environment variables are present to the running process:
◦ Example quick test inside the same environment: node -e "console.log(process.env.LIVEKIT_API_KEY, process.env.LIVEKIT_URL)"
1. If running in Docker, update your Dockerfile to pre-download files:
◦ Add RUN pnpm download-files during build so downloads aren’t happening at runtime.
1. Check for OOM or kill events:
◦ dmesg | grep -i kill and your container runtime logs.
1. If you see any auth or websocket error text in debug logs, paste it here and I’ll point to the exact fix.
If you’d like, I can:
• Provide a sample debug command and exact env-check commands for your agent runtime.
• Provide an example Dockerfile snippet that pre-downloads assets and runs the agent in foreground with proper signal handling.
Which would help most right now — do you want the exact commands to run for debug/log capture, or a ready-to-edit Dockerfile snippet to reduce cold-start problems?
Sources: Agents (Node.js) | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWiki | server-sdk-js | livekit/livekit_composite | DeepWiki | Running LiveKit on AWS | Server options | LiveKit Documentation