Skip to content
Open Source

Build voice interfacesfor the web

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.1

Everything you need for voice

Event-driven architecture, typed APIs, and production-ready defaults.

Composable Pipeline

Mix and match STT, LLM, and TTS providers. Swap Deepgram for AssemblyAI or OpenAI for Anthropic — your pipeline, your choice.

Eager Streaming

Speculative LLM generation begins during speech recognition. Responses start before the user finishes speaking.

Resilient Connections

WebSocket reconnection with exponential backoff. Graceful fallbacks keep voice sessions alive through network hiccups.

Turn-Taking Strategies

Auto, conservative, aggressive, or detect — choose how the system handles conversational flow and interruptions.

Server-Side Proxy

Express, Next.js, and plain Node adapters keep API keys off the client. Zero-config proxy routing for any provider.

Extensible Providers

Abstract base classes for STT, LLM, and TTS. Build custom providers for any service with a clean, typed interface.

Your pipeline, your providers

First-class support for leading AI services — or bring your own with extensible base classes.

Speech-to-Text

  • Deepgram
  • AssemblyAI
  • Web Speech API

Large Language Models

  • Anthropic
  • OpenAI
  • Groq
  • Google Gemini
  • Mistral
  • WebLLM

Text-to-Speech

  • Deepgram
  • OpenAI
  • ElevenLabs
  • Cartesia
  • Web Speech API

Up and running in minutes

Three providers, a few lines of code, and you have a working voice pipeline.

voice.ts
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();

Ready to build?

Get started with the documentation, explore the design system, or jump straight into the code.