VocoLoom
Modular multi-voice AI speech synthesis platform and microservice powered by F5-TTS, Vocos, and optional RVC.
π¬π§ English Β· π©πͺ Deutsch
---
## Overview
**VocoLoom** is a modular multi-voice AI speech synthesis platform and HTTP microservice built on **F5-TTS** (Flow-Matching DiT + CFM) and the **Vocos** vocoder, with optional **RVC** (Retrieval-based Voice Conversion) post-processing via an embedded **Applio** integration.
It exposes a **Gradio 5 Web Studio**, a **FastAPI REST API** (with OpenAPI/Swagger documentation at `/docs`), and a **CLI** (`vocoloom.py`), all sharing a unified `VoiceManager` that auto-discovers self-contained **Voice Packs** from `voices//`.
Currently hosted voice pack:
- **JΓΌrgen Seiferth** (`juergen_seiferth`) β Fairground showman legend from *βDie Welt ist unser Feldβ* (1995), featuring Ruhrpott cadence and classic fairground expressions, including optional RVC refinement.
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Clients: Web Studio (Gradio /) Β· REST API Β· CLI β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VoiceManager (vocoloom/voice_manager.py) β
β β’ Auto-discovers voices// β
β β’ VRAM model caching & phrase splitting β
β β’ F5-TTS (CFM + DiT) + Vocos vocoder (24 kHz) β
β β’ Optional RVC pass via Applio (rmvpe) β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β voices// (Voice Pack) β
β voice.json Β· model.pt Β· reference.wav/.txt β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
---
## Features
- **Modular Voice-Pack Architecture**: Each voice lives in its own directory `voices//` with metadata (`voice.json`), fine-tuned checkpoint (`model.pt`), reference audio (`reference.wav`), transcript (`reference.txt`), and avatar (`avatar.png`). New voices are automatically discovered on startup.
- **Natural Phrase Splitting**: Automatically splits longer inputs at sentence boundaries (`.!?`) and commas (for phrases > 80 characters) and inserts 250 ms pauses between segments to prevent flow-trajectory drift.
- **VRAM Caching & Preloading**: `vocoloom/server.py` preloads the first discovered voice into GPU VRAM on startup for low-latency synthesis and clears CUDA cache cleanly when switching voices.
- **Gradio Web Studio (`/`)**: Interactive browser interface with voice dropdown, dialect/tag badges, speech speed slider (`0.6`β`1.4`), optional RVC toggle, one-click sample sentences, and WAV audio playback.
- **FastAPI REST API (`/api/v1/*`)**: CORS-enabled HTTP endpoints with automatic Swagger UI at `/docs` returning `audio/wav` streams.
- **Command-Line Interface (`vocoloom.py`)**: List hosted voices, synthesize WAV files directly (with optional `--play` on Windows), or launch the combined Web UI + API server.
- **Optional RVC Post-Processing**: When `rvc_support.supported` is `true` in `voice.json`, synthesis can optionally run through Applio (`rmvpe` F0 extraction, configurable `rvc_index`).
- **GPU-Accelerated Docker Image**: Ready-to-deploy CUDA 12.4 + cuDNN 9 container (`git.orfel.de/jannik/vocoloom:latest`) with NVIDIA GPU reservation and healthcheck.
---
## How It Works & Tech Stack
### Voice-Pack Structure
Every voice pack resides in `voices//`:
```text
voices/
βββ juergen_seiferth/
βββ voice.json # Metadata: id, name, subtitle, dialect, tags, defaults, rvc_support
βββ model.pt # Fine-tuned F5-TTS checkpoint (EMA or raw state dict)
βββ reference.wav # Clean reference audio clip
βββ reference.txt # Exact transcript (fallback if not in voice.json)
βββ avatar.png # Avatar image served at /api/v1/voices/{id}/avatar
```
### Tech Stack
| Component | Technology |
| :--- | :--- |
| **TTS Engine** | `f5-tts` (`>=0.2.0`, Flow-Matching `CFM` + `DiT` with `dim=1024`, `depth=22`, `heads=16`), `vocos` (`>=0.1.0`, `24000 Hz`) |
| **Tokenization** | Custom German character vocabulary (`models/F5-TTS-German/vocab.txt`) |
| **Voice Conversion (Optional)** | Embedded `Applio` (`run_infer_script`, `f0_method="rmvpe"`) |
| **Web API & Server** | FastAPI (`>=0.115.0`), Uvicorn (`>=0.32.0`), Pydantic (`>=2.9.0`) |
| **Web Studio UI** | Gradio (`>=5.0.0`) mounted inside FastAPI at `/` |
| **Audio & Numerics** | PyTorch (`2.6.0` + CUDA 12.4 in Docker), `soundfile`, `numpy`, `pillow` |
| **Default Port** | `7860` |
---
## Prerequisites & Installation
### Prerequisites
- **Python 3.10+** (for local execution) with an NVIDIA CUDA GPU recommended (CPU fallback is supported automatically if CUDA is unavailable)
- **FFmpeg** & **libsndfile1** installed on the system
- **Docker** + **NVIDIA Container Toolkit** (for GPU Docker deployment)
### Option 1: Local Installation
```bash
git clone https://git.orfel.de/Jannik/VocoLoom.git
cd VocoLoom
python -m venv .venv
# Linux/macOS: source .venv/bin/activate
# Windows: .venv\Scripts\activate
pip install -r requirements.txt
```
### Option 2: Docker & GPU Deployment (Jannik-Cloud Standard)
VocoLoom follows the **Docker-First** workflow using the pre-built image in the Gitea Container Registry (`git.orfel.de`):
```bash
# Clone repository
git clone https://git.orfel.de/Jannik/VocoLoom.git
cd VocoLoom
# Build locally (optional)
docker build -t git.orfel.de/jannik/vocoloom:latest .
# Push to Gitea Container Registry (optional)
docker push git.orfel.de/jannik/vocoloom:latest
# Start GPU container with docker-compose.yml
docker compose up -d
```
`docker-compose.yml` mounts `./voices:/app/voices` and `./models:/app/models`, reserves 1 NVIDIA GPU, and exposes port `7860`.
---
## Configuration
### Environment Variables
| Variable | Default | Description |
| :--- | :--- | :--- |
| `VOCOLOOM_PORT` | `7860` | HTTP port for Web Studio & REST API |
| `VOCOLOOM_HOST` | `0.0.0.0` | Bind host address |
| `NVIDIA_VISIBLE_DEVICES` | `all` | Exposed GPU devices inside Docker |
### Adding a New Voice Pack (`voice.json`)
Create a new directory `voices//` containing `model.pt`, `reference.wav`, `reference.txt` (or inline `reference_text`), optional `avatar.png`, and `voice.json`:
```json
{
"id": "my_voice",
"name": "Display Name",
"subtitle": "Short Subtitle",
"description": "Voice persona description.",
"gender": "male",
"language": "de",
"dialect": "Standard",
"tags": ["Tag1", "Tag2"],
"engine": "f5-tts",
"model_file": "model.pt",
"reference_audio": "reference.wav",
"reference_text": "Exact transcript of reference.wav",
"default_speed": 1.0,
"cfg_strength": 1.8,
"nfe_step": 64,
"sample_sentences": [
"Sample sentence one."
],
"rvc_support": {
"supported": false
}
}
```
Restart VocoLoom and the new voice pack is automatically available in the Web Studio, CLI, and REST API.
---
## Usage
### 1. Start Web Studio & REST API
```bash
python webui.py
```
Or via the CLI:
```bash
python vocoloom.py serve --host 0.0.0.0 --port 7860
```
- **Web Studio**: `http://localhost:7860/`
- **Swagger API Docs**: `http://localhost:7860/docs`
- **Health Check**: `http://localhost:7860/health`
On Windows, `start_webui.bat` activates `.venv` and launches `python webui.py`.
### 2. CLI Usage (`vocoloom.py`)
```bash
# List all hosted voices
python vocoloom.py list
# Synthesize speech to a WAV file
python vocoloom.py speak --voice juergen_seiferth "Mahlzeit Alexander!" -o ausgabe.wav
# Adjust speed and enable optional RVC refinement
python vocoloom.py speak -v juergen_seiferth "Jetzt ist aber fertig Ballett!" -s 1.0 --rvc --index 0.70 -o out.wav
```
### 3. REST API Examples
```bash
# Check server health & loaded device
curl http://localhost:7860/health
# List available voices
curl http://localhost:7860/api/v1/voices
# Get details for a specific voice
curl http://localhost:7860/api/v1/voices/juergen_seiferth
# Download voice avatar
curl http://localhost:7860/api/v1/voices/juergen_seiferth/avatar --output avatar.png
# Synthesize speech (returns audio/wav)
curl -X POST http://localhost:7860/api/v1/synthesize \
-H "Content-Type: application/json" \
-d '{"voice_id": "juergen_seiferth", "text": "Mahlzeit mein Lieber!", "speed": 1.0, "use_rvc": false, "rvc_index": 0.70}' \
--output rede.wav
```
---
## Project Structure
```text
VocoLoom/
βββ assets/
β βββ logo.png # Application logo
βββ models/
β βββ F5-TTS-German/ # German base checkpoint & vocab.txt
βββ personality/ # Persona notes & Modelfile for JΓΌrgen Seiferth
βββ voices/
β βββ juergen_seiferth/ # Default Voice Pack (voice.json, model.pt, reference.wav/.txt, avatar.png)
βββ vocoloom/
β βββ __init__.py # Package exports (Voice, VoiceManager)
β βββ voice.py # Voice dataclass & directory loader
β βββ voice_manager.py # Auto-discovery, VRAM management, F5-TTS & Applio synthesis
β βββ api.py # FastAPI REST endpoints (/health, /api/v1/*)
β βββ webui.py # Gradio 5 Web Studio UI
β βββ server.py # Combined FastAPI + Gradio server & voice preloading
β βββ cli.py # CLI commands (list, speak, serve)
βββ Applio/ # Embedded RVC inference engine (optional)
βββ webui.py # Server entrypoint
βββ vocoloom.py # CLI entrypoint
βββ start_webui.bat # Windows launcher
βββ requirements.txt # Python dependencies
βββ Dockerfile # PyTorch 2.6 + CUDA 12.4 container
βββ docker-compose.yml # GPU-enabled Docker Compose definition
```
---
## License
This project's own code is dedicated to the public domain under **CC0 1.0 Universal** β see [`LICENSE`](LICENSE).
> **Third-Party Components:** External dependencies, bundled libraries, fonts, datasets, and media assets retain their own respective licenses and are excluded from CC0 1.0. See [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md) for details.