OmniVoice-Triton-API

OmniVoice-Triton-API

Docker app from hsiang's Repository

Overview

OpenAI-compatible TTS API powered by OmniVoice with Triton kernel fusion + CUDA Graph acceleration. 646 languages, voice cloning, voice design. Up to 3.4x faster than stock OmniVoice, ~170ms per utterance. Supports RTX 50-series (Blackwell) GPUs. First start downloads model (~2GB) from HuggingFace. China users: set HF_ENDPOINT to https://hf-mirror.com for faster downloads. Requires NVIDIA GPU with driver 550+.

OmniVoice-Triton-API

中文文档

OpenAI-compatible TTS API powered by OmniVoice with omnivoice-triton acceleration.

3.4x faster than stock OmniVoice. ~170ms per utterance. 646 languages. Voice cloning + voice design. No flash-attn needed.

Features

  • OpenAI-compatible /v1/audio/speech endpoint (JSON body)
  • Triton kernel fusion + CUDA Graph — 3.4x faster than baseline
  • 646 languages (broadest coverage among open TTS models)
  • Voice cloning from 3-second reference audio
  • Voice design via natural language description
  • Built-in voice presets (auto, female, male, child, elderly, etc.)
  • ~2GB model, ~2GB VRAM
  • Supports RTX 50-series (Blackwell) GPUs

Quick Start

docker run -d --gpus all \
  -p 8080:8080 \
  -v /mnt/user/appdata/omnivoice-triton-api/models:/root/.cache/huggingface \
  --shm-size=4g \
  --name omnivoice-triton-api \
  ghcr.io/hsiang-han/omnivoice-triton-api:latest

Or with docker compose:

docker compose -f docker/gpu/docker-compose.yml up -d

First start downloads model (~2GB). China users: set HF_ENDPOINT=https://hf-mirror.com.

Usage Examples

# Auto voice (default)
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello world!", "voice": "auto"}' \
  --output output.wav

# Voice design (describe the voice you want)
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "你好世界", "voice": "young female, warm and gentle", "language": "zh"}' \
  --output designed.wav

# Use preset
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "Testing male voice.", "voice": "male_en"}' \
  --output male.wav

# Voice cloning
curl -X POST http://localhost:8080/v1/audio/speech/clone \
  -F "input=This is my cloned voice." \
  -F "ref_audio=@reference.wav" \
  -F "ref_text=The text spoken in the reference audio." \
  --output cloned.wav

# Faster inference (16 steps instead of 32)
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "Fast mode!", "voice": "female", "num_step": 16}' \
  --output fast.wav

# List voices
curl http://localhost:8080/v1/voices

Voice Presets

Voice Description
auto Auto-generated voice (no instruct)
female Generic female voice
male Generic male voice
female_en Female, American accent
male_en Male, American accent
female_zh Female, Chinese
male_zh Male, Chinese
child Child voice
elderly Elderly female voice

Or pass any free-form description as voice (e.g. "warm baritone, British accent, slow pace").

API Endpoints

Endpoint Method Description
/v1/audio/speech POST Text-to-speech (JSON, OpenAI-compatible)
/v1/audio/speech/clone POST Voice cloning (Form + file upload)
/v1/voices GET List available voice presets
/v1/models GET List models
/health GET Health check
/docs GET Swagger documentation

Environment Variables

Variable Default Description
MODEL_ID k2-fsa/OmniVoice HuggingFace model ID
RUNNER_MODE triton Inference mode (see below)
NUM_STEPS 32 Diffusion steps (16 for speed, 32 for quality)
DTYPE fp16 Model precision
DEVICE cuda:0 CUDA device
PORT 8080 API server port
HF_ENDPOINT https://huggingface.co HuggingFace mirror

Runner Modes

Mode Speedup VRAM Status
base 1.0x ~2-3GB Stable
triton (default) ~1.5x ~3-4GB Stable
triton+sage ~1.5-1.7x ~3-4GB Stable
faster ~2.3x ~5-6GB ⚠️ VRAM leak
hybrid ~3.4x ~7GB+ ⚠️ VRAM leak
hybrid+sage ~3.4x ~7GB+ ⚠️ VRAM leak

Warning: hybrid and faster modes have a known VRAM leak — memory grows with each request until OOM. See omnivoice-triton#8. We are tracking the fix. Use triton or triton+sage for production.

Hardware Requirements

  • NVIDIA GPU with 2GB+ VRAM
  • NVIDIA driver 550+ (Ampere/Ada) or 570+ (Blackwell)
  • Docker with NVIDIA Container Toolkit

Credits

License

Apache-2.0

Related apps

Details

Repository
ghcr.io/hsiang-han/omnivoice-triton-api:latest
Last Updated2026-10-07
First Seen2026-06-09

Runtime arguments

Web UI
http://[IP]:[PORT:8080]/docs
Network
bridge
Shell
bash
Privileged
false
Extra Params
--gpus all --shm-size=4g

Template configuration

API PortPorttcp

OpenAI-compatible TTS API port. Swagger docs at /docs

Target
8080
Default
8080
Value
8080
Model CachePathrw

Model download cache. First run downloads ~2GB. Persists across container recreates.

Target
/root/.cache/huggingface
Default
/mnt/user/appdata/omnivoice-triton-api/models
Value
/mnt/user/appdata/omnivoice-triton-api/models
Runner ModeVariable

Inference mode: triton (default, fast, ~3-4GB VRAM, stable), triton+sage (triton + SageAttention), base (slowest, ~2-3GB). EXPERIMENTAL: hybrid (fastest ~170ms but has VRAM leak bug — memory grows until OOM, see github.com/newgrit1004/omnivoice-triton/issues/8), hybrid+sage, faster. We are tracking the fix.

Target
RUNNER_MODE
Default
triton
Value
triton
Diffusion StepsVariable

Number of diffusion steps. 32 = best quality. 16 = faster with slightly lower quality.

Target
NUM_STEPS
Default
32
Value
32
HuggingFace EndpointVariable

HuggingFace download endpoint. China users: change to https://hf-mirror.com for faster downloads.

Target
HF_ENDPOINT
Default
https://huggingface.co
Value
https://huggingface.co
NVIDIA Visible DevicesVariable

GPU selection (all, 0, 1, etc.)

Target
NVIDIA_VISIBLE_DEVICES
Default
all
Value
all
NVIDIA Driver CapabilitiesVariable

NVIDIA driver capabilities

Target
NVIDIA_DRIVER_CAPABILITIES
Default
compute,utility
Value
compute,utility