gorgeous-hydrogen-44699
05/04/2026, 7:03 AMtall-airline-16756
05/04/2026, 7:03 AMtall-airline-16756
05/04/2026, 7:03 AMfallback array. The SDK will try the next model if the primary fails.
import { inference } from '@livekit/agent-sdk';
const stt = new inference.STT({
model: 'deepgram/nova-3',
fallback: ['assemblyai/universal-streaming'],
});
2) TTS fallback (custom)
• There’s no automatic fallback array for TTS. Override the TTS node to catch errors and call a secondary provider or return a pre-recorded clip.
import { TTSNode } from '@livekit/agent-sdk';
class MyTTSNode extends TTSNode {
async synthesize(text: string) {
try {
return await super.synthesize(text); // primary
} catch (e) {
console.warn('Primary TTS failed, falling back:', e);
return await fallbackProvider.synthesize(text); // secondary
// or: return await this.loadAudio('fallback.mp3');
}
}
}
3) UX and error handling recommendations
• For STT low-confidence/empty results: prompt the user to repeat before passing input downstream.
• For TTS failures: switch to a simpler provider or play a short pre-recorded message to avoid dead air.
4) Observability & testing
• Use Agent Observability to track per-stage errors and configure retries.
• Test by forcing failures (invalid key/network block) to verify fallback behavior.
If you want, tell me:
• which language/SDK you’re using (Node/Python/etc.),
• which STT/TTS providers you plan to use,
and I’ll give a tailored code sample and testing checklist.
Sources: Sequential Pipeline Architecture for Voice Agents | LiveKit | Building Performant Voice Agents in India | LiveKit | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Pipeline nodes and hooks | LiveKit Documentation, with interactive elementsgorgeous-hydrogen-44699
05/04/2026, 7:41 AMtall-airline-16756
05/04/2026, 7:42 AMinference package. To give the right fallback guidance, could you share a few quick details about your current setup?
• Which SDK/language are you using (Node, Python, other)?
• How do you call STT/TTS today — direct HTTP calls, custom agent nodes, or a different library?
• Which STT and TTS providers are you using (Deepgram, AssemblyAI, OpenAI, vendor X, or in‑house)?
With that I’ll give a targeted pattern (code example and test checklist) for implementing reliable STT/TTS fallbacks in your exact setup.
, with interactive elementsgorgeous-hydrogen-44699
05/04/2026, 7:47 AMtall-airline-16756
05/04/2026, 7:47 AMgorgeous-hydrogen-44699
05/04/2026, 7:47 AM