Text-to-speech CLI using Qwen3-TTS or Kokoro TTS
Project description
ltts
Quick CLI for local text-to-speech with two backends: Qwen3-TTS (default) and Kokoro TTS.
Install
Recommended (fast, reproducible):
uv tool install ltts
Run without installing:
uvx ltts "hello world" --say
With pip:
pip install ltts
NVIDIA GPU (Optional)
For faster inference on NVIDIA GPUs:
pip install 'ltts[cuda]'
Usage
# Generate speech (saves to output.mp3 by default)
ltts "Hello, world!"
# Play through speakers
ltts "Hello, world!" --say
# Save to specific file
ltts "Hello, world!" -o speech.wav
# Read from stdin
echo "Hello from pipe" | ltts --say
cat article.txt | ltts -o article.mp3
Backends
Qwen3-TTS (default)
Higher quality with voice cloning and emotional control. Supports 10 languages.
# Preset voices
ltts "Hello, world!" -v Ryan --say # English male (default)
ltts "Hello, world!" -v Aiden --say # English male
ltts "你好世界" -v Vivian --say # Chinese female
ltts "こんにちは" -v Ono_Anna --say # Japanese female
ltts "안녕하세요" -v Sohee --say # Korean female
# Voice cloning (3+ seconds of reference audio)
ltts "Hello in your voice" --ref-audio voice.wav --say
ltts "Hello" --ref-audio voice.wav --ref-text "transcript" --say
# Emotional control
ltts "I can't believe we won!" --instruct "speak with excitement" --say
# Smaller model for faster inference
ltts "Hello world" --model-size 0.6B --say
Preset voices: Ryan, Aiden (English), Vivian, Serena, Dylan, Eric, Uncle_Fu (Chinese), Ono_Anna (Japanese), Sohee (Korean)
Languages: en, zh, ja, ko, de, fr, es, pt, it, ru
Kokoro TTS
Lightweight with 50+ voices. Supports streaming for faster time-to-first-audio.
# Use Kokoro backend
ltts "Hello world" -b kokoro -v af_heart --say
ltts "こんにちは" -b kokoro -v jf_alpha --say
# Stream chunks as generated (lower latency)
ltts "Hello world" -b kokoro --say --chunk
Voices: af_heart, af_alloy, af_bella, am_adam, am_michael (American), bf_alice, bf_emma, bm_daniel (British), jf_alpha, jm_kumo (Japanese), zf_xiaobei, zm_yunxi (Chinese), ef_dora, em_alex (Spanish), ff_siwis (French), and more.
Full voice list: https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md
Options
# Device selection
ltts "Hello" -d cpu --say # CPU (default)
ltts "Hello" -d cuda --say # NVIDIA GPU
ltts "Hello" -d mps --say # Apple Silicon
# Output formats
ltts "test" -o out.mp3 # MP3 (default)
ltts "test" -o out.wav # WAV
ltts "test" -o out.ogg # OGG
ltts "test" -o out.flac # FLAC
# Language override
ltts "Bonjour" -l fr --say
Notes
- First run downloads models to
~/.cache/huggingface/(~3GB for Qwen 1.7B, ~330MB for Kokoro) - Audio playback (
--say) runs at 24 kHz - On Linux, ensure PulseAudio/PipeWire is running for audio playback
Development
uv sync
uv run ltts "hello world" --say
uv run ltts "hello world" -b kokoro -v af_heart --say
./scripts/release.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ltts-0.4.2.tar.gz.
File metadata
- Download URL: ltts-0.4.2.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afc257525b511d00da72cb4e0a4fedffbb9a28ac2b1f260c71d9ffb26d7ccd47
|
|
| MD5 |
e601294d55ad4410d5609a6134786e6a
|
|
| BLAKE2b-256 |
87872625e4118ca69aefd0cefd7ee6a3590b9b1458e5904991b0cd8f574c5910
|
File details
Details for the file ltts-0.4.2-py3-none-any.whl.
File metadata
- Download URL: ltts-0.4.2-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a14c29792042f614b8c0867a970a3dd78ac19e782ebed499b8e58a43d97eccf
|
|
| MD5 |
c8eb18527c90db88b6ef821b123f606f
|
|
| BLAKE2b-256 |
72b410212c7482cefad2ff2c4661f0c9c6e7b20a9c2de3980b89053d8b1b8468
|