guptasanchit90/sonus

Support for multiple TTS engines like Qwen3, Piper TTS, Kokoro TTS and expose them as a Server

0

stars

61

commits

Python

primary language

Jul 17, 2026

updated

README

Sonus Logo

Sonus — Speak freely

Multi-engine, offline audio hub (Speech, Music, SFX, STT) on your Mac. No cloud. No API keys. No one listening.

License: MIT Python Platform Runs on MLX and ONNX Runtime — Apple Silicon for MLX engines, any platform for ONNX engines (Kokoro, Piper).

About the name: Sonus is Latin for "sound" (/ˈsoː.nus/). Felt right for a project about making machines talk.

ℹ️ Not affiliated with any company, service, or organization named Sonus. Just a coincidence. We're an independent open-source thing.

Opencode — vibecoded by AI, tested by humans.


What is this?

Sonus turns text into speech/music/SFX (and speech into text) using whatever engine you throw at it. Multiple engines, one unified API. Run it locally, hit the endpoint, get audio back. Zero data leaves your machine.

Think of it as a local audio hub — TTS via Qwen3, Kokoro, Piper, Chatterbox, CosyVoice, and Fish Speech; Speech-to-Music/SFX via MusicGen, Riffusion, and Stable Audio Open; and STT via Whisper. All offline, all local.


Run in the cloud

No Mac? No problem. Kokoro and Piper (ONNX engines) work on any platform. Click a badge to open a pre-configured notebook — it installs everything, downloads models, starts the server, and gives you a public URL.

Open In Colab Open In Kaggle Open In SageMaker Studio Lab


Engines at a glance

EngineFrameworkType / ModalityVibe / Capabilities
Qwen3MLXTTSPremium quality. Sounds almost human. 🍎 Apple Silicon only.
KokoroONNXTTSThe multilingual workhorse. Fast, reliable. ✅ Cross-platform.
PiperONNXTTSThe speed demon. 100+ languages, tiny footprint. ✅ Cross-platform.
Chatterbox TurboMLXTTSBest-in-class cloning. Feed it a WAV, get a twin. 🍎 Apple Silicon only.
CosyVoice2PyTorchTTSZero-shot TTS, emotion/prosody control. ✅ Cross-platform.
Fish SpeechPyTorch / MLXTTSMultilingual TTS with voice cloning. ✅ Cross-platform / 🍎.
MusicGen / AudioGenMLXMusic / SFXText-to-music & text-to-sfx on GPU. 🍎 Apple Silicon only.
RiffusionDiffusers (PyTorch)MusicFast text-to-music via spectrogram diffusion. ✅ Cross-platform.
Stable Audio OpenDiffusers (PyTorch)Music / SFXHigh-quality stereo audio, up to 47 seconds. ✅ Cross-platform.
Whisper MLXMLXSTTSpeech-to-text. Transcribe anything. 🍎 Apple Silicon only.

More on each engine:


What you'll need

Local (macOS Apple Silicon):

  • A Mac with Apple Silicon (M1, M2, M3, M4 — anything with Metal)
  • Python 3.13+ (brew install python@3.13)
  • ffmpegbrew install ffmpeg

Running in Docker? Only Kokoro and Piper work there. Qwen3 and Chatterbox need the Metal GPU backend. See each engine's doc for details.


Get started in 30 seconds

git clone https://github.com/YOUR_USERNAME/sonus.git
cd sonus

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
brew install ffmpeg

Download models for at least one engine (check the engine docs above), then:

source venv/bin/activate
python server.py
# Listening on http://0.0.0.0:8000

Interactive API docs: http://localhost:8000/api-docs


Try it

curl -X POST http://localhost:8000/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world", "model": "kokoro-v1.0", "speaker_name": "af_heart"}' \
  --output hello.mp3

Speaking OpenAI's language

curl -X POST http://localhost:8000/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model": "kokoro", "input": "Hello world", "voice": "af_bella"}' \
  --output hello.mp3

Drop-in replacement for POST /v1/audio/speech. Your existing OpenAI TTS code works without changes — just point it at http://localhost:8000.

Speech to text (OpenAI-compatible)

curl -X POST http://localhost:8000/v1/audio/transcriptions \
  -F "file=@speech.mp3" \
  -F "model=whisper-base" \
  -F "language=en" \
  -F "temperature=0.0"
{"text": "Hello world, this was transcribed locally."}

Documentation

ResourceWhat's inside
API ReferenceEvery endpoint, schema, curl example
Docs HomeFull docs index
Development GuideSetup, linting, testing, Docker
ContributingAdding engines, code style, PRs

How it's built

server.py               # FastAPI — the brain
src/
  engines/
    base.py             # The contract every TTS/generation engine signs
    qwen.py             # Qwen3 (MLX)
    chatterbox.py       # Chatterbox Turbo (MLX)
    kokoro.py           # Kokoro (ONNX)
    piper.py            # Piper (ONNX)
    cosyvoice.py        # CosyVoice2 (PyTorch)
    fish_speech.py      # Fish Speech (PyTorch/MLX)
    musicgen.py         # MusicGen & AudioGen (MLX)
    riffusion.py        # Riffusion (PyTorch/Diffusers)
    stable_audio.py     # Stable Audio Open (PyTorch/Diffusers)
  stt/
    base.py             # The contract every STT engine signs
    whisper_mlx.py      # Whisper via MLX (Apple Silicon)
