Text-to-Speech (TTS) and Speech-to-Text (STT) library based on Apple's MLX framework, optimized for Apple Silicon.

,;:γοΌοΌ)| Model | Load Time | Generation Speed | Memory |
|---|---|---|---|
| Kokoro-82M | 2.5s | 1.6s/sentence | 1.9GB |
| VoxCPM1.5 | 1.2s | 1.0s/sentence | 2.0GB |
| Whisper-Turbo | Preloaded | Real-time | - |
Streaming Performance:
# Install dependencies
./scripts/setup.sh
# Start service
./scripts/start.sh
# Access
open http://localhost:8002
# Clone repository
git clone https://github.com/jiasunm/mlx-audio.git
cd mlx-audio
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Download models (first run)
python -m mlx_audio.download_models
# Start server
uvicorn mlx_audio.main:app --host 0.0.0.0 --port 8002
# mlx_audio/config.py
preload_models = [
"mlx-community/Kokoro-82M-bf16", # TTS - Chinese/English/Japanese
"mlx-community/VoxCPM1.5", # TTS - Chinese/English bilingual
"mlx-community/whisper-large-v3-turbo", # STT
]
Streaming Mode (Recommended - stream while generating)
curl -X POST http://localhost:8002/v1/audio/speech/stream \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world, this is a streaming output test.",
"lang_code": "a",
"voice": "af_bella"
}' -o output.pcm
Standard Mode (Generate complete WAV file)
curl -X POST http://localhost:8002/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world",
"lang_code": "a",
"voice": "af_bella",
"speed": 1.0
}' -o output.wav
curl -X POST http://localhost:8002/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "language=en" \
-F "prompt=Technical terms, names, etc."
Chinese (lang_code: "z")
English (lang_code: "a"/"b")
Japanese (lang_code: "j")
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Follow our WeChat Official Account
Get latest updates and tutorials
Made with β€οΈ for Apple Silicon
If you find this project helpful, please give it a β!
1 commits
Python
89.0%
HTML
10.5%
Text-to-Speech (TTS) and Speech-to-Text (STT) library based on Apple's MLX framework, optimized for Apple Silicon.

,;:γοΌοΌ)| Model | Load Time | Generation Speed | Memory |
|---|---|---|---|
| Kokoro-82M | 2.5s | 1.6s/sentence | 1.9GB |
| VoxCPM1.5 | 1.2s | 1.0s/sentence | 2.0GB |
| Whisper-Turbo | Preloaded | Real-time | - |
Streaming Performance:
# Install dependencies
./scripts/setup.sh
# Start service
./scripts/start.sh
# Access
open http://localhost:8002
# Clone repository
git clone https://github.com/jiasunm/mlx-audio.git
cd mlx-audio
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Download models (first run)
python -m mlx_audio.download_models
# Start server
uvicorn mlx_audio.main:app --host 0.0.0.0 --port 8002
# mlx_audio/config.py
preload_models = [
"mlx-community/Kokoro-82M-bf16", # TTS - Chinese/English/Japanese
"mlx-community/VoxCPM1.5", # TTS - Chinese/English bilingual
"mlx-community/whisper-large-v3-turbo", # STT
]
Streaming Mode (Recommended - stream while generating)
curl -X POST http://localhost:8002/v1/audio/speech/stream \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world, this is a streaming output test.",
"lang_code": "a",
"voice": "af_bella"
}' -o output.pcm
Standard Mode (Generate complete WAV file)
curl -X POST http://localhost:8002/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"input": "Hello world",
"lang_code": "a",
"voice": "af_bella",
"speed": 1.0
}' -o output.wav
curl -X POST http://localhost:8002/v1/audio/transcriptions \
-F "file=@audio.wav" \
-F "language=en" \
-F "prompt=Technical terms, names, etc."
Chinese (lang_code: "z")
English (lang_code: "a"/"b")
Japanese (lang_code: "j")
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Follow our WeChat Official Account
Get latest updates and tutorials
Made with β€οΈ for Apple Silicon
If you find this project helpful, please give it a β!
1 commits
Python
89.0%
HTML
10.5%