alecKarfonta/speaker

0

stars

45

commits

Python

primary language

Jul 25, 2026

updated

README

Speaker

A multi-engine platform for text-to-speech, voice cloning, and voice design. Supports three TTS backends that can be swapped with a single command. Ships with a React frontend.

TTS Workspace

What It Does

Text-to-Speech — Generate speech from text with configurable parameters, streaming output, and voice selection.

TTS Demo

Voice Design — Describe a voice in plain English and the system creates it. No reference audio needed. Powered by MOSS-VoiceGenerator.

"A deep, authoritative male voice like a news anchor"

Voice Design

Voice Cloning — Clone any voice from as little as 3 seconds of reference audio. Upload a sample, and the system captures the identity for synthesis.

Voice Cloning

Voice Library — Save, organize, and preview cloned voices.

Voice Library


Backends

BackendModelStrengthPort
MOSS-TTSOpenMOSS-Team/MOSS-TTSVoice design from text, high quality8013
GLM-TTSGLM-4-VoicevLLM + TensorRT acceleration8012
Qwen3-TTSQwen/Qwen3-TTSMultilingual, style control8016

MOSS-TTS is the recommended default. It runs two models — MOSS-TTS for synthesis/cloning and MOSS-VoiceGenerator for voice design — on separate GPUs with 4-bit quantization. Total VRAM: ~23 GB across two cards.

GLM-TTS is the original backend, optimized for NVIDIA Blackwell hardware. Uses vLLM with PagedAttention for the LLM stage and a TensorRT HiFT vocoder.

Qwen3-TTS adds multilingual support and instruction-following style control with a built-in speaker library.


Getting Started

git clone https://github.com/alecKarfonta/speaker.git
cd speaker

# Start MOSS-TTS + frontend
docker compose --profile moss up -d moss-tts frontend

Models download on first launch (~2-3 min). Then open:

For GLM-TTS instead, place weights in GLM-TTS/ckpt/ and run docker compose up -d tts-api frontend.

Switching Backends

./scripts/switch-backend.sh moss     # MOSS-TTS
./scripts/switch-backend.sh glm      # GLM-TTS
./scripts/switch-backend.sh qwen     # Qwen3-TTS
./scripts/switch-backend.sh status   # Show current config

Or set TTS_BACKEND_HOST in docker-compose.yml under the frontend service:

- TTS_BACKEND_HOST=moss-tts:8000   # or tts-api:8000, qwen-tts:8000

API

All backends share a common REST API. The frontend hits these through an nginx reverse proxy.

# Generate speech
curl -X POST http://localhost:8013/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world!", "voice_name": "trump"}' \
  -o speech.wav

# Design a voice from a description (MOSS only)
curl -X POST http://localhost:8013/tts/design \
  -H "Content-Type: application/json" \
  -d '{"text": "Welcome!", "instruction": "Warm female narrator"}' \
  -o designed.wav

# Clone a voice from audio
curl -X POST http://localhost:8013/tts/clone \
  -F "reference=@sample.wav" \
  -F "text=Testing voice clone" \
  -o cloned.wav
EndpointDescription
GET /healthHealth check, GPU info
GET /voicesList saved voices
POST /ttsGenerate speech (auto-clones if voice_name set)
POST /tts/streamStreaming generation
POST /tts/cloneClone from uploaded audio
POST /tts/designVoice design from text prompt
POST /voices/{name}Save reference audio

Monitoring

Prometheus + Grafana stack for tracking inference performance:

  • Real-Time Factor (audio duration / inference time)
  • Per-stage latency (LLM, flow matching, vocoder)
  • GPU memory usage

Grafana

Grafana runs at http://localhost:3333.


Project Layout

app/                     Backend APIs (MOSS, GLM, Qwen)
frontend/                React + TypeScript UI
  src/components/
    tts/                 TTS Workspace (main page)
    studio/              Voice Studio (design, clone, speakers)
    voices/              Voice Library
scripts/
  switch-backend.sh      Backend switching
  test_moss_api.py       API test suite (9 tests)
  run_tts_validation.py  Round-trip STT quality checks
docker-compose.yml       Full stack orchestration

Configuration

Key environment variables (set in docker-compose.yml):

VariableDefaultWhat it does
TTS_BACKEND_HOSTmoss-tts:8000Frontend proxy target
MOSS_MODEL_IDOpenMOSS-Team/MOSS-TTSTTS model
MOSS_VOICE_GEN_MODELOpenMOSS-Team/MOSS-VoiceGeneratorVoice design model
MOSS_ENABLE_VOICE_GENtrueEnable voice design endpoint
MOSS_QUANTIZE4bitQuantization: 4bit, 8bit, none
GLM_TTS_ENGINEvllmGLM LLM engine
GLM_TTS_QUANTIZATION4bitGLM quantization

Service Ports

ServicePort
Frontend3012
MOSS-TTS8013
GLM-TTS8012
Qwen3-TTS8016
Grafana3333
Prometheus9199

License

MIT

Contributors

alecKarfonta

45 commits

alecKarfonta/speaker

0

