tts-dgx-spark-faster-qwen3-tts/docker-compose.yml
mARTin-B78 92e2381d0b Reduce latency: CUDA warmup, chunk_size=4, max-seq-len 2048
- run_server.py: warm up CUDA graphs at server startup via lifespan
  event so the first real request does not pay the 7-8s graph-
  compilation penalty; uses modern lifespan API instead of deprecated
  on_event
- generate_voices.py: set chunk_size=4 per voice so streaming clients
  receive first audio after ~333ms instead of ~1s
- docker-compose.yml: add --max-seq-len 2048 (halves static KV cache,
  reduces VRAM and graph-capture time)
- config/benchmark_api.py: new script to measure TTFA, RTF and speed
  against the live API endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 20:43:21 +02:00

42 lines
1.1 KiB
YAML

services:
faster-qwen3-tts:
image: martinb78/faster-qwen3-tts-dgx-spark:latest
container_name: faster-qwen3-tts
restart: unless-stopped
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
# Optional: set HF_TOKEN if model needs downloading from HuggingFace
# - HF_TOKEN=${HF_TOKEN}
ports:
- "8020:8000"
volumes:
# Mount your local Qwen3-TTS model (download first, see README)
- ${MODEL_PATH:-./models/Qwen3-TTS}:/models/Qwen3-TTS:ro
# Config directory (voices.json generated on startup)
- ./config:/config:rw
# Speaker reference audio files
- ./config/speakers:/voices:ro
command: >
/bin/bash -c "
python3 /config/generate_voices.py &&
python3 /config/run_server.py
--model /models/Qwen3-TTS
--voices /config/voices.json
--port 8000
--max-seq-len 2048
"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
networks:
- dgx_net
networks:
dgx_net:
external: true