NK

neosun100/kokoro-tts

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

19 stars 1 forks Качество 69 Тренд 10Apache-2.0

🎙️ All-in-One Docker image for Kokoro-82M TTS - Web UI, REST API, WebSocket, Streaming, Batch, MCP

Обзор

Web UI • REST API • WebSocket • Streaming • Batch • MCP - 🎨 - Modern interface with real-time audio playback - 🔌 - Full-featured HTTP endpoints with Swagger docs - 📡 - Real-time bidirectional TTS communication - 🌊 - Audio chunks delivered as they generate - 📦 - Process multiple texts in one request - 🤖 - AI agent integration (Claude, etc.) - 🌍 - English, Chinese, Japanese, Spanish, French, Hindi, Italian, Portuguese - 🚀 - CUDA support with automatic memory management - 📱 - Wide variety of male and female voices Open http://localhost:8300 in your browser. - Docker 20.10+ - NVIDIA GPU with CUDA support (optional, CPU fallback available) - nvidia-docker2 (for GPU support) - : http://localhost:8300/docs - : http://localhost:8300/redoc - : FastAPI, Uvicorn - : Kokoro-82M (StyleTTS 2) - : PyTorch, CUDA - : Docker, NVIDIA Container Toolkit Contributions are welcome! Please feel free to submit a Pull Request. 1. Fork the repository 2.

README

Показан фрагмент оригинального README. Открыть оригинал.

English | 简体中文 | 繁體中文 | 日本語


✨ Features

  • 🎨 Beautiful Web UI - Modern interface with real-time audio playback
  • 🔌 REST API - Full-featured HTTP endpoints with Swagger docs
  • 📡 WebSocket - Real-time bidirectional TTS communication
  • 🌊 Streaming - Audio chunks delivered as they generate
  • 📦 Batch Processing - Process multiple texts in one request
  • 🤖 MCP Server - AI agent integration (Claude, etc.)
  • 🌍 Multi-language - English, Chinese, Japanese, Spanish, French, Hindi, Italian, Portuguese
  • 🚀 GPU Accelerated - CUDA support with automatic memory management
  • 📱 54+ Voices - Wide variety of male and female voices

🚀 Quick Start

docker run -d --name kokoro-tts --gpus all -p 8300:8300 neosun/kokoro-tts:latest

Open http://localhost:8300 in your browser.

📦 Installation

Prerequisites

  • Docker 20.10+
  • NVIDIA GPU with CUDA support (optional, CPU fallback available)
  • nvidia-docker2 (for GPU support)

Docker Run

# With GPU
docker run -d \
  --name kokoro-tts \
  --gpus all \
  -p 8300:8300 \
  -e GPU_IDLE_TIMEOUT=600 \
  --restart unless-stopped \
  neosun/kokoro-tts:latest

# CPU only
docker run -d \
  --name kokoro-tts \
  -p 8300:8300 \
  --restart unless-stopped \
  neosun/kokoro-tts:latest

Docker Compose

services:
  kokoro-tts:
    image: neosun/kokoro-tts:latest
    container_name: kokoro-tts
    ports:
      - "8300:8300"
    environment:
      - GPU_IDLE_TIMEOUT=600
      - KEEP_MODEL_LOADED=true  # Never release model from memory
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    restart: unless-stopped
docker-compose up -d

Verify Installation

# Health check
curl http://localhost:8300/health

# Generate speech
curl -X POST http://localhost:8300/api/tts \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world","voice":"af_heart"}' \
  -o output.wav

⚙️ Configuration

Variable Default Description
PORT 8300 Server port
GPU_IDLE_TIMEOUT 300 Seconds before GPU memory release
Открыть полный README на GitHub

Установка

docker exec -i kokoro-tts python /app/docker/server.py mcp
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "kokoro-tts": { "command": "docker", "args": ["exec", "-i", "kokoro-tts", "python", "/app/docker/server.py", "mcp"] } } }