← Back to PRs

#10870: feat(tts): add pocket-tts provider for local CPU-based TTS

by fayrose open 2026-02-07 03:57 View on GitHub →
docs commands stale size: L
## Summary Adds support for [Pocket TTS](https://github.com/kyutai-labs/pocket-tts) as a new TTS provider. ## Features - **Local, offline TTS** - No API key required, runs entirely on CPU - **Fast** - ~200ms latency after model loads - **Voice options** - 8 built-in voices + voice cloning via reference audio - **Auto-start** - Optional automatic server spawning - **Doctor integration** - Checks for misconfigurations ## Configuration ```json5 { messages: { tts: { provider: "pocket", pocket: { enabled: true, // default baseUrl: "http://localhost:8000", // default voice: "alba", // default autoStart: false // default } } } } ``` ## Notes - Output format is WAV (uncompressed, ~5-10x larger than MP3) - First request takes 10-30s for model loading (~400MB download on first run) - Falls back to other providers if server unavailable ## Testing - [x] Unit tests for helpers (parsePocketBaseUrl, isValidPocketVoice, etc.) - [x] Manual integration testing against real pocket-tts server - [x] TypeScript compiles cleanly - [x] Doctor checks work ## Files Changed | File | Change | |------|--------| | `src/tts/tts.ts` | Pocket provider implementation | | `src/tts/tts.test.ts` | Unit tests | | `src/config/types.tts.ts` | Config schema | | `src/commands/doctor-tts.ts` | NEW - Doctor TTS checks | | `src/commands/doctor.ts` | Import doctor-tts | | `docs/providers/pocket-tts.md` | NEW - Full documentation | | `docs/tts.md` | Add pocket to provider list | --- *Rebased off main (Feb 2026)* <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> - Adds a new `pocket` TTS provider with config defaults, provider ordering, and WAV output handling in `src/tts/tts.ts`. - Implements Pocket server health checks and an optional auto-start path that spawns `pocket-tts serve` locally. - Extends TTS config schema (`src/config/types.tts.ts`), adds `doctor` checks for common Pocket misconfiguration, and updates docs + unit tests accordingly. <h3>Confidence Score: 4/5</h3> - Generally safe to merge, but the new Pocket TTS auto-start adds global process signal handlers that should be scoped/guarded to avoid listener leaks in long-running or watch-mode processes. - Changes are mostly additive with tests and clear configuration defaults. The main correctness issue found is top-level `process.on(...)` registration in a commonly-imported module, which can create unwanted global side effects and listener accumulation. - src/tts/tts.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs