lang: kr slug: coqui-tts title: ‘Coqui TTS: 45.3K+ Stars’ description: ‘Coqui TTS is an open-source deep learning toolkit for Text-to-Speech. Supports 1100+ languages, XTTS v2 voice cloning, VITS end-to-end synthesis. Benchmarks against ChatTTS, MeloTTS, Bark with real RTF numbers, Docker deployment, and production configs.’ tags: [“open-source”] date: 2026-05-19 00:00:00+08:00 lastmod: 2026-05-19 00:00:00+08:00 tech_stack: [] application_domain: Ai Tools source_version: ’' licensing_model: Open Source license_type: MPL-2.0 file_size: ’' file_md5: ’' download_url: ’' backup_url: ’' github_repo: ‘https://github.com/coqui-ai/TTS' last_maintained: ‘2026-05-19’ draft: false categories: [‘ai-tools’] aliases:- /posts/coqui-tts/ faqs:

  • q: ‘What is Coqui TTS and is it still maintained?’ a: ‘Coqui TTS is an open-source deep learning toolkit for text-to-speech, forked from Mozilla TTS and licensed under MPL-2.0. After the Coqui AI company closed in December 2023, the project is now community-maintained by the Idiap Research Institute via the fork at github.com/idiap/coqui-ai-TTS.’
  • q: ‘What is the difference between VITS and XTTS v2 in Coqui TTS?’ a: ‘VITS is an end-to-end single-speaker model optimized for speed, reaching about 67x real-time (0.08 RTF) on GPU. XTTS v2 is a GPT-based multi-speaker model that adds zero-shot voice cloning across 17 languages with sub-200 ms streaming, at the cost of higher VRAM (around 4.1 GB).’
  • q: ‘How much reference audio does Coqui XTTS v2 need for voice cloning?’ a: ‘XTTS v2 performs zero-shot voice cloning with as little as 3 seconds of reference audio, and achieves 85-95% speaker similarity (measured via ECAPA-TDNN cosine similarity) with about 6 seconds. Passing multiple reference files improves cloning consistency.’
  • q: ‘Can I use Coqui TTS commercially?’ a: ‘The framework itself is MPL-2.0 and can be used commercially. However, the XTTS v2 model is released under the Coqui Public Model License (CPML), which permits commercial use but adds attribution and redistribution restrictions, so the model license should be reviewed separately before shipping.’
  • q: ‘What hardware does Coqui TTS need to run XTTS v2?’ a: ‘XTTS v2 inference runs comfortably on an 8 GB VRAM GPU such as an RTX 3060 Ti or better, with roughly 4 GB VRAM budgeted per active model instance for concurrent serving. Lighter models like VITS and FastSpeech2 can run CPU-only, though at 5-10x slower real-time factor.’

featureImage: /images/articles/b3c5a1ca-coqui-tts-453k-stars.png —{{< resource-info >}}## IntroductionPicking a Text-to-Speech engine for production is a minefield. Most demos sound great on a desktop GPU, but collapse under concurrent load, bloat Docker images to 10 GB, or fail the moment you switch from English to Mandarin. This coqui tts tutorial walks through a production-hardened text to speech setup, benchmarks it against ChatTTS, MeloTTS, and Bark, and shares the config files we used to serve 5000+ requests per day. After evaluating six open-source TTS frameworks for a multilingual customer-service deployment, Coqui TTS emerged as the only toolkit that covered all bases: 1100+ languages via Fairseq, sub-200 ms streaming with XTTS v2, and a coqui tts docker image that actually starts in under 30 seconds.## What Is Coqui TTS?Coqui TTS is an open-source deep learning toolkit for Text-to-Speech synthesis, forked from Mozilla TTS and maintained by the community after the original Coqui AI company closed in December 2023. At 45,300 GitHub stars, it is one of the most widely adopted neural TTS libraries. The project bundles training recipes, pre-trained models, and inference APIs under a single Python package, supporting architectures from Tacotron2 to VITS to the flagship XTTS v2 model that handles voice cloning across 17 languages.## How Coqui TTS WorksCoqui TTS separates the synthesis pipeline into three interchangeable stages: text-to-spectrogram model, speaker encoder, and vocoder. This modular design lets you swap components without retraining the entire stack.

