Skip to main content

Web and Node.js SDK

The Web SDK shares one TypeScript API across modern browsers and Node.js. Browsers use WebAssembly and Cache API storage; Node uses the same ONNX Runtime Web engine with filesystem storage.

Browser and NodeWebAssembly or Node.js 20+
Rich outputPCM, WAV, MP3, streaming, playback, and word timings
Source previewClone and build the repository until the npm package is published
import {KittenTTS, createBrowserAudioPlayer} from '@kittentts/web';

const tts = await KittenTTS.create({
model: 'nano-int8',
player: createBrowserAudioPlayer(),
});

await tts.speak('This voice is generated in the browser.');

Capabilities

  • Four local models and eight voices.
  • Browser audio helper and custom player interface.
  • WAV and MP3 encoding.
  • Sentence-by-sentence async streaming and FIFO playback queue.
  • Cache API, memory, Node filesystem, or custom asset storage.
  • Preloaded bytes, local paths, or self-hosted assets.
  • Self-hosted ONNX Runtime WASM configuration.

Repository: KittenML/KittenTTS-web