for livekit cloud, can it run anything locally (le...
# ask-ai
g
for livekit cloud, can it run anything locally (let's say, emotional analysis on an llm generated response)? or am I supposed to call external services (and if so what are the firewall rules and are they configurable)?
t
Thanks for reaching out, Oliver. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for reaching out! I wanted to share that LiveKit Cloud doesn’t directly support running local processing tasks like emotional analysis on LLM-generated responses. Usually, these kinds of tasks are handled by external services. If you’re planning to connect with external services, here are the firewall rules for LiveKit Cloud to keep in mind: • *.livekit.cloud: TCP 443 for secure WebSocket signal connections • *.turn.livekit.cloud: TCP 443 for TURN/TLS (used when UDP isn’t an option) • *.host.livekit.cloud: UDP 3478 for TURN/UDP servers • All hosts (optional): UDP 50000-60000 for WebRTC connections • All hosts (optional): TCP 7881 for WebRTC connections To help everything run smoothly, it’s best to allow those UDP ports and enable UDP hole-punching (or disable symmetric NAT if possible). Also, if your firewall policy doesn’t allow wildcard hostnames, you’ll want to configure specific hostnames for your subdomain and regional endpoints. Sources: Configuring firewalls | LiveKit Docs
g
if I code it into the agent I mean, what would happen, is it allowed? if so, will the instance scale correctly to process rapidly? if it is instead expected to call an external service, is there an example?
t
Absolutely, you can definitely code local processing tasks into a custom agent in LiveKit Cloud. The platform is designed to support these tasks and offers powerful scaling features to keep up with your processing needs: • Elastic Scaling: LiveKit Cloud will automatically scale instances to meet increased demand, spinning up new servers as necessary. • Intelligent Load Balancing: Sessions are thoughtfully distributed based on resource usage, user location, and network conditions to help reduce latency. • Resource Management: The platform smartly optimizes resource allocation for different kinds of agents, whether they’re handling audio, video, or other tasks. If you prefer using external services, LiveKit also offers integrations with providers like OpenAI, Google, Deepgram, and ElevenLabs. For example, you can build AI sports analysts or 911 dispatch assistants that leverage external APIs for speech-to-text, text-to-speech, and video analysis. Please feel free to reach out if you’d like help setting up a specific use case or example—I’m here to assist you! Sources: examples/voice_agents/basic_agent.py | Deploy and scale agents on LiveKit Cloud | An open source stack for real-time multimodal AI | README.md | Deploying to custom environments | LiveKit Docs
g
yeah, in this case I meant for custom tasks such as emotional analysis. it's permitted and will perform as expected (I don't know the specs, it's not about demand as much as it is about performance)?
t
Absolutely, custom tasks like emotional analysis are definitely supported in LiveKit Cloud! The platform is thoughtfully built to handle these kinds of computationally intensive workloads smoothly. Let me share a bit about how we keep the performance solid beyond just scaling for demand: • Intelligent Load Balancing: We distribute sessions by carefully considering resource usage like CPU/GPU, memory, and network conditions to keep latency and jitter as low as possible. • Resource Management: The platform smartly allocates resources for different task types, making sure even the most resource-heavy agents run efficiently. • Global Infrastructure: With data centers spread across multiple regions, we deliver low-latency performance no matter where you are. • Observability Tools: The LiveKit Cloud dashboard offers helpful analytics and metrics so you can easily monitor and optimize your agent’s performance. When it comes to tasks like emotional analysis, you can deploy agents tailored with specific performance needs, and the platform will take care of resource allocation and scaling to keep everything running smoothly. If you'd like, I’m here to help with any more details or guide you through the setup—just let me know! Sources: delay-handling/raw_data.txt | Workflows | LiveKit Docs | Deploy and scale agents on LiveKit Cloud | examples/voice_agents/llamaindex-rag/data/raw_data.txt | Deploying to custom environments | LiveKit Docs