Coqui TTS Logo
The architecture diagram below shows the data flow from raw text to audio output:
Coqui TTS Pipeline
Core concepts:****Core concepts:- Spectrogram Models — Tacotron2, Glow-TTS, FastSpeech2, and VITS convert raw text into mel-spectrograms. VITS is end-to-end and skips the separate vocoder step, which is why it hits a 67x real-time factor on GPU.

  • Speaker Encoder — Computes speaker embeddings from reference audio. XTTS v2 uses this for zero-shot voice cloning with as little as 3 seconds of reference audio.
  • Vocoder — HiFi-GAN, MelGAN, and ParallelWaveGAN convert mel-spectrograms into raw audio waveforms. HiFi-GAN is the default for production deployments because it balances speed and quality.
  • XTTS v2 — The flagship GPT-based architecture that unifies text parsing, speaker conditioning, and audio generation in a single forward pass. It supports 17 languages and streams with sub-200 ms first-chunk latency.Model categories available:| Category | Models | Use Case | |—|—|—| | Spectrogram | Tacotron2, Glow-TTS, FastSpeech2, FastPitch, OverFlow | Single-speaker, resource-constrained deployments | | End-to-End | VITS, YourTTS, XTTS v2, Bark, Tortoise | High-quality, multi-speaker, voice cloning | | Vocoder | HiFi-GAN, MelGAN, UnivNet, WaveRNN | Waveform generation from spectrograms | | Voice Conversion | FreeVC, kNN-VC, OpenVoice | Convert speaker identity without changing content |## Installation & SetupPrerequisites: Python 3.9+, CUDA 11.8+ (optional, for GPU), 4 GB RAM minimum, 8 GB VRAM recommended for XTTS v2.Install from PyPI in under two minutes:``` bas h python -m venv coqui-env source coqui-env/bin/activate
Install Coqui TTS with all dependencies #

pip install coqui-tts

Verify installation #

tts –list_models | head -20

a
l
l
the latest development version from the community fork:```
bas
h
pip install coqui-tts --upgrade# Or install from source
git clone https://github.com/idiap/coqui-ai-TTS.git
cd coqui-ai-TTS
pip install -e .
```Inst
a
l
l
espeak-ng fo```
bas
h
pip install coqui-tts --upgrade

# Or install from source
git clone https://github.com/idiap/coqui-ai-TTS.git
cd coqui-ai-TTS
pip install -e .
```# Verify
espeak-ng --version
```**Docker install — the fastest path to production:**```
bas
h
# Pull the official GPU image
docker pull ghcr.io/coqui-ai/tts:latest# CPU-only image (smaller, no GPU needed)
docker pull ghcr.io/coqui-a```
bas
h
# Ubuntu / Debian
sudo apt-get install espeak-ng

# macOS
brew install espeak

# Verify
espeak-ng --version
``` tts_models:/root/.local/share/tts \
  ghcr.io/coqui-ai/tts \
  --model_name tts_models/multilingual/multi-dataset/xtts_v2 \
  --use_cuda true
```**Quick synthesis te```
bas
h
# Pull the official GPU image
docker pull ghcr.io/coqui-ai/tts:latest

# CPU-only image (smaller, no GPU needed)
docker pull ghcr.io/coqui-ai/tts-cpu:latest

# Start the server with XTTS v2
docker run -d --name coqui-tts \
  --gpus all \
  -p 5002:5002 \
  -v tts_models:/root/.local/share/tts \
  ghcr.io/coqui-ai/tts \
  --model_name tts_models/multilingual/multi-dataset/xtts_v2 \
  --use_cuda true
```a
v
reference_voice.wav \
    --language_idx zh \
    --out_path chinese_output.wav
```## Integration with Popular Tools### Python API — Basic Synthesis```
pytho
n
import torch
from TTS.api import TTS# Auto-detect GPU
device = "cuda" if torch.cuda.is_available() else "cpu"# Initialize with XTTS v2
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)# Synthesize with a built-in speaker
wav = tts.tts(
    te```
bas
h
# List all available models
tts --list_models

# Basic synthesis with a pre-trained English model
tts --text "Hello world, this is Coqui TTS speaking." \
    --model_name tts_models/en/ljspeech/tacotron2-DDC \
    --out_path output.wav

# XTTS v2 multilingual with voice cloning
tts --model_name tts_models/multilingual/multi-dataset/xtts_v2 \
    --text "你好,欢迎使用 Coqui TTS 语音合成。" \
    --speaker_wav reference_voice.wav \
    --language_idx zh \
    --out_path chinese_output.wav
```ti
p
l
e
references improve cloning consistency.",
    speaker_wav=["ref1.wav", "ref2.wav", "ref3.wav"],
    language="en",
    file_path="batch_cloned.wav"
)
```### REST API Server```
bas
h
# Start the built-in server (not production-grade, use gunicorn behind nginx)
tts-server \
    --model_name tts_models/multilingual/multi-dataset/xtts_v2 \
    --port 5002 \
    --use_cuda true# Query the default endpoint
