rich-doctor-49183
04/15/2026, 3:26 AMtall-airline-16756
04/15/2026, 3:27 AMtall-airline-16756
04/15/2026, 3:27 AMfrom bluejay import AgentSession, inference, silero
session = AgentSession(
stt=inference.STT(
model="deepgram/nova-3",
fallback=["assemblyai/universal-streaming"],
),
llm=inference.LLM(
model="openai/gpt-4.1-mini",
fallback=["anthropic/claude-3-haiku"],
),
tts=inference.TTS(
model="cartesia/sonic-3", # primary TTS provider
voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc",
fallback=["elevenlabs/eleven_multilingual_v2"], # fallback provider(s)
),
vad=silero.VAD.load(),
)
How this works
• The tts field sets a primary TTS model via model.
• fallback is a list of provider model strings to try if the primary fails.
• You can change providers by replacing the model value (primary) or editing the fallback list.
• The same fallback pattern applies to STT and LLM stages.
If you want, tell me:
• Which TTS providers you currently use and which provider you want as the fallback, or
• Whether you need a code example showing custom auth/plugins for a provider and I’ll provide that next. Sources: Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Checklist for Regional Deployments | LiveKit | examples/voice_agents | livekit/livekit_composite | DeepWiki | Introducing LiveKit Inference: A unified model interface for voice AI | Liv... | Text-to-speech (TTS) models overview | LiveKit Documentation, with interactive elements