FallbackAdapter is an STT wrapper that provides automatic failover between multiple STT providers.

When the primary STT fails, the adapter switches to the next available provider in the list for the active session. Failed providers are monitored by a parallel probe stream that receives the same live audio — when a probe yields a non-empty FINAL_TRANSCRIPT the provider is marked available again.

Non-streaming STTs are automatically wrapped with StreamAdapter provided a vad is passed in.

Example

import { FallbackAdapter } from '@livekit/agents';
import { STT as DeepgramSTT } from '@livekit/agents-plugin-deepgram';
import { STT as AssemblyAISTT } from '@livekit/agents-plugin-assemblyai';

const fallbackSTT = new FallbackAdapter({
sttInstances: [
new AssemblyAISTT(), // Primary
new DeepgramSTT(), // Fallback
],
});

Hierarchy (view full)

Constructors

Properties

attemptTimeoutMs: number
label: string = 'stt.FallbackAdapter'
maxRetryPerSTT: number
retryIntervalMs: number
sttInstances: stt.STT[]

Accessors

  • get model(): string
  • Get the model name/identifier for this STT instance.

    Returns string

    The model name if available, "unknown" otherwise.

    Remarks

    Plugins should override this property to provide their model information.

  • get provider(): string
  • Get the provider name for this STT instance.

    Returns string

    The provider name if available, "unknown" otherwise.

    Remarks

    Plugins should override this property to provide their provider information.

  • get status(): STTStatus[]
  • Returns the current status of all STT instances, including availability and background recovery state.

    Returns STTStatus[]

Methods