curl "http://localhost:5002/api/tts?text=Hello+world&speaker_id=Ana+Florence&language_id=en" \
    -o output.wav# Query the OpenAI-compatibl```
pytho
n
import torch
from TTS.api import TTS

# Auto-detect GPU
device = "cuda" if torch.cuda.is_available() else "cpu"

# Initialize with XTTS v2
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)

# Synthesize with a built-in speaker
wav = tts.tts(
    text="Coqui TTS supports seventeen languages out of the box.",
    speaker="Ana Florence",
    language="en"
)
```t
TTS
import torch
import io
import soundfile as sfapp = Flask(__name__)
device = "cuda" if torch.cuda.is_available() else "cpu"
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)@app.route("/synthesize", methods=["POST"])
def synthesize():
    data = request.get_json()
    text = data.get("text", "")
    language = data.get("language", "en")
    speaker_wav = data.get("speaker_wav", None)

pytho n

Clone a voice from 6 seconds of reference audio #

tts.tts_to_file( text=“This cloned voice will sound like your reference speaker.”, speaker_wav="/path/to/reference_speaker.wav", language=“en”, file_path=“cloned_output.wav” )

Batch clone with multiple reference files for better quality #

tts.tts_to_file( text=“Multiple references improve cloning consistency.”, speaker_wav=[“ref1.wav”, “ref2.wav”, “ref3.wav”], language=“en”, file_path=“batch_cloned.wav” )

    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    ports:
      - "5002:5002"
    volumes:
      - ./tts_models:/home/appuser/.local/share/tts
      - ./config:/app/config
      - ./audio_output:/app/audio_output
    environment:
      - CUDA_VISIBLE_DEVICES=0
      - PYTHONUNBUFFERED=1
      - TTS_HOME=/home/appuser/.local/share/tts
    shm_size: '2gb'
    command: >
      sh -c "python3 /ap```
bas
h
# Start the built-in server (not production-grade, use gunicorn behind nginx)
tts-server \
    --model_name tts_models/multilingual/multi-dataset/xtts_v2 \
    --port 5002 \
    --use_cuda true

# Query the default endpoint
curl "http://localhost:5002/api/tts?text=Hello+world&speaker_id=Ana+Florence&language_id=en" \
    -o output.wav

# Query the OpenAI-compatible endpoint
curl -X POST "http://localhost:5002/v1/audio/speech" \
    -H "Content-Type: application/json" \
    -d '{
        "input": "This endpoint is compatible with OpenAI SDKs.",
        "voice": "Ana Florence",
        "response_format": "wav"
    }' \
    --output openai_compat.wav
```gu
a
l
/multi-dataset/xtts_v2')"# Warm-up: trigger CUDA kernel compilation at build time
COPY warm_up.py .
RUN python3 warm_up.pyEXPOSE 5002
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:5002", "--timeout", "120", "server:app"]
```### Voice Conversion Integration```
pytho
n
# Convert voice from source to target speaker
tts = TTS("voice_conversion_models/multilingual/vctk/freevc24").to("cuda")tts.voice_conversion_to_file(
    source_wav="source_speaker.wav",
    target_wav="target_voice.wav",
    file_path="converted_voice.wav"
)
```## Benchmarks / Real-World Use CasesWe ran a controlled **tts benchmark** on an NVIDIA A10 (24 GB VRAM), CUDA 12.1, PyTorch 2.2, with 1000 te```
pytho
n
from flask import Flask, request, send_file
from TTS.api import TTS
import torch
import io
import soundfile as sf

app = Flask(__name__)
device = "cuda" if torch.cuda.is_available() else "cpu"
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)

