Integrazione Kyutai TTS
Esegui localmente i modelli TTS di Kyutai. Questa guida copre Pocket TTS (CPU) e TTS 1.6B (GPU), con server compatibili OpenAI inclusi in Libre WebUI.
Panoramica
| Modello | Parametri | Dispositivo | Ideale per |
|---|---|---|---|
| Pocket TTS | 100M | Solo CPU | Laptop, ambienti con poche risorse |
| TTS 1.6B | 1.6B | GPU/MPS/CPU | Server, sintesi di alta qualità |
Entrambi usano CALM (Continuous Audio Language Models) e supportano clonazione da campioni.
Pocket TTS (CPU)
TTS leggero in tempo reale sulla CPU, senza GPU.
Requisiti
| Componente | Minimo |
|---|---|
| Python | 3.10 - 3.14 |
| PyTorch | 2.5+ |
| RAM | 4GB |
| Disco | 500MB |
Avvio rapido
cd examples/kyutai-tts-server
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start server
python server.py
Server su http://localhost:8200.
Test
curl http://localhost:8200/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "kyutai-tts", "input": "Hello, welcome to Libre WebUI!", "voice": "alba"}' \
--output speech.wav
Voci
| Voce | Descrizione |
|---|---|
| Alba | Femminile, chiara e naturale |
| Marius | Maschile, tono caldo |
| Javert | Maschile, autorevole |
| Jean | Maschile, delicata |
| Fantine | Femminile, morbida |
| Cosette | Femminile, giovane |
| Eponine | Femminile, espressiva |
| Azelma | Femminile, brillante |
Prestazioni
- Circa 6x realtime su MacBook Air M4
- Circa 200ms al primo chunk
- Solo 2 core CPU
TTS 1.6B (GPU)
Alta qualità con accelerazione e selezione CUDA > MPS > CPU.
Requisiti
| Componente | Minimo | Consigliato |
|---|---|---|
| Python | 3.10+ | 3.12 |
| GPU VRAM | 6GB | 8GB+ |
| RAM | 8GB | 16GB+ |
| Disco | 4GB | 8GB |
Piattaforme
| Piattaforma | Backend | Note |
|---|---|---|
| NVIDIA GPU | CUDA | Prestazioni migliori, bfloat16 |
| Apple Silicon | MPS | Usa float16 |
| CPU | PyTorch | Più lenta, float32 |
Avvio rapido
cd examples/kyutai-tts-1.6b-server
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install PyTorch with CUDA (for NVIDIA GPUs)
pip install torch --index-url https://download.pytorch.org/whl/cu121
# Install dependencies
pip install -r requirements.txt
# Start server (auto-detects GPU)
python server.py
Server su http://localhost:8201.
Selezione dispositivo
# Auto-detect (CUDA > MPS > CPU)
python server.py
# Force specific device
python server.py --device cuda
python server.py --device mps
python server.py --device cpu
Test
curl http://localhost:8201/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"model": "kyutai-tts-1.6b", "input": "Hello from the GPU!", "voice": "alba"}' \
--output speech.wav
Voci
Alba MacKenna (CC BY 4.0):
| Voce | Stile |
|---|---|
alba / alba-casual | Conversazione informale |
alba-merchant | Personaggio mercante |
alba-announcer | Annunciatore |
Expresso (CC BY-NC 4.0 - non commerciale):
| Voce | Emozione |
|---|---|
expresso-happy | Felice |
expresso-sad | Triste |
expresso-angry | Arrabbiata |
VCTK (CC BY 4.0):
vctk-p225,vctk-p226,vctk-p227,vctk-p228
Clonazione vocale
Entrambi i server clonano da file audio.
Pocket TTS
# From local file
curl http://localhost:8200/v1/audio/voice-clone \
-F "input=Hello from a cloned voice" \
-F "reference_audio=@my_voice.wav" \
--output cloned.wav
# From HuggingFace URL
curl http://localhost:8200/v1/audio/voice-clone-url \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world!",
"voice_url": "hf://kyutai/tts-voices/alba-mackenna/casual.wav"
}' \
--output speech.wav
TTS 1.6B
Passa un percorso Hugging Face come voice:
curl http://localhost:8201/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "kyutai-tts-1.6b",
"input": "Custom voice synthesis",
"voice": "hf://kyutai/tts-voices/vctk/p230.wav"
}' \
--output speech.wav
Riferimento API
Generazione vocale
Endpoint: POST /v1/audio/speech
{
"model": "kyutai-tts",
"input": "Text to convert to speech",
"voice": "alba",
"response_format": "wav",
"stream": false
}
| Parametro | Tipo | Default | Descrizione |
|---|---|---|---|
model | string | varies | kyutai-tts o kyutai-tts-1.6b |
input | string | required | Testo da sintetizzare (max 10.000 caratteri) |
voice | string | alba | Nome o percorso Hugging Face |
response_format | string | wav | Formato (solo wav) |
stream | boolean | false | Streaming (solo Pocket TTS) |
cfg_coef | float | 2.0 | Classifier-free guidance (solo 1.6B) |
Risposta: file audio (audio/wav)
Alias OpenAI
| Voce OpenAI | Pocket TTS | TTS 1.6B |
|---|---|---|
alloy | alba | alba |
echo | marius | vctk-p225 |
fable | cosette | expresso-happy |
onyx | javert | vctk-p226 |
nova | fantine | alba-announcer |
shimmer | eponine | alba-merchant |
Elenco voci
Endpoint: GET /v1/voices
Controllo stato
Endpoint: GET /health
Configurazione plugin
Pocket TTS
Abilita in Impostazioni > Plugin > Kyutai TTS
File: plugins/kyutai-tts.json
{
"id": "kyutai-tts",
"name": "Kyutai TTS",
"type": "tts",
"endpoint": "http://localhost:8200/v1/audio/speech",
"capabilities": {
"tts": {
"config": {
"voices": [
"Alba",
"Marius",
"Javert",
"Jean",
"Fantine",
"Cosette",
"Eponine",
"Azelma"
],
"default_voice": "Alba",
"supports_streaming": true,
"no_auth_required": true
}
}
}
}
TTS 1.6B
Abilita in Impostazioni > Plugin > Kyutai TTS 1.6B
File: plugins/kyutai-tts-1.6b.json
{
"id": "kyutai-tts-1.6b",
"name": "Kyutai TTS 1.6B",
"type": "tts",
"endpoint": "http://localhost:8201/v1/audio/speech",
"capabilities": {
"tts": {
"config": {
"voices": [
"Alba",
"Alba-Casual",
"Alba-Merchant",
"Alba-Announcer",
"Expresso-Happy",
"Expresso-Sad",
"Expresso-Angry",
"VCTK-P225",
"VCTK-P226"
],
"default_voice": "Alba",
"supports_streaming": true,
"no_auth_required": true
}
}
}
}
Accesso di rete
# Start server on all interfaces
python server.py --host 0.0.0.0
# Access from another machine
curl http://192.168.1.100:8200/v1/audio/speech ...
Aggiorna l'endpoint:
{
"endpoint": "http://192.168.1.100:8200/v1/audio/speech"
}
Risoluzione dei problemi
Download modello non riuscito
# Set token for gated models
export HF_TOKEN=hf_...
Memoria CUDA esaurita
- Chiudi altre app GPU.
- Prova
cfg_coef=1.5. - Usa Pocket TTS su CPU.
Qualità audio
- Suono robotico: prova un'altra voce.
- Audio tagliato: il testo può essere lungo; il server crea chunk.
- Pronuncia errata: ottimizzato per inglese e francese.
Problemi MPS (Apple Silicon)
RuntimeError: MPS backend error
Se persiste, forza CPU:
python server.py --device cpu
Confronto con Qwen3-TTS
| Funzione | Kyutai Pocket | Kyutai 1.6B | Qwen3-TTS |
|---|---|---|---|
| Parametri | 100M | 1.6B | 0.6B-1.7B |
| GPU richiesta | No | Opzionale | Sì |
| Lingue | Inglese | EN/FR | 10 lingue |
| Clonazione | Sì | Sì | Sì |
| Design vocale | No | No | Sì |
| Porta | 8200 | 8201 | 8100 |
Scegli Kyutai per uso inglese e setup semplice; Qwen3-TTS per multilingua e voice design.
Risorse
- Kyutai TTS - pagina ufficiale
- Pocket TTS GitHub - modello CPU
- Delayed Streams Modeling - modello 1.6B
- Raccolta voci - voci disponibili
- Scheda modello - dettagli tecnici