CoolFace
Modelpublic

aufklarer/Kokoro-82M-CoreML

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
5likes3.3kdownloads
Model Card

Kokoro-82M CoreML

End-to-end CoreML export of hexgrad/Kokoro-82M at FP16, optimized for Apple Neural Engine. Requires iOS 18+ / macOS 15+.

A single kokoro_5s.mlmodelc runs the full pipeline (BERT → duration prediction → fixed-shape alignment → prosody → decoder) in one CoreML call. G2P (grapheme-to-phoneme) is a separate pair of CoreML models.

Looking for a smaller variant? See `aufklarer/Kokoro-82M-CoreML-INT8` — INT8 k-means palettized, 83 MB vs 325 MB here, with log-spec distance 0.42 vs this FP16 reference on a validation utterance.

Model

ParameterValue
Parameters82M
PrecisionFP16
Max audio length5 s (200 frames @ 40 fps)
Sample rate24 kHz
Style dimension256
Max phonemes per pass128

Files

FileSizeDescription
kokoro_5s.mlmodelc325 MBPre-compiled E2E model (pre-compiled, loads directly on-device)
G2PEncoder.mlmodelc0.7 MBGrapheme-to-phoneme encoder
G2PDecoder.mlmodelc0.8 MBGrapheme-to-phoneme decoder
voices/0.5 MB54 preset voice embeddings (10 languages)
vocab_index.json4 KBPhoneme vocabulary
g2p_vocab.json4 KBG2P vocabulary
us_gold.json, us_silver.json6 MBEnglish pronunciation dictionaries
pipeline_config.json4 KBSwift pipeline config

Voices

54 preset voices across 10 languages: English (US/UK), Spanish, French, Hindi, Italian, Japanese, Korean, Portuguese, Chinese.

Usage

Add speech-swift to Package.swift:

swift
.package(url: "https://github.com/soniqo/speech-swift", branch: "main")

Then synthesize:

swift
import KokoroTTS

let tts = try await KokoroTTSModel.fromPretrained(
    modelId: "aufklarer/Kokoro-82M-CoreML"
)
let audio = try await tts.synthesize(
    "Hello world, this is a Kokoro test.",
    voice: "af_heart"
)

CLI:

bash
swift run audio kokoro "Hello world" --voice af_heart --output out.wav

Source

License

  • Model weights: Apache-2.0
  • CoreML conversion: Apache-2.0

Links