A web-based demo of the Kitten TTS Nano model - a lightweight 15M parameter text-to-speech model running entirely in your browser using ONNX Runtime and transformers.js! Try the demo here.
✨ Features
8 Different Voices - Male and female expression voices
⚡ Adjustable Speed - From 0.5x (slow) to 2.0x (fast)
Multiple Sample Rates - 8kHz to 48kHz for different quality levels
100% Browser-Based - No server required, runs locally
Real-time Generation - Fast inference using WebAssembly
WebGPU Support - Experimental WebGPU acceleration (with WASM fallback)
Quick Start
Clone the repository:
bash
git clone https://github.com/clowerweb/kitten-tts-web-demo
cd kitten-tts-web-demo
Install dependencies:
bash
npm install
Start the development server:
bash
npm run dev
Open your browser and navigate to http://localhost:5173
Type some text and generate speech!
Requirements
Node.js 16+
Modern browser with WebAssembly support
~50MB disk space for model files
️ How It Works
This demo replicates the Kitten TTS pipeline in JavaScript.
️ Controls
Voice Selection - Choose from 8 different voice embeddings
Text Processing: Custom text cleaner with smart chunking
Model Format: ONNX + JSON voice embeddings
Project Structure
…
Contributing
Contributions are welcome! Feel free to:
Report bugs or issues
Suggest new features
Submit pull requests
Improve documentation
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
The Kitten TTS model is also licensed under Apache 2.0 by KittenML.
Acknowledgments
KittenML Team for creating the amazing Kitten TTS model
Xenova for transformers.js and ONNX Runtime Web integration
espeak for phonemization support
Troubleshooting
Model not loading?
Check browser console for CORS or network errors
Audio not playing?
Try different browsers (Chrome/Firefox recommended)
Check if audio autoplay is blocked
Verify audio permissions
Poor audio quality?
Try different voices
Adjust sample rate settings
Use shorter text inputs for better quality
WebGPU not working?
This is an experimental feature and is known not to work in some browser/GPU setups. We are looking for contributors to help with better WebGPU support.
Made with ❤️ using the Kitten TTS Nano model. Meow!