MOSS-TTS-Nano-API

MOSS-TTS-Nano-API

Docker app from hsiang's Repository

Overview

OpenAI-compatible TTS API powered by MOSS-TTS-Nano (100M params, Fudan OpenMOSS). 20 languages, 48kHz stereo, voice cloning, CPU-capable. Ultra-lightweight — can run alongside other GPU services without conflict. First start downloads model from HuggingFace. China users: set HF_ENDPOINT to https://hf-mirror.com for faster downloads. Works with or without GPU.

MOSS-TTS-Nano-API

中文文档

OpenAI-compatible TTS API powered by MOSS-TTS-Nano (Fudan OpenMOSS / MOSI.AI).

100M parameters. 48kHz stereo. 20 languages. Runs on CPU or GPU. Ultra-lightweight — can coexist with other GPU services.

Features

  • OpenAI-compatible /v1/audio/speech endpoint (JSON body)
  • 100M parameters — smallest high-quality TTS model
  • 48kHz stereo output (superior audio quality)
  • 20 languages including Chinese, English, Japanese, Korean
  • Voice cloning from reference audio
  • CPU inference — no GPU required (set DEVICE=cpu)
  • Built-in voice presets (zh_1-zh_6, en_1-en_5, jp_1-jp_5, etc.)
  • Apache-2.0 license

Quick Start

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

CPU-only (no GPU needed):

docker run -d \
  -p 8080:8080 \
  -v /mnt/user/appdata/moss-tts-nano-api/models:/root/.cache/huggingface \
  -e DEVICE=cpu \
  --name moss-tts-nano-api \
  ghcr.io/hsiang-han/moss-tts-nano-api:latest

First start downloads model from HuggingFace. China users: set HF_ENDPOINT=https://hf-mirror.com.

Usage Examples

# Default Chinese voice
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "你好世界", "voice": "zh_1"}' \
  --output output.wav

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

# Voice cloning
curl -X POST http://localhost:8080/v1/audio/speech/clone \
  -F "input=这是克隆的声音" \
  -F "ref_audio=@reference.wav" \
  --output cloned.wav

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

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 OpenMOSS-Team/MOSS-TTS-Nano-100M HuggingFace model ID
DEVICE auto Compute device (auto, cuda:0, cpu)
DTYPE auto Model precision
DEFAULT_VOICE zh_1 Default voice preset
PORT 8080 API server port
HF_ENDPOINT https://huggingface.co HuggingFace mirror

Hardware Requirements

  • GPU mode: Any NVIDIA GPU with 1GB+ VRAM
  • CPU mode: 4+ cores recommended, 2GB+ RAM
  • Docker (with NVIDIA Container Toolkit for GPU mode)

Credits

License

Apache-2.0

Install MOSS-TTS-Nano-API on Unraid in a few clicks.

Find MOSS-TTS-Nano-API in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for MOSS-TTS-Nano-API Review the template variables and paths Click Install

Related apps

Details

Repository
ghcr.io/hsiang-han/moss-tts-nano-api:latest
Last Updated2026-07-06
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=2g

Template configuration

API PortPorttcp

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

Target
8080
Default
8080
Value
8080
Model CachePathrw

Model download cache. Persists across container recreates.

Target
/root/.cache/huggingface
Default
/mnt/user/appdata/moss-tts-nano-api/models
Value
/mnt/user/appdata/moss-tts-nano-api/models
DeviceVariable

Compute device: auto (GPU if available, else CPU), cuda:0, or cpu.

Target
DEVICE
Default
auto
Value
auto
Default VoiceVariable

Default voice preset when none specified. Options: zh_1-zh_6, en_1-en_5, jp_1-jp_5, etc.

Target
DEFAULT_VOICE
Default
zh_1
Value
zh_1
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