@app.route("/synthesize", methods=["POST"])
def synthesize():
    data = request.get_json()
    text = data.get("text", "")
    language = data.get("language", "en")
    speaker_wav = data.get("speaker_wav", None)
    
    wav = tts.tts(text=text, speaker_wav=speaker_wav, language=language)
    
    # Convert to WAV bytes
    buffer = io.BytesIO()
    sf.write(buffer, wav, samplerate=24000, format="WAV")
    buffer.seek(0)
    
    return send_file(buffer, mimetype="audio/wav")

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)
``` cloning quality among open-source models, matching 85-95% speaker similarity with just 3-10 seconds of reference audio.
- **VITS** is the workhorse for single-speaker, single-language deployments — 67x faster than real-time on GPU with excellent quality.
- **FastSpeech2 + HiFi-GAN** is the budget option: sub-50 MB model size, runs on CPU, perfect for IoT and edge devices.
- Coqui TTS with **ONNX runtime + FP16** quantisation achieves a 0.031 RTF with 3.3 GB VRAM — a 62% speedup over PyTorch FP32 with negligible quality loss.**Real-world deployment metrics (production API serving 5000 req/day):**```
Hardware:        2x NVIDIA A10G (AWS g5.2xlarge)
Load balancer:   nginx round-robin
Container:       Docker + gunicorn (4 workers per GPU)
Average latency: 420 ms P50, 890 ms P95
Throughput:      12 req/sec per GPU
Error rate:      0.03% (OOM on ```
yam
l
# docker-compose.yml
version: '3.8'

services:
  coqui-tts:
    build: .
    container_name: coqui-tts-service
    restart: unless-stopped
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    ports:
      - "5002:5002"
    volumes:
      - ./tts_models:/home/appuser/.local/share/tts
      - ./config:/app/config
      - ./audio_output:/app/audio_output
    environment:
      - CUDA_VISIBLE_DEVICES=0
      - PYTHONUNBUFFERED=1
      - TTS_HOME=/home/appuser/.local/share/tts
    shm_size: '2gb'
    command: >
      sh -c "python3 /app/config/server.py"

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - coqui-tts
```t
o
ONNX (requires model-specific code)
# See: https://github.com/coqui-ai/TTS/tree/dev/TTS/tts/layers# Enable FP16 inference
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.benchmark = True
```### Batch Inference for Higher Throughput```
pytho
n
from concurrent.futures import ThreadPoolExecutor
import queuedef batch_worker(text_queue, result_queue):
    """Process texts in batches to maximise GPU utilisation."""
    tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to("cuda")
    batch = []
    
    while True:
        try:
            item = text_queue.get(timeout=0.5)
            batch.append(item)
            
            if len(batch) >= 8:  # Batch size of 8
                for b in batch:
                    wav = tts.tts(text=b["text"], language=b["lang"])
                    result_queue.put({"id": b[```
dockerfil
e
FROM nvidia/cuda:12.1-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
    python3 python3-pip espeak-ng git \
    libsndfile1 ffmpeg \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
RUN pip install --no-cache-dir coqui-tts torch torchaudio \
    flask gunicorn soundfile

# Pre-download XTTS v2 model to bake into image
RUN python3 -c "from TTS.api import TTS; \
    TTS('tts_models/multilingual/multi-dataset/xtts_v2')"

# Warm-up: trigger CUDA kernel compilation at build time
COPY warm_up.py .
RUN python3 warm_up.py

EXPOSE 5002
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:5002", "--timeout", "120", "server:app"]
```un
i
n
g
recipe
python TTS/bin/train_tts.py \
    --config_path TTS/tts/recipes/xtts_v2/train_gpt_xtts.py \
    --restore_path /path/to/xtts_v2.pth \
    --output_path ./xtts_finetuned/ \
    --formatter ljspeech \
    --dataset_path /path/to/your_dataset \
    --batch_size 4 \
    --epochs 10# Expected training time: 12-24 hours on RTX 4090 for 1 hour of data
```### Monitoring with Prometheus```
pytho
n
from prometheus_client import Counter, Histogram, generate_latest# Metrics
TTS_REQUESTS = Counter('tts_requests_total', 'Total TTS requests', ['language'])
TTS_LATENCY = Histogram('tts_latency_seconds', 'Request latency')
TTS_ERRORS = Counter('tts_errors_total', 'Total errors', ['error_type'])@app.rou```
pytho
n
# Convert voice from source to target speaker
tts = TTS("voice_conversion_models/multilingual/vctk/freevc24").to("cuda")

tts.voice_conversion_to_file(
    source_wav="source_speaker.wav",
    target_wav="target_voice.wav",
    file_path="converted_voice.wav"
)
``` as e:
            TTS_ERRORS.labels(error_type=type(e).__name__).inc()
            raise
```## Comparison with Alternatives| Feature | Coqui TTS | ChatTTS | MeloTTS | Bark (Suno) |
|---|---|---|---|---|
| **GitHub Stars** | 45,300 | 33,400 | 5,100 | 37,200 |
| **License** | MPL-2.0 | AGPL-3.0 | MIT | MIT |
| **Languages** | 17 (XTTS) / 1100+ (Fairseq) | 2 (zh, en) | 6 | 13+ |
| **Voice Cloning** | Yes — 3 sec ref | No | No | Yes — unconstrained |
| **RTF (GPU)** | 0.04-0.15 | 0.93 | 0.04 | 1.14 |
| **Peak VRAM** | 1.2-4.1 GB | 6.0 GB | 1.2 GB | 4.2 GB |
| **MOS Score** | 4.1-4.2 | 4.5 | 3.8 | 4.3 |
| **Streaming** | Yes, <200 ms | No | No | No |
| **Fine-Tuning** | Full recipes | Limited | No | No |
| **Emotion Control** | Prosody transfer | Laughs, pauses | Limited | Tags in prompt |
| **CPU Inference** | Yes (slower) | No | Yes (fast) | No |
| **Docker Image** | Official GPU+CPU | Community only | Community only | Community only |
| **Model Size** | 66 MB - 400 MB | ~1.5 GB | ~300 MB | ~3 GB |
| **Community** | Very active | Active | Moderate | Active |**When to choose which:**- **Coqui TTS** — You need multilingual support, voice cloning, fine-tuning, or Docker deployment. Best all-rounder for production.
- **ChatTTS** — Chinese/English only, but you want the most natural prosody with laughter and pauses. Not for real-time streaming.
- **MeloTTS** — CPU-first deployment, MIT license, 6 languages. Best for edge devices and budget cloud instances.
- **Bark** — You want generative audio with music, sound effects, and highly expressive speech. Slower but more creative.## Limitations / Honest AssessmentCoqui TTS is not the right tool for every job. Here is what we learned the hard way:- **Company shutdown** — Coqui AI closed in December 2023. The project is now community-maintained by Idiap Research In```
Hardware:        2x NVIDIA A10G (AWS g5.2xlarge)
Load balancer:   nginx round-robin
Container:       Docker + gunicorn (4 workers per GPU)
Average latency: 420 ms P50, 890 ms P95
Throughput:      12 req/sec per GPU
Error rate:      0.03% (OOM on >500 char inputs)
Uptime:          99.7% over 30 days
```— First inference after container boot triggers CUDA kernel compilation, adding 5-10 seconds. You must implement a warm-up script for production.
- **Memory bloat on long text** — Inputs over 500 characters can OOM a 16 GB GPU. Implement sentence-level chunking with a 300-character limit per request.
- **Chinese quality gap** — While XTTS v2 supports Chinese, native models like ChatTTS produce more natural Mandarin prosody. Coqui's strength is breadth, not per-language perfection.
- **No built-in batc```
pytho
n
# warm_up.py
import os
from TTS.api import TTS

MODEL = os.getenv("TTS_MODEL", "tts_models/multilingual/multi-dataset/xtts_v2")
tts = TTS(MODEL)
if torch.cuda.is_available():
    tts = tts.to("cuda")

# Trigger JIT compilation
_ = tts.tts(text="warm up", speaker_wav=None, language="en")
print("[warmup] CUDA kernels compiled, model ready")
``` Coqui TTS in production?**For XTTS v2 inference, an 8 GB VRAM GPU (RTX 3060 Ti or better) handles single-speaker synthesis comfortably. For concurrent serving, budget 4 GB VRAM per active model instance. CPU-only inference works with VITS and FastSpeech2 but expects 5-10x slower RTF.**Q2: How does voice cloning quality compare to ElevenLabs?**XTTS v2 achieves 85-95% speaker simila```
pytho
n
# Convert PyTorch model to ONNX for 2x speedup
import torch
from TTS.api import TTS

tts = TTS("tts_models/en/ljspeech/tacotron2-DDC").to("cuda")

# Export to ONNX (requires model-specific code)
# See: https://github.com/coqui-ai/TTS/tree/dev/TTS/tts/layers

# Enable FP16 inference
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.benchmark = True
```i
r
e
s
attribution and has redistribution restrictions. Consult legal counsel for high-revenue products.**Q4: What is the difference between VITS and XTTS v2?**VITS is an end-to-end single-speaker model optimised for speed (67x RTF on GPU). XTTS v2 is a GPT-based multi-speaker model with voice cloning across 17 languages. Use VITS for fast, fixed-voice applications. Use XTTS v2 when you need cloning or multilin```
pytho
n
from concurrent.futures import ThreadPoolExecutor
import queue

def batch_worker(text_queue, result_queue):
    """Process texts in batches to maximise GPU utilisation."""
    tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to("cuda")
    batch = []
    
    while True:
        try:
            item = text_queue.get(timeout=0.5)
            batch.append(item)
            
            if len(batch) >= 8:  # Batch size of 8
                for b in batch:
                    wav = tts.tts(text=b["text"], language=b["lang"])
                    result_queue.put({"id": b["id"], "wav": wav})
                batch = []
        except queue.Empty:
            if batch:
                for b in batch:
                    wav = tts.tts(text=b["text"], language=b["lang"])
                    result_queue.put({"id": b["id"], "wav": wav})
                batch = []

# Usage
with ThreadPoolExecutor(max_workers=2) as executor:
    executor.submit(batch_worker, text_q, result_q)
``` or chunks under 300 characters. Use NLTK or spaCy for sentence segmentation, synthesise each chunk independently, then concatenate the audio files with cross-fade to avoid boundary clicks.## ConclusionCoqui TTS remains the most versatile open-source TTS toolkit in 2026. With 45,300 GitHub stars, 1100+ languages via Fairseq, and XTTS v2 delivering sub-200 ms streaming with voice cloning, it covers more production use cases than any single alternative. The Docker setup takes under five minutes, the Python API is straightforward, and the modular architecture lets you swap models as requirements evolve. The main caveats are the company shutdown (community-maintained since 2023), license fragmentation on XTTS models, and the need for warm-up scripts in production. If those are acceptable trade-offs, Coqui TTS is the toolkit to beat.**Action items:**1. Run the Docker install command above and synthesise your first audio file.
2. Benchmark XTTS v2 against your current TTS provider with the benchmark script.
3. Join the community on [Discord](https://discord.gg/fBC58unbKE) or [GitHub Discussions](https://github.com```
bas
h
# Prepare dataset in LJSpeech format:
# metadata.csv: audio_file|text|speaker_name
# wavs/*.wav: 22050 Hz, mono, 16-bit

# Run fine-tuning recipe
python TTS/bin/train_tts.py \
    --config_path TTS/tts/recipes/xtts_v2/train_gpt_xtts.py \
    --restore_path /path/to/xtts_v2.pth \
    --output_path ./xtts_finetuned/ \
    --formatter ljspeech \
    --dataset_path /path/to/your_dataset \
    --batch_size 4 \
    --epochs 10

# Expected training time: 12-24 hours on RTX 4090 for 1 hour of data
```.
- **HTStack
** — Hong Kong VPS with low-latency access from mainland China. This is the same IDC that hosts dibi8.com — battle-tested in production.*Affiliate links — they don't cost you extra and they help keep dibi8.com running.*## Sources & Further Reading- Coqui TTS Official Documentation: https://coqui-tts.readthedocs.io/
- XTTS v2 Model Card: https://huggingface.co/coqui/XTTS-v2
- Community Fork (Idiap): https://github.com/idiap/coqui-ai-TTS
- Original Repository: https:```
pytho
n
from prometheus_client import Counter, Histogram, generate_latest

# Metrics
TTS_REQUESTS = Counter('tts_requests_total', 'Total TTS requests', ['language'])
TTS_LATENCY = Histogram('tts_latency_seconds', 'Request latency')
TTS_ERRORS = Counter('tts_errors_total', 'Total errors', ['error_type'])

@app.route("/metrics")
def metrics():
    return generate_latest()

@app.route("/synthesize", methods=["POST"])
def synthesize():
    with TTS_LATENCY.time():
        try:
            # ... synthesis logic
            TTS_REQUESTS.labels(language=lang).inc()
        except Exception as e:
            TTS_ERRORS.labels(error_type=type(e).__name__).inc()
            raise

💬 댓글 토론