# Repository Briefing: pnnbao97/VieNeu-TTS
> Source: https://repoforai.com/repo/pnnbao97/VieNeu-TTS (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/pnnbao97/VieNeu-TTS
- **Official Docs / Website**: https://www.vieneu.io
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (98/100 · Maintenance 35/35 · Adoption 23/25 · Releases 20/20 · License 20/20)
- **Latest Release**: app-v0.19.3 (2026-12-02) — https://github.com/pnnbao97/VieNeu-TTS/releases
- **Review Snapshot**: 2026-12-02 (Note: app-v0.19.3 on 2026-12-02 shipped after this review; verify latest release notes)
- **Deployment / Stack Signals**: Self-Hosted, Local AI, Docker, GPU, API
- **Momentum**: 3,715 ★ total (+1 24h / +76 7d) · 1,120 forks
- **Topics**: `deep-learning`, `on-device-ml`, `real-time`, `speech-synthesis`, `text-to-speech`, `tts`, `vietnamese`, `vietnamese-language`
- **When to Use**: Best for: Teams building self-hosted Vietnamese voice agents, narration, or multi-speaker audio that want to keep scripts and reference recordings on their own infrastructure. Skip if: You need v4-level cloning fidelity in a self-hosted deployment, require a released mobile SDK, or prefer a managed service to operating CPU or GPU inference.

## Overview
```text
### Architecture & Core Mechanics
VieNeu-TTS is a Python inference engine with v3 Turbo as the default behind the `Vieneu` SDK. Its speech stack uses `sea-g2p` for phonemization and MOSS-Audio-Tokenizer-Nano as its audio codec. Presets and cloned voices condition synthesis through speaker embeddings and reference codes. The CPU path uses ONNX Runtime without importing PyTorch. With the CUDA stack available, the SDK selects PyTorch automatically; `backend="onnx"` explicitly opts back into CPU inference.

On CUDA, a single graph replay per audio frame combines acoustic decoding, sampling, repetition penalty, and the backbone step. The streaming scheduler continuously batches requests rather than running an independent GPU loop per listener. The SDK exposes frame-level audio through `infer_stream`, and `apps/openai_speech.py` provides the HTTP service boundary via `POST /v1/audio/speech`. The package uses setuptools, while `uv` leaves dependency groups off by default to keep the minimal installation torch-free.

### Key Capabilities & Differentiators
v3 Turbo produces 48 kHz audio for Vietnamese and English, with 25 presets spanning northern, central, and southern Vietnamese voices, plus cloning from a reference clip. Conversation mode batches a multi-speaker script across speaker changes, with generation batches of up to 32. Inline non-verbal cues such as `[cười]` and `[thở dài]` are experimental. The SDK still accepts `style` for compatibility but ignores it: the reference voice determines the reading style.

On an RTX 3060, the measured offline batch RTF was about 0.02, while a separate live test reached about 115 ms to the first audio chunk with 16 concurrent streams. On a 12th-generation Core i5, Turbo fp32 measured about 0.5 RTF; CPU streaming put first audio at about 300 ms for fp32 and 140 ms for int8, with one or two streams respectively. For weaker CPUs, v3 Nano is a 24 kHz ONNX preview with 11 presets and desktop CPU RTF of 0.11–0.22, at a noticeable cost to English and mixed-language quality.

### Trade-offs & Limitations
Compared with a hosted option such as ElevenLabs, self-hosted v3 Turbo gives teams control over where scripts and reference recordings are processed, but leaves capacity planning and service operations with them. The OpenAI-compatible speech endpoint can reduce client changes, though voice selection and streaming behavior still warrant integration tests. The repository code is Apache-2.0; verify the terms for the actual weights and voice assets before commercial distribution, and obtain authorization for cloned voices. Proprietary v4 is hosted-only, not a drop-in model for the local stack.

CPU fp32 is the safer starting point for a single listener. CPU int8 measured about 0.35 RTF and reduces backbone size, but requires VNNI; older CPUs can produce garbled audio. GPU batch throughput is useful for offline narration, but does not translate directly into interactive capacity. For a voice agent, test first playable audio and sustained concurrency with your own text lengths and client buffering. For bilingual publishing, listen to mixed-language material before trading Turbo quality for Nano speed.

### Hardware & Deployment Guide
Use `uv sync` from the checkout for the minimal CPU setup, `uv sync --extra cuda` for the CUDA path, and `uv run vieneu-web` for the local Web UI. The Windows SDK setup lists PyTorch and torchaudio 2.8.0 from the CUDA 12.8 wheel index and Transformers 4.57.6. For a self-hosted endpoint, run `uv run python -m apps.openai_speech` or use `docker/docker-compose.yml` with `api-cpu` or `api-gpu`. The older `pnnbao/vieneu-tts:serve` LMDeploy image serves v1/v2 and cannot serve fine-tuned v3 Turbo models; load those through the SDK. With model assets present locally, on-device synthesis does not require the hosted v4 API.

The first CUDA call for each batch size pays about 0.5 s to capture the graph. Use `warm_fused()` at startup where cold latency matters, then measure first audio and peak VRAM at target concurrency. No exact VRAM minimum is established by the RTX 3060 test. Desktop releases 0.19.1 and 0.19.2 added non-verbal cue suggestions for dubbing and folder-based `.txt` chapter import for audiobooks, respectively. These are authoring workflow improvements, not inference benchmark updates.
```

## Key Capabilities
```text
- Runtime: v3 Turbo uses ONNX Runtime without PyTorch on CPU and selects PyTorch on CUDA when available.
- GPU execution: One CUDA graph replays the work for each audio frame; continuous batching serves concurrent streaming requests.
- Voice conditioning: 25 presets span northern, central, and southern Vietnamese voices; reference clips can supply both speaker identity and reading style.
- Script synthesis: Multi-speaker Conversation mode batches lines across speakers, with generation batches of up to 32.
- Service integration: `POST /v1/audio/speech` streams PCM or WAV through chunked responses or SSE, with separate Docker Compose profiles for CPU and GPU.
- Model boundary: v3 Turbo is the latest open-source version; v3 Nano is a 24 kHz edge preview, and proprietary v4 is hosted-only.
```

## Quick Start / Clone
```bash
# Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
```
