Skip to content
TaskWizerPublic

About

LiteTTS

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

311 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LiteTTS LiteTTS

License: Apache 2.0 Python 3.12+ FastAPI Performance Quality

⚠️ ALPHA SOFTWARE NOTICE (Expand for details)

LiteTTS is currently in alpha development. Core TTS synthesis works reliably, but advanced features have known limitations.

🚧 Work-in-Progress Features

The following features are under active development and may have bugs or inconsistent behavior:

  • Punctuation handling - Some punctuation marks may not be processed naturally
  • Contraction pronunciation - Contractions like "he'd", "she'd" may be mispronounced
  • Prosody control - Sentence-level intonation and rhythm improvements ongoing
  • Currency processing - Financial amounts and currency symbols processing
  • Emotional expression - Voice emotion and style control features
  • Voice fluidity - Natural speech flow and stress pattern optimization
  • Inflection rules - Question vs statement intonation patterns

πŸ“‹ User Expectations

  • Expect bugs and breaking changes during alpha development
  • Core functionality is stable - basic text-to-speech works reliably
  • Use in production at your own risk - thorough testing recommended
  • Active development - regular updates and improvements being made

The fastest, most efficient Text-to-Speech API with near-instant response times even on CPU-only systems. ⚑

πŸ’– Support This Project

This TTS API is completely free to use! If you find it valuable for your projects, consider supporting its development:

🎯 Goal: Make enough money working on cool projects so I don't have to work a 9-to-5

  • πŸ’ Sponsor on GitHub: Become a sponsor for recurring support
  • β˜• Buy me a coffee: One-time donation to fuel development
  • ⭐ Star this repo: Help others discover this project
  • πŸ› Report issues: Help improve the software for everyone
  • πŸ‘Š Contribute: Is there a feature you'd like to see? Submit a pull request!

Your support enables continued development of high-quality, open-source AI tools!

✨ Key Features

  • ⚑ Lightning Fast: 29ms cached responses, 0.15 RTF (6.7x faster than real-time)
  • 🌍 54+ Voices: Multi-language support with voice showcase
  • πŸ”Œ OpenAI Compatible: Drop-in replacement for OpenAI TTS API
  • 🌐 OpenWebUI Compatible: Works out-of-the-box with OpenWebUI without additional configuration
  • πŸŽ›οΈ Advanced SSML: Background noise synthesis and voice modulation
  • πŸ”’ Perth Watermarking: Responsible AI compliance with automatic audio watermarking
  • πŸ“Š Production Ready: Comprehensive monitoring, caching, and error handling
  • πŸ›‘οΈ Security & Compliance: Built-in ethical AI features and content authenticity verification
  • 🐳 Easy Deployment: Docker support with automatic model downloads

πŸ’ͺ🏻 Trust me bro, oneliner

git clone https://github.com/TaskWizer/LiteTTS.git && cd LiteTTS && uv run python app.py

πŸ“’ Prerequisites

Before getting started, ensure your system meets these requirements:

Hardware Requirements:

  • Memory: 4GB RAM minimum (8GB+ recommended for high concurrency)
  • Storage: 4GB free space for model, voices, code, and cache
  • CPU: Modern multi-core processor (ARM64 and x86_64 supported)
  • GPU: Any CUDA-enabled GPU for optimal performance (optional)
  • Network: Internet connection for initial model downloads

Python Environment:

  • Python 3.12+ (Required for optimal performance and latest features)
    • Python 3.10+ minimum supported, but 3.12+ recommended for production
    • Includes improved error handling and performance optimizations
  • uv 0.8.11+ (Recommended package manager)
    • Ultra-fast Python package installer and resolver with
    • Automatic virtual environment management
    • See Installation Guide

πŸš€ Quick Start Options

Here are some quick start options, choose what works best for you!
# Clone the repository
git clone https://github.com/TaskWizer/LiteTTS.git
cd LiteTTS

# Option 1: Direct UV Python execution (recommended)
uv run python app.py

# Option 2: All-in-one Docker deployment
# Default docker-compose includes OpenWebUI (with Caddy for TLS and ChromaDB) and LiteTTS-API
docker-compose up -d

# Option 3: Manual installation with virtual environment (best practice)
python -m venv venv
source venv/bin/activate
uv pip install -r requirements.txt
python app.py

That's it! πŸŽ‰ The API will be available at http://localhost:8354 (default configured port).

πŸŽ‰ Recommended Setup

Using OpenWebUI (Docker with Caddy for TLS and ChromaDB for Knwoledge) and TTS API (Metal)

