> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. Atoms is the
> voice-agent platform.

# Pipecat

> Build real-time voice AI pipelines using Smallest AI TTS and STT with Pipecat.

This guide walks you through integrating [Smallest AI](https://smallest.ai) TTS and STT into a [Pipecat](https://github.com/pipecat-ai/pipecat) voice pipeline. Pipecat is an open-source Python framework for building real-time voice and multimodal conversational AI agents using a frame-based architecture.

## Code Example

The complete runnable example lives in the Pipecat repository:

[Pipecat Example — Smallest AI TTS + STT](https://github.com/pipecat-ai/pipecat/blob/main/examples/voice/voice-smallest.py)

## Setup

### 1. Create a Virtual Environment

```bash
python3.11 -m venv .venv
```

Activate it:

* On Linux/Mac:
  ```bash
  source .venv/bin/activate
  ```
* On Windows:
  ```bash
  .venv\Scripts\activate
  ```

### 2. Install Pipecat with Smallest AI support

The `smallest` extra installs both the TTS and STT services for Smallest AI:

```bash
pip install "pipecat-ai[smallest]"
```

To run the full voice agent example, you also need:

* **`daily`** — Daily transport, which the bot uses to manage audio rooms and connect participants
* **`openai`** — OpenAI LLM service for the language model
* **`silero`** — Silero VAD for voice activity detection and interruption handling
* **`runner`** — Pipecat development runner that creates Daily rooms automatically and serves the bot locally

```bash
pip install "pipecat-ai[smallest,daily,openai,silero,runner]"
```

### 3. Create a `.env` file

```bash
SMALLEST_API_KEY=...
DAILY_API_KEY=...
OPENAI_API_KEY=...
```

`DAILY_API_KEY` is required — the Pipecat runner creates a Daily room automatically at startup. If you want to reuse an existing room instead of creating a new one each run, set the optional `DAILY_ROOM_URL` variable.

***

## Services

### `SmallestSTTService`

```python
from pipecat.services.smallest.stt import SmallestSTTService
from pipecat.transcriptions.language import Language

stt = SmallestSTTService(
    api_key=os.getenv("SMALLEST_API_KEY"),
    settings=SmallestSTTService.Settings(
        language=Language.EN,
    ),
)
```

| Parameter  | Type       | Default       | Description                         |
| ---------- | ---------- | ------------- | ----------------------------------- |
| `api_key`  | `str`      | —             | Your Smallest AI API key (required) |
| `language` | `Language` | `Language.EN` | Language for transcription          |

The STT service connects to the Pulse real-time WebSocket endpoint (`wss://api.smallest.ai/waves/v1/pulse/get_text`) and streams audio frames from the pipeline, returning transcriptions with 64ms TTFT.

***

### `SmallestTTSService`

```python
from pipecat.services.smallest.tts import SmallestTTSService, SmallestTTSModel

tts = SmallestTTSService(
    api_key=os.getenv("SMALLEST_API_KEY"),
    output_format="pcm",
    settings=SmallestTTSService.Settings(
        model=SmallestTTSModel.LIGHTNING_V3_1_PRO,
        voice="meher",
    ),
)
```

**Constructor parameters:**

| Parameter         | Type   | Default | Description                                                                                                                                                                                                                                                                                                                     |
| ----------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `api_key`         | `str`  | —       | Your Smallest AI API key (required)                                                                                                                                                                                                                                                                                             |
| `output_format`   | `str`  | `pcm`   | Audio output format: `pcm`, `mp3`, `wav`, `ulaw`, `alaw`                                                                                                                                                                                                                                                                        |
| `word_timestamps` | `bool` | `True`  | Emit per-word `TTSTextFrame`s aligned to audio playback. Enabled by default. Supported on base-queue English + Hindi voices (`meher`, `devansh`, `kartik`, `maithili`, `liam`, `avery`); other voices silently emit no word events, so leaving this on is safe. Pass `word_timestamps=False` to fall back to whole-text frames. |

**Settings (`SmallestTTSService.Settings`):**

| Parameter  | Type               | Default              | Description                                                                                |
| ---------- | ------------------ | -------------------- | ------------------------------------------------------------------------------------------ |
| `model`    | `SmallestTTSModel` | `lightning_v3.1_pro` | TTS model. One of `lightning_v3.1`, `lightning_v3.1_pro`                                   |
| `voice`    | `str`              | model-dependent      | Voice ID. Plugin defaults: `meher` for `lightning_v3.1_pro`, `sophia` for `lightning_v3.1` |
| `language` | `Language`         | `Language.EN`        | Language for synthesis                                                                     |
| `speed`    | `float`            | `None`               | Speech speed multiplier (0.5–2.0)                                                          |

The TTS service connects to `wss://api.smallest.ai/waves/v1/tts/live` and uses WebSocket streaming for low-latency, real-time audio delivery. The `model` field is sent per-message, so switching models takes effect on the next utterance without reconnecting.

***

## Running the Example

Clone the Pipecat repository and navigate to the examples directory:

```bash
git clone https://github.com/pipecat-ai/pipecat.git
cd pipecat/examples/voice
```

Create a `.env` file with the keys listed in the Setup section above, then run:

**Daily transport — server mode (recommended):**

```bash
python voice-smallest.py -t daily
```

Open `http://localhost:7860` in your browser. The runner creates a Daily room automatically and redirects you to it.

**Daily transport — direct mode (no web server, for quick testing):**

```bash
python voice-smallest.py -d
```

The room URL is printed in the terminal. Open it in your browser to join.

The full source for `voice-smallest.py` is at [`examples/voice/voice-smallest.py`](https://github.com/pipecat-ai/pipecat/blob/main/examples/voice/voice-smallest.py). It sets up a complete interruptible voice bot using Smallest AI STT + TTS, OpenAI for the LLM, Silero VAD for interruptions, and Daily as the transport — all wired together with the Pipecat runner.

***

## Notes

* The pipeline is interruptible: if a user speaks while the bot is talking, audio stops immediately and the pipeline re-engages — no custom logic needed.
* For any issues or questions, open an issue in the [Pipecat repository](https://github.com/pipecat-ai/pipecat) or contact us on [Discord](https://discord.gg/9WtSXv26WE).