What is the http server in AgentServer used for?
# ask-ai
d
What is the http server in AgentServer used for?
✅ 1
t
Thanks for reaching out, akshat. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking what the HTTP server in AgentServer is used for. The HTTP server exposes a local health-check endpoint at
/
. It returns: • 200 when the agent is connected to the LiveKit server and operating normally • 503 when the agent has a problem (e.g., inference process not running or not connected) Defaults: • Host:
0.0.0.0
(all interfaces) • Port:
8081
in production (random port in dev) You can customize host/port via the AgentServer/ServerOptions constructor. LiveKit Cloud uses this endpoint during rolling deployments to verify instance health; you can also expose it privately for your own monitoring. Sources: Server options | LiveKit Documentation | Self-hosted deployments | LiveKit Documentation, with interactive elements
d
When running multiple tasks on the same machine, it gives port already in use
t
You're hitting the port conflict because each AgentServer starts its HTTP health-check on the same host:port by default. Two quick ways to fix this: 1. Run each AgentServer with a different port: • Python example:
Copy code
server = AgentServer(host="0.0.0.0", port=9091)  # change port per instance
• Node.js example:
Copy code
const opts = new ServerOptions({ host: '0.0.0.0', port: 9091 });
1. Let dev mode pick a random port (suitable for local testing) or assign unique ports per task in your orchestration (systemd, Docker, Kubernetes, etc.). Before I give exact commands or a short script to launch multiple instances, can you tell me: • Are you running these AgentServer tasks locally, in Docker, or in Kubernetes/another orchestrator? • Do you want fixed ports per instance or random ports?, with interactive elements