When testing the TTS API, using docker introduced overhead resulting in 2-3x performance degradation. So it's recommended to run the core TTS system locally and use within OpenWebUI or just use the "apps" included with the API itself and therefor running it standalone (simply run the "Trust me bro, oneliner" above) by hand. The following instructions will show how to "set it and forget it" to load automatically.

πŸ“š Documentation

**Complete guides and references for setup, usage, and advanced features:**

Detailed setup and usage guides:

πŸ“– Usage & API

πŸ”§ Configuration & Optimization

πŸ› οΈ Development & Troubleshooting

πŸ“Š Project Information

πŸ“ Project Structure

The project follows a clean, organized structure for maintainability and scalability:
LiteTTS/
β”œβ”€β”€ LiteTTS/                   # Core TTS engine modules
β”‚   β”œβ”€β”€ tests/                 # Test suite
β”‚   β”œβ”€β”€ scripts/               # Utility scripts
β”‚   β”œβ”€β”€ models/                # ONNX model files
β”‚   β”œβ”€β”€ voices/                # Voice data files
β”‚   β”œβ”€β”€ cache/                 # Runtime cache
β”‚   └── ...                    # Core modules
β”œβ”€β”€ docs/                      # Documentation
β”œβ”€β”€ static/                    # Static web assets
β”œβ”€β”€ config/                    # Configuration files
β”œβ”€β”€ app.py                     # Main application entry point
β”œβ”€β”€ docker-compose.yml         # Docker orchestration
└── Dockerfile                 # Container definition

πŸ“ Server Startup Options

**Multiple ways to start the server:**
# Direct Python execution (recommended)
python app.py --host 0.0.0.0 --port 8354        # Override host and port
python app.py --reload --workers 1              # Development with specific workers

# Alternative startup methods
python -m LiteTTS.start_server                  # Module execution
uvicorn app:app --host 0.0.0.0 --port 8354      # Direct uvicorn (requires explicit port)

Note You can also modify the core ./config/settings.json file directly, but it's not recommended as it will be overwritten on updates. Instead, use the override.json method to customize settings.

πŸ”§ Configuration Hierarchy

