Composable Pipeline
Mix and match STT, LLM, and TTS providers. Swap Deepgram for AssemblyAI or OpenAI for Anthropic — your pipeline, your choice.
A composable SDK for speech-to-text, LLM, and text-to-speech pipelines. Mix providers, stream responses, and ship conversational AI — all from the browser.
pnpm i @lukeocodes/composite-voice@0.0.1Event-driven architecture, typed APIs, and production-ready defaults.
Mix and match STT, LLM, and TTS providers. Swap Deepgram for AssemblyAI or OpenAI for Anthropic — your pipeline, your choice.
Speculative LLM generation begins during speech recognition. Responses start before the user finishes speaking.
WebSocket reconnection with exponential backoff. Graceful fallbacks keep voice sessions alive through network hiccups.
Auto, conservative, aggressive, or detect — choose how the system handles conversational flow and interruptions.
Express, Next.js, and plain Node adapters keep API keys off the client. Zero-config proxy routing for any provider.
Abstract base classes for STT, LLM, and TTS. Build custom providers for any service with a clean, typed interface.
First-class support for leading AI services — or bring your own with extensible base classes.
Three providers, a few lines of code, and you have a working voice pipeline.
import { CompositeVoice } from "@lukeocodes/composite-voice";import { DeepgramSTT } from "@lukeocodes/composite-voice/stt";import { AnthropicLLM } from "@lukeocodes/composite-voice/llm";import { DeepgramTTS } from "@lukeocodes/composite-voice/tts";
const voice = new CompositeVoice({ stt: new DeepgramSTT({ model: "nova-3" }), llm: new AnthropicLLM({ model: "claude-sonnet-4-20250514" }), tts: new DeepgramTTS({ model: "aura-asteria-en" }),});
voice.on("transcript", (text) => console.log("User:", text));voice.on("response", (text) => console.log("AI:", text));
await voice.start();Get started with the documentation, explore the design system, or jump straight into the code.