stars

45

commits

Python

primary language

Jul 25, 2026

updated

README

Speaker

A multi-engine platform for text-to-speech, voice cloning, and voice design. Supports three TTS backends that can be swapped with a single command. Ships with a React frontend.

TTS Workspace

What It Does

Text-to-Speech — Generate speech from text with configurable parameters, streaming output, and voice selection.

TTS Demo

Voice Design — Describe a voice in plain English and the system creates it. No reference audio needed. Powered by MOSS-VoiceGenerator.

"A deep, authoritative male voice like a news anchor"

Voice Design

Voice Cloning — Clone any voice from as little as 3 seconds of reference audio. Upload a sample, and the system captures the identity for synthesis.

Voice Cloning

Voice Library — Save, organize, and preview cloned voices.

Voice Library


Backends

BackendModelStrengthPort
MOSS-TTSOpenMOSS-Team/MOSS-TTSVoice design from text, high quality8013
GLM-TTSGLM-4-VoicevLLM + TensorRT acceleration8012
Qwen3-TTSQwen/Qwen3-TTSMultilingual, style control8016

MOSS-TTS is the recommended default. It runs two models — MOSS-TTS for synthesis/cloning and MOSS-VoiceGenerator for voice design — on separate GPUs with 4-bit quantization. Total VRAM: ~23 GB across two cards.

GLM-TTS is the original backend, optimized for NVIDIA Blackwell hardware. Uses vLLM with PagedAttention for the LLM stage and a TensorRT HiFT vocoder.

Qwen3-TTS adds multilingual support and instruction-following style control with a built-in speaker library.


Getting Started

git clone https://github.com/alecKarfonta/speaker.git
cd speaker

# Start MOSS-TTS + frontend
docker compose --profile moss up -d moss-tts frontend

Models download on first launch (~2-3 min). Then open:

For GLM-TTS instead, place weights in GLM-TTS/ckpt/ and run docker compose up -d tts-api frontend.

Switching Backends

./scripts/switch-backend.sh moss     # MOSS-TTS
./scripts/switch-backend.sh glm      # GLM-TTS
./scripts/switch-backend.sh qwen     # Qwen3-TTS
./scripts/switch-backend.sh status   # Show current config

Or set TTS_BACKEND_HOST in docker-compose.yml under the frontend service:

- TTS_BACKEND_HOST=moss-tts:8000   # or tts-api:8000, qwen-tts:8000

API

All backends share a common REST API. The frontend hits these through an nginx reverse proxy.

# Generate speech
curl -X POST http://localhost:8013/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world!", "voice_name": "trump"}' \
  -o speech.wav

# Design a voice from a description (MOSS only)
curl -X POST http://localhost:8013/tts/design \
  -H "Content-Type: application/json" \
  -d '{"text": "Welcome!", "instruction": "Warm female narrator"}' \
  -o designed.wav

# Clone a voice from audio
curl -X POST http://localhost:8013/tts/clone \
  -F "reference=@sample.wav" \
  -F "text=Testing voice clone" \
  -o cloned.wav
EndpointDescription
GET /healthHealth check, GPU info
GET /voicesList saved voices
POST /ttsGenerate speech (auto-clones if voice_name set)
POST /tts/streamStreaming generation
POST /tts/cloneClone from uploaded audio
POST /tts/designVoice design from text prompt
POST /voices/{name}Save reference audio

Monitoring

Prometheus + Grafana stack for tracking inference performance:

  • Real-Time Factor (audio duration / inference time)
  • Per-stage latency (LLM, flow matching, vocoder)
  • GPU memory usage

Grafana

Grafana runs at http://localhost:3333.


Project Layout

app/                     Backend APIs (MOSS, GLM, Qwen)
frontend/                React + TypeScript UI
  src/components/
    tts/                 TTS Workspace (main page)
    studio/              Voice Studio (design, clone, speakers)
    voices/              Voice Library
scripts/
  switch-backend.sh      Backend switching
  test_moss_api.py       API test suite (9 tests)
  run_tts_validation.py  Round-trip STT quality checks
docker-compose.yml       Full stack orchestration

Configuration

Key environment variables (set in docker-compose.yml):

VariableDefaultWhat it does
TTS_BACKEND_HOSTmoss-tts:8000Frontend proxy target
MOSS_MODEL_IDOpenMOSS-Team/MOSS-TTSTTS model
MOSS_VOICE_GEN_MODELOpenMOSS-Team/MOSS-VoiceGeneratorVoice design model
MOSS_ENABLE_VOICE_GENtrueEnable voice design endpoint
MOSS_QUANTIZE4bitQuantization: 4bit, 8bit, none
GLM_TTS_ENGINEvllmGLM LLM engine
GLM_TTS_QUANTIZATION4bitGLM quantization

Service Ports

ServicePort
Frontend3012
MOSS-TTS8013
GLM-TTS8012
Qwen3-TTS8016
Grafana3333
Prometheus9199

License

MIT

Contributors

alecKarfonta

45 commits

Languages

Python

63.7%

TypeScript

26.3%

Shell

9.2%