The Problem

Pocket TTS addresses the pain point of running high-quality text-to-speech locally without GPU dependencies. The project markets itself as "designed to run efficiently on CPUs" and claims "does not require the gpu version of PyTorch," positioning itself for users who need TTS capability in constrained environments or prefer to avoid GPU overhead. However, the repository's dependency declaration lacks a lockfile, creating reproducibility concerns for anyone building or deploying the system.

What This Does

This is a TTS inference and training suite centered in pocket_tts/ (46 files). The object model composes three core components: pocket_tts/models/tts_model.py defines the main TTS architecture, pocket_tts/models/mimi.py handles the audio codec (Mimi), and pocket_tts/models/flow_lm.py provides the flow-based language modeling. Conditioning is handled through pocket_tts/conditioners/text.py for text encoding, base.py as the conditioner base. The module layer includes attention, convolution, MLP, and RoPE implementations in pocket_tts/modules/. Configuration lives in pocket_tts/config/ as YAML files per language (english, french, german, italian, portuguese, spanish), with 24-layer high-quality variants suffixed _24l. Data utilities are in pocket_tts/data/audio.py and pocket_tts/data/audio_utils.py. The training pipeline lives in training/ (29 files), including training/train.py, training/dataloader.py, and training/modules/model.py — a separate but structurally similar model builder. The entry points are pocket_tts/__main__.py, pocket_tts/main.py, and the static HTML at pocket_tts/static/index.html. A pyproject.toml at the root declares dependencies; an uv.lock exists but no requirements.txt or setup.py pins are committed, meaning installs via pip install pocket-tts may resolve to non-pinned versions.

How It Is Wired

Execution begins at the CLI entry pocket_tts main.py or the uvx/pip console script, which routes to pocket_tts/__main__.py. That file parses CLI arguments (voice, language, text) and invokes the generation pipeline. The generation flow traces: CLI → argument parsing → pocket_tts/main.py load_config → model instantiation from config YAML → pocket_tts/models/tts_model.py forward pass → pocket_tts/models/mimi.py decode → audio output. For training, training/train.py orchestrates the loop, referencing training/dataloader.py for data loading and training/modules/model.py for the training-mode TTS model construction. The model weights are loaded via pocket_tts/utils/weights_loading.py. Outside the process, the system touches the filesystem for audio output (default ./tts_output.wav) and config YAML reads; no database or network calls are made during inference beyond what Hugging Face model downloads entail on first run. The call graph is shallow — typically 3-4 hops from entry to audio output — but the absence of a lockfile means the exact dependency graph is unstable across reinstalls.

How To Use It

Setup: Install with uvx pocket-tts generate for an isolated environment, or pip install pocket-tts as the README documents. The .python-version file at the root suggests Python 3.10–3.14 compatibility. PyTorch 2.5+ is required; the non-CUDA variant is sufficient.

Configuration: Config YAMLs reside in pocket_tts/config/. The default is english.yaml; larger 24-layer variants like english_2026-04_24l.yaml are available for higher quality at the cost of speed. Language-specific configs exist for french, german, italian, portuguese, and spanish. The --config CLI flag accepts local paths, https:// URLs, or hf:// Hugging Face paths (e.g., hf://<repo_id>/<path>[@revision]).

Running it: Generate speech from the CLI:

uvx pocket-tts generate --text "Hello, world!" --voice alba

or with pip:

pocket-tts generate --text "Hello, world!" --voice alba

The default language is english; non-english languages use the _24l suffix (e.g., --language italian_24l). The Python API imports pocket_tts and calls pocket_tts.text_to_speech() or similar; the API surface is documented in docs/API Reference/python-api.md.

Real-World Use

A developer integrating on-device TTS into a desktop application can use the Python API without GPU runtime:

from pocket_tts import TTS
tts = TTS(language="english", voice="alba")
wav = tts.synthesize("This is a test of local TTS on CPU only.")
wav.save("output.wav")

This runs on ~2 CPU cores, generates the first audio chunk in ~200ms, and processes at ~6x real-time speed on a MacBook Air M4 — suitable for background generation or interactive UIs where latency must stay under a second.

Code Health & Issues

  • Low/Risk — Dependencies declared without a lockfile: pyproject.toml lists dependencies but no uv.lock or similar pinning file is committed to version control, meaning pip install pocket-tts may resolve to different dependency sets across environments. The uv.lock file exists at the root but is not referenced in the build pipeline consistently.

Beyond the measured finding, the SDLC shows: 16 test files across the repo and training/ (covering audio, CLI generation, Python API, quantization, and unit tests), but the test coverage appears skewed toward the training pipeline; the main pocket_tts/ inference code has fewer dedicated tests. No LICENSE file is present at the root of this clone (the parent kyutai-labs repo uses an Apache 2.0 license, but this fork's LICENSE is absent), which is a legal gap for distribution. CI/CD runs via GitHub Actions (workflows in .github/workflows/ for tests, publish, and pages), but the Dockerfile and docker-compose.yaml suggest container builds are supported, yet no .dockerignore exclusions are evident for node_modules or __pycache__.

The Bottom Line

Pocket TTS delivers on its core promise: a sub-100M-parameter TTS model that runs entirely on CPU with latencies competitive with GPU-backed systems. The codebase is well-organized into clear model, conditioner, and module layers, and the dual CLI/Python API makes it accessible. The lockfile gap and missing license file are the most significant non-technical barriers to reproducible, shareable deployment. Use it if you need a lightweight, CPU-first TTS solution and are comfortable pinning dependencies manually; avoid if you require strict reproducibility without manual dependency locking.