Build llama.cpp from source with SM 120 CUDA kernels and FORCE_CUBLAS for RTX 5070 Blackwell. Rewrite OrpheusEngine to stream tokens via SSE and decode SNAC in overlapping 28-token batches (4 frames), replacing the blocking requests+stream:false approach. Performance: 13.5 → 170-213 tok/s. 100s audio generates in ~48s (2x faster than realtime). Replaces requests with httpx async client. Also switch MCP transport to stateless_http mode so container restarts don't invalidate client sessions.
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
services:
|
|
tts-mcp:
|
|
build: .
|
|
container_name: tts-mcp
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
# Override for Docker networking (container DNS instead of IPs)
|
|
TTS_PIPER_HOST: piper-tts
|
|
TTS_ORPHEUS_URL: http://llama-server:8081
|
|
# PipeWire client config
|
|
XDG_RUNTIME_DIR: /run/user/1000
|
|
volumes:
|
|
# Kokoro ONNX models (read-only)
|
|
- ./models:/app/models:ro
|
|
# HuggingFace cache for SNAC model download (lazy-loaded on first Orpheus call)
|
|
- hf-cache:/home/tts/.cache/huggingface
|
|
# PipeWire socket for audio playback through host speakers
|
|
- /run/user/1000/pipewire-0:/run/user/1000/pipewire-0
|
|
depends_on:
|
|
llama-server:
|
|
condition: service_healthy
|
|
networks:
|
|
- caddy
|
|
- dootie-internal
|
|
labels:
|
|
caddy: voice.l.supported.systems
|
|
caddy.reverse_proxy: "{{upstreams 8371}}"
|
|
|
|
llama-server:
|
|
build:
|
|
context: .
|
|
dockerfile: llama-server.Dockerfile
|
|
container_name: orpheus-llama-server
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
volumes:
|
|
# GGUF model file (set ORPHEUS_GGUF_PATH in .env, e.g. from Ollama blob storage)
|
|
- ${ORPHEUS_GGUF_PATH}:/models/orpheus.gguf:ro
|
|
command: >-
|
|
--host 0.0.0.0 --port 8081
|
|
--model /models/orpheus.gguf
|
|
--n-gpu-layers 999 --ctx-size 4096
|
|
--flash-attn --cont-batching
|
|
networks:
|
|
- dootie-internal
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-sf", "http://127.0.0.1:8081/health"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
start_period: 120s
|
|
retries: 5
|
|
|
|
volumes:
|
|
hf-cache:
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|
|
dootie-internal:
|
|
external: true
|