Skip to main content

Smallest AI integration guide

How to use the Smallest AI Waves TTS plugin for LiveKit Agents.

Available in
Python

Overview

Smallest AI provides a TTS platform called Waves, which turns text into natural-sounding speech. With LiveKit's Smallest AI integration, you can convert text to audio in real time, choose different voices, and control output format and quality for your agents.

To learn more about TTS and generating agent speech, see Agent speech.

Quick reference

This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.

Installation

Install the plugin from PyPI:

pip install livekit-plugins-smallestai

Authentication

The Smallest AI plugin requires an API key.

Set SMALLEST_API_KEY in your .env file.

Usage

Use Smallest AI TTS within an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.

from livekit.plugins import smallestai
session = AgentSession(
tts=smallestai.TTS(
voice_id="irisha",
sample_rate=24000,
output_format="pcm",
),
# ... llm, stt, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

modelTTSModels | stringOptionalDefault: lightning

Model to use.

voice_idstringOptional

The voice ID for synthesis. Must be a valid Smallest AI voice identifier.

sample_ratenumberOptionalDefault: 24000

Target audio sample rate in Hz. Match the rate to the rest of your audio pipeline to avoid resampling artifacts.

output_formatTTSOutputFormat | stringOptionalDefault: pcm

Encoding format for synthesized audio. Select a format based on if you want raw audio for streaming/processing or compressed for storage/playback.

Additional resources

The following resources provide more information about using Smallest AI with LiveKit Agents.

Voice AI quickstart

Get started with LiveKit Agents and Smallest AI TTS.