How zyphra/zonos works
Project type and purpose
• This is an open-source, Python-based text-to-speech (TTS) toolkit and model library (“Zonos-v0.1”) that provides:
• A core TTS engine (text → DAC tokens → waveform)
• Zero-shot voice cloning via speaker embeddings or audio prefixes
• A minimal CLI sample, a Gradio web UI, and Dockerized deployment
File structure
• Top-level artifacts:
• Dockerfile & docker-compose.yml → containerized deployment
• pyproject.toml & uv.lock → build/configuration
• sample.py & gradio_interface.py → two user-facing entry points (CLI vs Web UI)
• assets/ → example audio and static images (used by README and Gradio)
• Core application package: zonos/
• zonos/model.py → main Zonos class (load pretrained, from_pretrained)
• zonos/conditioning.py → build conditioning dict from text/audio/pitch/rate/emotion
• zonos/utils.py → device management, helper functions
• zonos/sampling.py → convert model logits to discrete codes
• zonos/autoencoder.py → decode DAC tokens back to raw waveform
• zonos/backbone/ → two backbone implementations: transformer (_torch.py) vs hybrid SSM (_mamba_ssm.py)
• zonos/config.py, codebook_pattern.py, speaker_cloning.py → auxiliary components
README for additional insights
• Describes a linear pipeline:
Text normalization & phonemization (via external espeak-ng) → Transformer/Hybrid DAC token prediction → Autoencoder decode → 44 kHz waveform
• Mentions two modes (“hybrid” vs “transformer”), Gradio UI, Docker instructions