Kokoro TTS logo

Kokoro TTS

Fast and efficient open-weight text-to-speech model

Model Details

A lightweight 82M parameter TTS model that delivers high-quality speech synthesis with minimal computational requirements.

Parameters

82 million

Context Window

512 tokens

Recommended Use

Ideal for text-to-speech applications requiring fast inference and high-quality output.

Supported Languages

Multilingual

Usage Examples

Installation:

pip install tinfoil

Inference:

import os
from tinfoil import TinfoilAI

client = TinfoilAI(
    api_key="YOUR_API_KEY",
    enclave="audio-processing.model.tinfoil.sh",
    repo="tinfoilsh/confidential-audio-processing"
)

# Generate speech from text
response = client.audio.speech.create(
    model="kokoro",
    voice="af_sky+af_bella",
    input="Hello world! This is a test of text-to-speech synthesis."
)

# Save the audio file
response.write_to_file("output.mp3")
print("Speech saved to output.mp3")

# Or stream directly to a file
with open("output.mp3", "wb") as f:
    response.stream_to_file(f)