Skip to main content
Early Beta — The Web SDK is in early beta. APIs may change between releases.

Overview

The Voice Pipeline provides complete STT -> LLM -> TTS orchestration for building voice conversation experiences in the browser. It handles the full flow: transcribe user speech, generate an AI response with streaming, and synthesize spoken audio.

Package Imports

The Voice Pipeline uses classes from all three packages:

Required Models

The voice pipeline requires exactly 4 models loaded simultaneously. Each serves a distinct purpose:
VAD is NOT a replacement for STT. This is a common source of confusion. VAD (Voice Activity Detection) only detects when someone is speaking — it outputs speech boundaries (started/ended), not text. STT (Speech-to-Text) performs actual transcription of audio to text. You need both: VAD to segment the audio stream into speech chunks, and STT to transcribe those chunks into text.If your voice feature can detect speech activity but produces no transcription text, you are likely missing the STT model. A 5MB VAD model cannot do speech recognition — you need a Whisper model (~105MB+) for that.

Setup

Before using the Voice Pipeline, ensure all 4 models are loaded with coexist: true so they stay in memory simultaneously:
coexist: true is required. Without it, loading a new model unloads the previous one, and the voice pipeline needs all 4 models (VAD, STT, LLM, TTS) in memory simultaneously.
Verify all 4 models are loaded before starting the pipeline. Use ModelManager.getLoadedModel() to check each category:
If STT is missing, the pipeline will fail silently or produce empty transcriptions. If VAD is missing, speech detection won’t trigger.

Basic Usage

API Reference

VoicePipeline

VoicePipelineOptions

VoicePipelineCallbacks

VoicePipelineTurnResult

Complete Voice Assistant Example

This example combines VAD for automatic speech detection with the Voice Pipeline for full STT -> LLM -> TTS processing:

React Voice Assistant

VoiceAssistant.tsx

Performance

Latency Breakdown

For the fastest voice turns, use Whisper Tiny for STT, a 350M-500M LLM, and limit maxTokens to 50-60. The starter app uses maxTokens: 60 with a “1-2 sentences max” system prompt.

Error Handling

VAD

Voice Activity Detection

STT

Speech-to-Text

TTS

Text-to-Speech

LLM

Text Generation