This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Mazhar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you set up your LiveKit clusters just right! To get started, could you please share a bit more about: • Are you using LiveKit Cloud, or are you hosting LiveKit yourself? • What kind of agent logic are you hoping to share? For example, is it state, code, models, or something else? • Are you looking to scale your agents horizontally, or are you more focused on synchronizing them across servers? Sources: Web and mobile frontends | LiveKit Docs | Web and mobile frontends | LiveKit Docs | OpenAI Realtime API and LiveKit | LiveKit Docs | OpenAI Realtime API and LiveKit | LiveKit Docs | OpenAI and LiveKit partner to turn Advanced Voice into an API
a
1. Are you using LiveKit Cloud, or are you hosting LiveKit yourself? I’m hosting LiveKit myself on 5 cluster servers. 2. What kind of agent logic are you hoping to share? For example, is it state, code, models, or something else? I want to share state and audio files across the clusters. The code for agent creation, call handling, and processing is currently on the web server, so I need the clusters to either access it or replicate it. 3. Are you looking to scale your agents horizontally, or are you more focused on synchronizing them across servers? I want to do both: scale agents horizontally so multiple servers can handle calls concurrently, and synchronize their state and resources so everything works consistently.
t
To help you achieve horizontal scaling and keep everything in sync in your self-hosted LiveKit deployment, here are some friendly steps you can follow: • Redis Configuration: Make sure Redis is set up correctly—it’s really important for clustering. Think of Redis as the heart that keeps room data and messages flowing smoothly between nodes, so everyone stays on the same page. • Cluster Setup: Set up your LiveKit nodes to work together as a cluster. Each node will share its stats with Redis, which helps the cluster make smart decisions about routing based on how busy each node is. • Audio File Sharing: For sharing audio files, it’s a good idea to use shared storage like NFS or S3-compatible storage that all nodes can access. Or, you could set up a way to send files to each node when needed—whatever works best for you! • Agent Logic: Make sure the agent logic (like the code for creating agents and handling calls) is deployed on every cluster server. This way, each node can handle requests on its own. Using version control or deployment automation can really help keep everything synced up. • Scaling: Consider using autoscaling to automatically adjust the number of nodes based on how much load you have. If you’re on Kubernetes, enabling the Horizontal Pod Autoscaler (HPA) can make this super easy by scaling nodes based on CPU usage or other metrics. • Synchronization: For keeping the system state consistent, lean on Redis—it’s great at making sure all nodes see the same picture. Following these steps will set you up nicely to scale your agents horizontally while keeping everything in sync and sharing resources smoothly across your cluster. If you want, I’m here to help you dive deeper into any of these configurations—just let me know! Sources: Distributed Setup | LiveKit Docs | examples/server-do.yaml