how do i use fallback adaptors for tts can you giv...
# ask-ai
r
how do i use fallback adaptors for tts can you give me an example (i want to chage provider)
✅ 1
t
Thanks for reaching out, Alessandro. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you want an example of using fallback adapters for TTS so you can change providers. I can help — below is a concise example and notes on how it works. Example (Python-style, adapted from the agent pipeline pattern):
Copy code
from 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