Skip to main content

Overview

PocketTTSService provides local, CPU-only text-to-speech synthesis using the pocket-tts streaming model. It runs entirely on the host machine with no external API calls or authentication required. Model weights and voice prompts are downloaded from Hugging Face on first use. The voice may be a predefined voice name (e.g. "alba"), a local .wav file to clone, an exported .safetensors voice state, or an hf:// path. The voice can be changed at runtime; the language cannot, since model weights are loaded per language.

Pocket TTS API Reference

Pipecat’s API methods for Pocket TTS integration

Example Implementation

Complete example with voice conversation

pocket-tts Repository

Official pocket-tts project and documentation

Settings Update Example

Example showing runtime settings updates

Installation

To use Pocket TTS, install the required dependencies:
This installs pocket-tts>=2.1.0 and its dependencies.

Prerequisites

Local Setup

Pocket TTS runs locally and does not require an API key or external service. On first use, the service automatically downloads model weights and voice prompts from Hugging Face, which may block for a while.
The initial model download may take a few minutes depending on your connection speed. Subsequent runs use the cached files.

Configuration

PocketTTSService

float
default:"None"
Sampling temperature for audio generation. When None, uses the pocket-tts model default.
bool
default:"False"
Quantize model weights for faster CPU inference (requires the torchao package).
PocketTTSService.Settings
default:"None"
Runtime-configurable settings. Defaults to the "alba" voice and English. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument using PocketTTSService.Settings(...). These can be updated mid-conversation with TTSUpdateSettingsFrame. See Service Settings for details.

Supported Languages

Pocket TTS supports the following languages:

Usage

Basic Setup

With Language Configuration

With Voice Cloning

With Quantization

Notes

  • Fully local: Pocket TTS runs entirely on the host machine using CPU. No API keys, network access, or external services are required after the initial model download.
  • Model caching: Model weights and voice prompts are downloaded from Hugging Face on first use and cached locally. Subsequent runs use the cached files.
  • Voice cloning: The service supports voice cloning from .wav files, exported .safetensors voice states, or hf:// paths.
  • Runtime voice updates: The voice can be changed mid-conversation using TTSUpdateSettingsFrame. The voice state is re-derived lazily on the next utterance.
  • Language immutability: The language cannot be changed at runtime since model weights are loaded per language.
  • Streaming output: The service uses pocket-tts’ streaming API, delivering audio frames incrementally as they are generated.
  • Metrics support: The service supports TTFB (time to first byte) and usage metrics for performance monitoring.