static/                 # Web UI — Vue 3 (CDN), no build step
docs/                   # API, engine, development, and MCP docs
models/                 # Downloaded models (gitignored)
voices/                 # WAVs for voice cloning
sfx/                    # Sound effects database
outputs/                # Generated audio files

Built with

ToolRoleHow we use it
OpencodeAI pair programmerVibecoded most of this thing
VS CodeEditorWhere the magic happens
FastAPIWeb frameworkRoutes, validation, docs
UvicornASGI serverServes it all up
MLXML frameworkApple Silicon superpowers
mlx-audioAudio model loaderLoads Qwen3, Chatterbox models
pydubAudio conversionWAV ↔ MP3 magic
soundfileWAV I/OReads and writes WAVs
PiperTTS engineSpeed king, ONNX-powered
KokoroTTS engineMultilingual, ONNX-powered
Qwen3-TTSTTS enginePremium quality, MLX-powered
Chatterbox TurboTTS engineCloning specialist, MLX-powered
CosyVoiceTTS engineZero-shot multilingual TTS
Fish SpeechTTS engineMultilingual TTS and voice cloning
mlx-audiocraftMusic/SFX engineLoads MusicGen & AudioGen models
diffusersAudio diffusionPowers Riffusion and Stable Audio Open
torchML frameworkBackend for PyTorch engines (CosyVoice, Fish Speech, Diffusers)
librosaAudio processingMel spectrogram conversion for Riffusion
acceleratePyTorch hardware accelerationSpeeds up diffusion model inference
mlx-whisperSTT engineSpeech-to-text, MLX-powered
WhisperSTT modelOpenAI's transcription model

Disclaimer

Yes, this thing can make audio that sounds like real people. You're responsible for what you do with it.

  • Don't impersonate people without their consent.
  • Don't create deceptive, fraudulent, or misleading content.
  • Do respect the laws where you live.
  • The authors assume zero liability for misuse.

Use it wisely. Or don't — but that's on you.


License

MIT — do what you want with it, just keep the notice.

Contributors

guptasanchit90

61 commits

guptasanchit90/sonus

Support for multiple TTS engines like Qwen3, Piper TTS, Kokoro TTS and expose them as a Server

0

stars

61

commits

Python

primary language

Jul 17, 2026

updated

README

Sonus Logo

Sonus — Speak freely

Multi-engine, offline audio hub (Speech, Music, SFX, STT) on your Mac. No cloud. No API keys. No one listening.

License: MIT Python Platform Runs on MLX and ONNX Runtime — Apple Silicon for MLX engines, any platform for ONNX engines (Kokoro, Piper).

About the name: Sonus is Latin for "sound" (/ˈsoː.nus/). Felt right for a project about making machines talk.

ℹ️ Not affiliated with any company, service, or organization named Sonus. Just a coincidence. We're an independent open-source thing.

Opencode — vibecoded by AI, tested by humans.


What is this?

Sonus turns text into speech/music/SFX (and speech into text) using whatever engine you throw at it. Multiple engines, one unified API. Run it locally, hit the endpoint, get audio back. Zero data leaves your machine.

Think of it as a local audio hub — TTS via Qwen3, Kokoro, Piper, Chatterbox, CosyVoice, and Fish Speech; Speech-to-Music/SFX via MusicGen, Riffusion, and Stable Audio Open; and STT via Whisper. All offline, all local.


Run in the cloud

No Mac? No problem. Kokoro and Piper (ONNX engines) work on any platform. Click a badge to open a pre-configured notebook — it installs everything, downloads models, starts the server, and gives you a public URL.

Open In Colab Open In Kaggle Open In SageMaker Studio Lab


Engines at a glance

EngineFrameworkType / ModalityVibe / Capabilities
Qwen3MLXTTSPremium quality. Sounds almost human. 🍎 Apple Silicon only.
KokoroONNXTTSThe multilingual workhorse. Fast, reliable. ✅ Cross-platform.
PiperONNXTTSThe speed demon. 100+ languages, tiny footprint. ✅ Cross-platform.
Chatterbox TurboMLXTTSBest-in-class cloning. Feed it a WAV, get a twin. 🍎 Apple Silicon only.
CosyVoice2PyTorchTTSZero-shot TTS, emotion/prosody control. ✅ Cross-platform.
Fish SpeechPyTorch / MLXTTSMultilingual TTS with voice cloning. ✅ Cross-platform / 🍎.
MusicGen / AudioGenMLXMusic / SFXText-to-music & text-to-sfx on GPU. 🍎 Apple Silicon only.
RiffusionDiffusers (PyTorch)MusicFast text-to-music via spectrogram diffusion. ✅ Cross-platform.
Stable Audio OpenDiffusers (PyTorch)Music / SFXHigh-quality stereo audio, up to 47 seconds. ✅ Cross-platform.
Whisper MLXMLXSTTSpeech-to-text. Transcribe anything. 🍎 Apple Silicon only.