Configuration precedence (highest to lowest priority):

  1. Command-line arguments (--port, --host, --workers)
  2. Environment variables (PORT, API_HOST, WORKERS)
  3. ./config/override.json (rename override.json.example to override.json for custom settings)
  4. ./config/settings.json (base defaults - port 8354)
  5. Default values (Port 8354 represents "TTS" in English Gematria (an arbitrary, unused port)

πŸ”„ Development Mode

For development with hot reload (detects changes and restarts automatically):

# Recommended: Direct Python execution with hot reload
python app.py --reload

# Alternative: uvicorn with explicit configuration
uv run uvicorn app:app --reload --host 0.0.0.0 --port 8354 --workers 1

Note: The reload flag enables Hot Module Replacement (HMR) for automatic restarts on code changes.

πŸ“– See the complete Development Documentation

πŸ“š Advanced Usage

For advanced configuration options, see the [Configuration Guide](docs/CONFIGURATION.md) and [complete documentation](#-documentation).

⚑ Instant Test

# Test with a simple phrase (will be cached for instant future responses)
curl -X POST "http://localhost:8354/v1/audio/speech" \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello, world!", "voice": "af_heart", "response_format": "mp3"}' \
  --output hello.mp3

# Test again - should respond in ~29ms! ⚑ (99x speedup from cache)
curl -X POST "http://localhost:8354/v1/audio/speech" \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello, world!", "voice": "af_heart", "response_format": "mp3"}' \
  --output hello_cached.mp3 -w "Time: %{time_total}s\n"

An optimized model for your system is automatically downloaded on first run.

πŸ“¦ Dependencies & Installation

LiteTTS requires Python 3.12+ and several core dependencies for optimal performance.

Key Dependencies:

  • Core: FastAPI, uvicorn, soundfile, numpy, kokoro-onnx, onnxruntime
  • Optional: Perth watermarking (resemble-perth), GPU acceleration
  • Development: pytest, black, ruff for contributors

πŸ“– See the complete Dependencies & Installation Guide

πŸ’» Development Roadmap

This project has an ambitious roadmap for cross-platform testing, performance optimization, and AI integration enhancements.

Key Development Areas

  • 🌍 Multi-Language Support: Spanish, French, German, Japanese, Mandarin Chinese (2025)
  • ⚑ Performance Optimization: GPU acceleration, model quantization, edge computing
  • πŸ€– Advanced Features: Voice cloning, emotion control, contextual awareness
  • πŸ§ͺ Cross-Platform Testing: macOS, Windows, Linux, mobile, cloud platforms
  • 🀝 Community Contributions: Voice donation program, quality assurance pipeline

πŸ“– See the complete Development Roadmap

πŸ”Œ API Basic Usage

OpenAI-Compatible API

# Basic text-to-speech
curl -X POST 'http://localhost:8354/v1/audio/speech' \
  -H 'Content-Type: application/json' \
  -d '{"input": "Hello world", "voice": "af_heart", "response_format": "mp3"}' \
  --output hello.mp3

# With SSML and background sounds
curl -X POST 'http://localhost:8354/v1/audio/speech' \
  -H 'Content-Type: application/json' \
  -d '{"input": "<speak><background type=\"rain\" volume=\"20\">It'\''s raining outside</background></speak>", "voice": "af_bella"}' \
  --output rain.mp3

πŸ“– See the complete Advanced API Usage guide

OpenWebUI Integration

In OpenWebUI Settings β†’ Audio:

  • TTS Engine: OpenAI
  • API Base URL: http://YOUR_IP:8354/v1
  • TTS Model: litetts
  • TTS Voice: af_heart

πŸ“– See the complete OpenWebUI Integration guide

βš™οΈ Configuration

LiteTTS uses a flexible configuration system that allows easy customization while maintaining sensible defaults.

Quick Configuration

Basic customization using override.json:

{
  "server": {
    "port": 9000,
    "host": "127.0.0.1"
  },
  "voice": {
    "default_voice": "af_bella"
  }
}

Complete Configuration Guide

For comprehensive configuration options including:

  • Server and performance settings
  • Voice and audio customization
  • Text processing features
  • Caching and monitoring
  • Beta features and advanced options

πŸ“– See the complete Configuration Guide

πŸ”’ Perth Watermarking System

LiteTTS includes an integrated Perth audio watermarking system for responsible AI compliance and content authenticity verification.

Key Features

  • πŸ›‘οΈ Automatic Watermarking: All generated TTS audio is automatically watermarked
  • πŸ” Content Authenticity: Verify audio origin and detect AI-generated content
  • βš–οΈ Ethical AI Compliance: Transparent disclosure of AI-generated content
  • 🚫 Deepfake Detection: Support for identifying synthetic audio content
  • βš™οΈ Configurable Strength: Adjustable watermark intensity (0.1-2.0)
  • βœ… Production Ready: Perth library installed and functional

πŸ“– See the complete Watermarking Guide

πŸ“Š Monitoring & Observability

LiteTTS includes comprehensive monitoring and observability features for production deployments.

Key Features

  • Health Monitoring: Real-time component status and system health checks
  • Performance Metrics: Response times, throughput, and resource utilization
  • Fault Tolerance: Circuit breakers, retry logic, and graceful degradation
  • Structured Logging: JSON logs with correlation IDs and performance data
  • Production Dashboard: Web-based monitoring interface at /dashboard

Quick System Checks

# Check overall system health
curl http://localhost:8354/health

# Access monitoring dashboard
http://localhost:8354/dashboard

# Get performance metrics
curl http://localhost:8354/metrics

πŸ“– See the complete Monitoring & Observability Guide

🀝 Contributing

Contributions are welcome! Please see our [Contributing Guide](docs/CONTRIBUTIONS.md) for details.

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

⚠️ Ethical Use Disclaimer

**By using this model, you agree to uphold relevant legal standards and ethical responsibilities. This tool is not responsible for any misuse:**
  • 🚫 Identity Misuse: Do not produce audio resembling real individuals without explicit permission
  • 🚫 Deceptive Content: Do not use this model to generate misleading content (e.g., fake news, impersonation)
  • 🚫 Illegal or Malicious Use: Do not use this model for activities that are illegal or intended to cause harm

We strongly encourage responsible AI practices and respect for individual privacy and consent.

🌸 About "Kokoro"

**"Kokoro"** (εΏƒ) is a Japanese word that encompasses a rich and complex meaning, often translated as "heart," but extending to include "mind," "spirit," "feeling," and even "essence" or "core". It's not just a physical organ or a simple emotion, but rather the seat of consciousness, thoughts, feelings, and will. This name reflects our commitment to creating TTS technology that captures not just the words, but the heart and spirit of human communication.

πŸ™ Acknowledgments

**LiteTTS is built on the excellent work of the Kokoro TTS project:**

Additional acknowledgments:

LiteTTS extends and optimizes the Kokoro model for production use as part of the TaskWizer framework, while maintaining full compatibility with the original Kokoro ecosystem.

Need help? Check our πŸ“š Documentation or create an issue!

About

LiteTTS

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages