I'm trying to understand LiveKit Cloud (regarding ...
# ask-ai
c
I'm trying to understand LiveKit Cloud (regarding Twilio phone calls). There are basically 4 servers involved: 1. Twilio SIP trunk - I direct my calls to this trunk and I configure it to forward them to LiveKit's Cloud SIP 2. LiveKit SIP - Converts the phone call to the LiveKit Processor 3. LiveKit Processor - Does all the heavy lifting regarding STT, TTS, LLM, etc. But, does not actually run an Agent 4. My Server - I host my own server(s) containing the Agent logic. These servers register themselves with the "LiveKit Processor". So LiveKit Cloud provides 2 & 3?
g
Yes, LiveKit Cloud provides the SIP integration and processing capabilities. Specifically, LiveKit Cloud handles the SIP trunking (step 2) and the processing of media and data (step 3) through its infrastructure. This includes converting phone calls into a format that can be processed by AI agents, handling tasks like speech-to-text (STT), text-to-speech (TTS), and large language model (LLM) operations. However, the actual AI agent logic (step 4) is hosted on your own servers, which connect to LiveKit to perform these tasks. For more details, you can refer to the LiveKit SIP Overview and Agents Overview. Would you like more detailed information on any specific part of this setup? Sources: - SIP Overview - Agents Overview 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 Hmmm.... now i'm not sure... STT, TTS, LLM might run on My Server?
g
Yes, STT, TTS, and LLM operations typically run on your server. LiveKit Cloud facilitates the connection and media handling, but the actual processing logic, including speech-to-text, text-to-speech, and language model operations, is executed by the agent code you host on your own server. This setup allows you to customize and control the AI processing logic according to your needs. For more information, you can check the Agents Overview which explains how agents connect to LiveKit and perform these tasks. Would you like more detailed information on setting up these components? Sources: - Agents Overview 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 Wait, is that right? Or do they run on LiveKit Cloud?
g
The STT, TTS, and LLM operations are executed by the agent code that you host on your own server, not on LiveKit Cloud. LiveKit Cloud provides the infrastructure for connecting and managing media streams, but the processing logic for these operations is handled by your self-hosted agents. For further details, refer to the Agents Overview, which outlines how agents are integrated and operate within the LiveKit framework. Would you like more detailed information on how to set up and run these agents? Sources: - Agents Overview 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 What happens if my server crashes and restarts mid-conversation?
g
If your server crashes and restarts mid-conversation, the agent will disconnect from the LiveKit room. When the server restarts, the agent can rejoin the room, but it will not automatically resume the previous session. You will need to handle reconnection logic to ensure the agent rejoins the correct room and resumes any necessary state or context. For more information on handling reconnections, you can refer to the LiveKit Room Management documentation. Would you like more detailed guidance on implementing reconnection logic? Sources: - LiveKit Room Management 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 But if it's a phone call, what happens? Does it hang up?
g
If your server crashes during a phone call, the call will likely be disconnected. The SIP participant in the LiveKit room would lose connection to the agent, which typically results in the call being terminated. The phone call would not automatically resume once your server restarts. For more information on handling SIP calls and disconnections, you can refer to the SIP Overview. Would you like more detailed information on managing SIP call disconnections? Sources: - SIP Overview 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.