diff --git a/blueprints/kokoro-tts/docker-compose.yml b/blueprints/kokoro-tts/docker-compose.yml new file mode 100644 index 00000000..a0298ce1 --- /dev/null +++ b/blueprints/kokoro-tts/docker-compose.yml @@ -0,0 +1,23 @@ +services: + kokoro-tts: + build: + context: https://github.com/remsky/Kokoro-FastAPI.git#master + dockerfile: docker/cpu/Dockerfile + restart: unless-stopped + ports: + - 8880 + environment: + - MODEL_PATH=/app/models + - DEVICE=${DEVICE:-cpu} + - HOST=0.0.0.0 + - PORT=8880 + volumes: + - kokoro-models:/app/models + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8880/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s +volumes: + kokoro-models: diff --git a/blueprints/kokoro-tts/kokoro-tts.svg b/blueprints/kokoro-tts/kokoro-tts.svg new file mode 100644 index 00000000..5ed64ed8 --- /dev/null +++ b/blueprints/kokoro-tts/kokoro-tts.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/blueprints/kokoro-tts/template.toml b/blueprints/kokoro-tts/template.toml new file mode 100644 index 00000000..73f367c4 --- /dev/null +++ b/blueprints/kokoro-tts/template.toml @@ -0,0 +1,72 @@ +[variables] +main_domain = "${domain}" +device = "cpu" + +[config] +env = [ + "DEVICE=${device}", + "MODEL_PATH=/app/models", + "HOST=0.0.0.0", + "PORT=8880", + "PYTHONUNBUFFERED=1", + "UV_SYSTEM_PYTHON=1" +] + +[[config.domains]] +serviceName = "kokoro-tts" +port = 8880 +host = "${main_domain}" +path = "/" + +[[config.mounts]] +filePath = "README.md" +content = """# Kokoro TTS FastAPI + +This template provides a Dockerized FastAPI wrapper for the Kokoro-82M text-to-speech model. + +## Features + +- Multi-language support (English, Japanese, Chinese) +- OpenAI-compatible speech endpoint +- CPU and GPU support +- Web interface for monitoring +- RESTful API with comprehensive documentation +- Streaming audio generation +- Word-level timestamps and phonemes + +## Usage + +- **Web Interface**: Access the web UI at `https://${main_domain}/web` +- **API Documentation**: Available at `https://${main_domain}/docs` +- **Health Check**: Monitor service health at `https://${main_domain}/health` + +## Configuration + +The service runs on port 8880 and supports both CPU and GPU inference. +For GPU support, ensure your Dokploy instance has NVIDIA GPU support enabled. + +## API Endpoints + +- `POST /v1/audio/speech` - Generate speech from text (OpenAI compatible) +- `POST /dev/captioned_speech` - Generate speech with timestamps +- `POST /dev/phonemize` - Convert text to phonemes +- `POST /dev/generate_from_phonemes` - Generate audio from phonemes +- `GET /health` - Health check endpoint +- `GET /docs` - Interactive API documentation +- `GET /web` - Web interface + +## Model Information + +- Model: Kokoro-82M +- License: Apache-2.0 +- Repository: https://github.com/remsky/Kokoro-FastAPI +- HuggingFace Model: https://huggingface.co/hexgrad/Kokoro-82M + +## Notes + +- This template builds the image from source during deployment +- Uses CPU-optimized Dockerfile by default +- Initial build may take several minutes due to model download +- Ensure sufficient disk space for model storage +- For GPU support, change dockerfile path to `docker/gpu/Dockerfile` in docker-compose.yml +""" diff --git a/meta.json b/meta.json index be1c6ff8..a61b99c6 100644 --- a/meta.json +++ b/meta.json @@ -3195,6 +3195,25 @@ "personal" ] }, + { + "id": "kokoro-tts", + "name": "Kokoro TTS", + "version": "latest", + "description": "Dockerized FastAPI wrapper for the Kokoro-82M text-to-speech model with multi-language support and OpenAI-compatible endpoints.", + "logo": "kokoro-tts.svg", + "links": { + "github": "https://github.com/remsky/Kokoro-FastAPI", + "website": "https://github.com/remsky/Kokoro-FastAPI", + "docs": "https://github.com/remsky/Kokoro-FastAPI#readme" + }, + "tags": [ + "text-to-speech", + "ai", + "voice", + "fastapi", + "openai-compatible" + ] + }, { "id": "kokoro-web", "name": "Kokoro Web",