> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.smallest.ai/llms.txt.
> For full documentation content, see https://docs.smallest.ai/llms-full.txt.

# 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

tts = SmallestTTSService(
    api_key=os.getenv("SMALLEST_API_KEY"),
    settings=SmallestTTSService.Settings(
        voice="sophia",
    ),
)
```

| Parameter | Type  | Default  | Description                         |
| --------- | ----- | -------- | ----------------------------------- |
| `api_key` | `str` | —        | Your Smallest AI API key (required) |
| `voice`   | `str` | `sophia` | Voice ID for synthesis              |

The TTS service uses WebSocket streaming for low-latency, real-time audio delivery.

***

## 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).