helpful-dress-37672
10/28/2025, 8:38 AMtall-airline-16756
10/28/2025, 8:38 AMtall-airline-16756
10/28/2025, 8:41 AMmyproject.eu.production.livekit.cloud.
B) LiveKit Inference / Agents Cloud Placement
1. Currently, Agents Cloud is only available in the US (us-east). While EU region support isn’t available yet, it’s on the roadmap for the future.
2. Inference models are region-independent and don’t support region pinning. So providers like Groq EU or Baseten EU can’t be pinned or overridden within LiveKit Inference at this time.
C) BYO Providers via Self-Hosted Agents
1. If you’re using external STT/TTS providers directly from your self-hosted agent, LiveKit doesn’t proxy those payloads. This means traffic to providers like Deepgram EU or Google TTS EU operates independently of LiveKit’s region pinning.
2. Currently, there are no static egress IP ranges for EU SFU/ingress; only wildcard domains are supported for non-US regions.
D) Verification & Compliance
1. You can verify region pinning at runtime using the serverInfo.region field in the Room object (available in SDKs). Also, the /settings/regions endpoint can confirm your region settings.
2. While region pinning ensures media traffic stays within the region, it’s not entirely clear if logs and analytics are also confined to the EU. You might want to reach out to LiveKit support for further details on this.
If you’d like me to provide more details or specific examples—like room creation code snippets—just let me know! I’m here to help.
Sources: livekit-api/src/signal_client/region.rs | lib/getLiveKitURL.test.ts | SIP trunk setup | LiveKit Docs | Region pinning | LiveKit Docs | SIP cloud and region pinning | LiveKit Docshelpful-dress-37672
10/28/2025, 8:48 AMtall-airline-16756
10/28/2025, 8:48 AMhelpful-dress-37672
10/28/2025, 8:52 AMtall-airline-16756
10/28/2025, 8:52 AMfrom livekit_agents import AgentSession
import deepgram
import cartesia
import openai
# Initialize the AgentSession
session = AgentSession(
stt=deepgram.STT(), # WebSocket-based STT
tts=cartesia.TTS(), # WebSocket-based TTS
llm=openai.LLM(), # LLM for processing
vad=silero.VAD.load(),
allow_interruptions=True,
turn_detection="vad"
)
# Start the session
await session.start(agent=agent_instance, room=ctx.room)
This setup smoothly integrates WebRTC with WebSocket-based services like Deepgram (STT) and Cartesia (TTS). Just swap out the placeholders with your own configurations or plugins. If you have any questions or need a hand with anything else, I’m here to help!
Sources: Node.js Agents Architecture | livekit/livekit_composite | DeepWiki | Models | LiveKit Docs | examples/voice_agents/error_callback.py | agents/src/voice/index.ts | AI Service Plugin System | livekit/livekit_composite | DeepWikihelpful-dress-37672
10/28/2025, 8:53 AMtall-airline-16756
10/28/2025, 8:54 AMfrom livekit_agents import AgentSession
import deepgram
import cartesia
import openai
# Initialize the AgentSession with EU-specific configurations
session = AgentSession(
stt=deepgram.STT(endpoint="wss://api.eu.deepgram.com/v1/listen?model=nova-3&language=en&interim_results=true&utterance_end_ms=700"),
tts=cartesia.TTS(region="WE"), # Western Europe region for Cartesia
llm=openai.LLM(endpoint="<GROQ_EU_ENDPOINT>"), # Replace with your Groq EU endpoint
vad=silero.VAD.load(),
allow_interruptions=True,
turn_detection="vad"
)
# Start the session with region-pinned LiveKit room
await session.start(agent=agent_instance, room=ctx.room)
Key Adjustments:
• Region Pinning: Make sure your LiveKit project is pinned to the EU region and double-check it at runtime using serverInfo.region.
• STT: The Deepgram endpoint is set explicitly to the EU region to keep everything compliant.
• TTS: Cartesia is set up for the Western Europe region to match your needs.
• LLM: Don’t forget to replace <GROQ_EU_ENDPOINT> with the actual Groq EU endpoint that Groq provides for your account.
This setup helps ensure all components stay within the EU, which is great for compliance and keeping latency low. If you’d like, I’m here to help with any tweaks or if you want to dive into more details—just let me know!helpful-dress-37672
10/28/2025, 9:08 AMtall-airline-16756
10/28/2025, 9:09 AMimport os
from livekit.agents import AgentSession, Agent
from livekit.plugins import deepgram, cartesia, openai, silero
session = AgentSession(
# STT: Deepgram Nova-3, pinned to EU endpoint
stt=deepgram.STT(
model="nova-3",
base_url="<DEEPGRAM_EU_BASE_URL>",
# optional extras: keyterms=[], numerals=False, ...
),
# TTS: Cartesia (no region param; use base_url ONLY if Cartesia gives you an EU host)
tts=cartesia.TTS(
model="sonic-2", # example model
voice="<YOUR_CARTESIA_VOICE>", # required: your voice id/name
# base_url="<CARTESIA_EU_BASE_URL>" # only if Cartesia provisions one for you
),
# LLM: OpenAI plugin pointed at Groq’s OpenAI-compatible endpoint
llm=openai.LLM(
model="openai/gpt-oss-20b", # low-latency; try 120b for more quality
base_url="<GROQ_EU_ENDPOINT>",
api_key=os.environ["GROQ_API_KEY"], # pass explicitly to avoid env name mismatch
),
vad=silero.VAD.load(),
allow_interruptions=True,
turn_detection="vad",
use_tts_aligned_transcript=True, # great with Cartesia/ElevenLabs
)
agent = Agent(instructions="You are a concise, helpful assistant.")
# Start in a room that’s already region-pinned on the LiveKit side
await session.start(agent=agent, room=ctx.room)
Key Adjustments:
• Imports: Corrected to use from livekit.plugins for the required plugins.
• Deepgram: Updated to use base_url for the EU endpoint, represented as <DEEPGRAM_EU_BASE_URL>.
• Cartesia: Removed the unsupported region parameter and added base_url as an optional configuration, represented as <CARTESIA_EU_BASE_URL>.
• Groq: Updated to use base_url for the OpenAI-compatible endpoint and clarified that EU pinning is an Enterprise feature.
• Aligned Transcripts: Enabled use_tts_aligned_transcript=True for better transcript-audio alignment.
This example is designed to help you meet EU residency requirements while making the most of the latest LiveKit Agents API. If you'd like, I’m here to help with any further refinements or even create a version using Google Cloud TTS or ElevenLabs—just let me know!helpful-dress-37672
10/28/2025, 9:14 AMtall-airline-16756
10/28/2025, 9:14 AMinterim_results=true, set utterance_end_ms=700, and use VAD to trim tail silence.
• For TTS: Stream audio in small chunks (80–120 ms), prebuffer a bit, and enable word timing to make barge-ins smoother.
• For LiveKit: Use jitter buffers (60–120 ms), enable DTX, and colocate all components within the same EU metro area for the best performance.
Failover Strategies:
• If Cartesia Sonic experiences high TTFT or socket RTT, you can switch to Google TTS EU.
• If you notice partial STT rate drops or spikes in word errors, try restarting the STT WebSocket or switching models.
• If Groq EU latency increases, falling back to a local LLM is a good option.
This setup really aims to balance speed and quality, while giving you the flexibility to adapt based on user preferences and network conditions. If you’d like, I’m happy to provide the configuration block for these parameters—just let me know!helpful-dress-37672
10/28/2025, 9:18 AMtall-airline-16756
10/28/2025, 9:19 AM