Skip to content

RavenMuse/ChatTTS-OpenApi

 
 

Repository files navigation

ChatTTS-OpenApi

A generative speech model for daily dialogue with standardized OpenAI API speech interface.

Introduction

ChatTTS is a text-to-speech model designed specifically for dialogue scenarios such as LLM assistant. OpenAI API is mainly used for AI application platforms to implement speech capabilities, such as Dify, Flowise, etc., as well as modular development.

Supported Languages

  • English
  • Chinese

Dataset & Model

  • The main model is trained with Chinese and English audio data of 100,000+ hours.
  • The open-source version on HuggingFace is a 40,000 hours pre-trained model without SFT.

Get Started

Clone Repo

git clone https://github.com/RavenMuse/ChatTTS-OpenApi.git
cd ChatTTS-OpenApi

Install requirements

1. Install Directly

pip install --upgrade -r requirements.txt

2. Install from Uv

uv sync --upgrade
source .venv/bin/activate

2. Install from Docker

  • running by cpu
docker-compose up -d
  • running by gpu
docker-compose -f docker-compose.gpu.yaml up -d

Quick Start

Make sure you are under the project root directory when you execute these commands below.

1. Launch WebUI

python examples/web/webui.py

2. Infer by Command Line

It will save audio to ./output_audio_n.mp3

python examples/cmd/run.py "Your text 1." "Your text 2."

3. Infer by API

python api.py --port 7006

Basic Usage

curl http://localhost:7006/audio/speech \
  -H "Content-Type: application/json" \
  -d '{
    "model":"chat_tts",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "shimmer"
  }' \
  --output speech.mp3

About

A generative speech model for daily dialogue with standardized OpenAI API speech interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%