More on each engine:


What you'll need

Local (macOS Apple Silicon):

  • A Mac with Apple Silicon (M1, M2, M3, M4 — anything with Metal)
  • Python 3.13+ (brew install python@3.13)
  • ffmpegbrew install ffmpeg

Running in Docker? Only Kokoro and Piper work there. Qwen3 and Chatterbox need the Metal GPU backend. See each engine's doc for details.


Get started in 30 seconds

git clone https://github.com/YOUR_USERNAME/sonus.git
cd sonus

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
brew install ffmpeg

Download models for at least one engine (check the engine docs above), then:

source venv/bin/activate
python server.py
# Listening on http://0.0.0.0:8000

Interactive API docs: http://localhost:8000/api-docs


Try it

curl -X POST http://localhost:8000/tts \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world", "model": "kokoro-v1.0", "speaker_name": "af_heart"}' \
  --output hello.mp3

Speaking OpenAI's language

curl -X POST http://localhost:8000/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"model": "kokoro", "input": "Hello world", "voice": "af_bella"}' \
  --output hello.mp3

Drop-in replacement for POST /v1/audio/speech. Your existing OpenAI TTS code works without changes — just point it at http://localhost:8000.

Speech to text (OpenAI-compatible)

curl -X POST http://localhost:8000/v1/audio/transcriptions \
  -F "file=@speech.mp3" \
  -F "model=whisper-base" \
  -F "language=en" \
  -F "temperature=0.0"
{"text": "Hello world, this was transcribed locally."}

Documentation

ResourceWhat's inside
API ReferenceEvery endpoint, schema, curl example
Docs HomeFull docs index
Development GuideSetup, linting, testing, Docker
ContributingAdding engines, code style, PRs

How it's built

server.py               # FastAPI — the brain
src/
  engines/
    base.py             # The contract every TTS/generation engine signs
    qwen.py             # Qwen3 (MLX)
    chatterbox.py       # Chatterbox Turbo (MLX)
    kokoro.py           # Kokoro (ONNX)
    piper.py            # Piper (ONNX)
    cosyvoice.py        # CosyVoice2 (PyTorch)
    fish_speech.py      # Fish Speech (PyTorch/MLX)
    musicgen.py         # MusicGen & AudioGen (MLX)
    riffusion.py        # Riffusion (PyTorch/Diffusers)
    stable_audio.py     # Stable Audio Open (PyTorch/Diffusers)
  stt/
    base.py             # The contract every STT engine signs
    whisper_mlx.py      # Whisper via MLX (Apple Silicon)
static/                 # Web UI — Vue 3 (CDN), no build step
docs/                   # API, engine, development, and MCP docs
models/                 # Downloaded models (gitignored)
voices/                 # WAVs for voice cloning
sfx/                    # Sound effects database
outputs/                # Generated audio files

Built with

ToolRoleHow we use it
OpencodeAI pair programmerVibecoded most of this thing
VS CodeEditorWhere the magic happens
FastAPIWeb frameworkRoutes, validation, docs
UvicornASGI serverServes it all up
MLXML frameworkApple Silicon superpowers
mlx-audioAudio model loaderLoads Qwen3, Chatterbox models
pydubAudio conversionWAV ↔ MP3 magic
soundfileWAV I/OReads and writes WAVs
PiperTTS engineSpeed king, ONNX-powered
KokoroTTS engineMultilingual, ONNX-powered
Qwen3-TTSTTS enginePremium quality, MLX-powered
Chatterbox TurboTTS engineCloning specialist, MLX-powered
CosyVoiceTTS engineZero-shot multilingual TTS
Fish SpeechTTS engineMultilingual TTS and voice cloning
mlx-audiocraftMusic/SFX engineLoads MusicGen & AudioGen models
diffusersAudio diffusionPowers Riffusion and Stable Audio Open
torchML frameworkBackend for PyTorch engines (CosyVoice, Fish Speech, Diffusers)
librosaAudio processingMel spectrogram conversion for Riffusion
acceleratePyTorch hardware accelerationSpeeds up diffusion model inference
mlx-whisperSTT engineSpeech-to-text, MLX-powered
WhisperSTT modelOpenAI's transcription model

Disclaimer

Yes, this thing can make audio that sounds like real people. You're responsible for what you do with it.

  • Don't impersonate people without their consent.
  • Don't create deceptive, fraudulent, or misleading content.
  • Do respect the laws where you live.
  • The authors assume zero liability for misuse.

Use it wisely. Or don't — but that's on you.


License

MIT — do what you want with it, just keep the notice.

Contributors

guptasanchit90

61 commits

Languages

Python

45.7%

JavaScript

22.6%

HTML

16.7%

CSS

9.5%

Jupyter Notebook

4.3%