Runbook: TTS (Text-to-Speech)
Service overview
Section titled “Service overview”TTS runs on RunPod serverless (kc-tts-{env}). Two models: IndexTTS2 (default high-quality) and CosyVoice2 (voice-clone path). The orchestrator dispatches tts jobs with a voice_id payload.
Symptoms → Diagnosis → Fix
Section titled “Symptoms → Diagnosis → Fix”TTS job fails with voice_not_found
Section titled “TTS job fails with voice_not_found”Diagnosis
- Query
voice_clonetable for thevoice_idreferenced in the failing job. - Check R2 bucket
kc-clone-eu-{env}for the corresponding model artefact.
Fix
- If model artefact is missing from R2: re-run the voice clone pipeline for the user.
- If
voice_clonerow is missing: check whether the clone job succeeded; look atmedia_jobfor the original clone job.
Audio output is silent / corrupted
Section titled “Audio output is silent / corrupted”Diagnosis
- Check
media_job.metadatafor the job’s output URL. - Download the object from R2 and inspect with
ffprobe. - Check RunPod endpoint logs for CUDA OOM or model load errors.
Fix
- CUDA OOM: reduce batch size in endpoint config, or upgrade GPU tier.
- Model load error: check that the model artefact in R2 is complete (check size vs known-good).
Latency > 30 s for short texts
Section titled “Latency > 30 s for short texts”Diagnosis
- Cold start: RunPod endpoint scaled to 0 workers.
Fix
- Set
min_workers: 1for production endpoint (accepted steady-state cost). - Use
keep_aliveflag on the RunPod endpoint to extend idle window.
Useful queries
Section titled “Useful queries”-- Recent TTS failuresSELECT id, status, metadata->>'error', created_atFROM media_jobWHERE job_type = 'tts' AND status = 'failed'ORDER BY created_at DESCLIMIT 20;