feat(zonos): OpenAI-ish REST adapter for asset-engine routing

Upstream Zonos ships only Gradio + Python SDK — no REST surface — so
asset-engine (which routes a clean JSON POST to /v1/audio/speech) can't
target it directly. Add a thin FastAPI adapter (stacks/zonos/adapter/):
POST /v1/audio/speech in front of the Zonos SDK, built FROM local/zonos
to reuse torch/CUDA/SDK. Returns a JSON envelope {audio, audio_format,
seed} — the seed rides back so asset-engine regenerate/fork can pin it
(Zonos is the fleet's first genuinely seedable TTS). compose gains a
zonos-api service on 8201; .env.example gains the port + voices dir.
This commit is contained in:
vh
2026-05-31 13:59:10 -07:00
parent 71df6f7474
commit 81efa8da96
7 changed files with 283 additions and 10 deletions
+15 -1
View File
@@ -16,9 +16,14 @@ ZONOS_TAG=v1
# Reserved on irv-ml1: 8188 ComfyUI, 8190 CosyVoice, 8191 Qwen3-TTS,
# 8192 IndexTTS-2, 8193 Kokoro, 8194 VibeVoice, 8195 Fish-S2,
# 8196 Chatterbox, 8197 Voxtral, 8198 Kyutai, 8200 Dia, 8765 Parakeet.
# 8199 picked here.
# 8199 picked here for the Gradio eval UI.
ZONOS_PORT=8199
# Host port for the OpenAI-ish REST adapter (zonos-api service) that
# asset-engine routes to. Container listens on 8000 internally. 8201 is
# the next free slot above the Gradio port.
ZONOS_API_PORT=8201
# Bind address. 0.0.0.0 exposes on all interfaces (incl. WG tunnel
# interface 10.100.79.3); 127.0.0.1 restricts to local-only.
ZONOS_BIND=0.0.0.0
@@ -42,3 +47,12 @@ ZONOS_GPU_DEVICES=0
# Bind-mounted so they survive container recreate. Excluded from restic
# (regenerable from HF).
ZONOS_CACHE_DIR=/worktank/zonos/cache
# Reference voice clips for zero-shot cloning (mounted read-only into the
# adapter at /app/voices). Drop 10–30s clean WAVs here; the catalog's
# `voice` field selects one by filename. Empty/absent → default voice.
ZONOS_VOICES_DIR=/worktank/zonos/voices
# Model the adapter loads at startup. Only the transformer variant is
# available in the current image (mamba-ssm absent → no hybrid).
ZONOS_MODEL=Zyphra/Zonos-v0.1-transformer