AI AUDIO & SPEECH · DOCKER & GPU

kokoro-82m-tts

High-fidelity neural text-to-speech engine with native Brazilian Portuguese voices and OpenAI API compatibility.

Model
Kokoro-82M
API
OpenAI /v1/audio/speech
Voices pt-BR
pf_dora, pm_alex, pm_santa
Deployment
Docker + NVIDIA GPU

Executive TL;DR — Engineering Brief

kokoro-82m-tts is an open source deployment packaging developed by Alex Santos. It transforms the raw Kokoro-82M library into an enterprise-ready Docker container featuring an OpenAI-compatible audio API, native pt-BR voice models, and automated test suites.

DIAGRAM & WORKFLOW

Inference & API Gateway Architecture

FastAPI gateway streaming neural audio chunks with CUDA acceleration and voice embedding caching.

DETAILED ENGINEERING

Core Technical Pillars

Design choices, architectural patterns, and engineering decisions implemented for extreme reliability and developer experience.

01

100% OpenAI API Compatible Endpoint

Drop-in replacement for /v1/audio/speech across existing AI apps

Allows existing applications, agents, and pipelines built for OpenAI audio to switch to self-hosted Kokoro with zero code modifications.

02

Fine-Tuned Native Brazilian Portuguese Voices

pf_dora, pm_alex, and pm_santa delivering natural prosody

Engineered specifically to overcome the lack of high-quality, open source Brazilian Portuguese neural speech voices.

03

Production Docker with GPU Acceleration

Containerized deployment with CUDA runtime and automated fallback

Includes Dockerfile and compose templates optimizing NVIDIA GPU memory utilization for sub-second audio synthesis.

04

Automated Verification Test Suite

Comprehensive testing script verifying 7 synthesis scenarios

Validates voice selection, streaming playback, sample rates, and error responses before deployment.

CODE IN ACTION

cURL & Python Client Examples

Real-world usage, terminal configuration, and technical integration commands.

Terminal Example SHELL
# cURL request to OpenAI-compatible endpoint
curl http://localhost:8880/v1/audio/speech   -H "Content-Type: application/json"   -d '{
    "model": "kokoro",
    "input": "Olá! Este é um teste de síntese de voz em português brasileiro.",
    "voice": "pm_alex",
    "response_format": "mp3"
  }' --output speech.mp3
QUESTIONS & ANSWERS

Technical Frequently Asked Questions

Key clarifications regarding licensing, compatibility, deployment, and security.

What are the hardware requirements?

Runs smoothly on NVIDIA GPUs with 4GB+ VRAM, or multi-core modern CPUs.

Which audio output formats are supported?

MP3, WAV, AAC, and Opus.

Can I use it with LibreChat or OpenWebUI?

Yes, directly configure http://localhost:8880 as your TTS provider.

Is commercial use permitted?

Yes, released under the Apache-2.0 open source license.