Aller au contenu
ModelPrésentéExterne
Browse files

Kokoro 82M CoreAI

hexgrad/Kokoro-82M (Apache-2.0), a tiny high-quality StyleTTS2 + iSTFTNet text-to-speech model (82M params, 24 kHz), converted to Apple Core AI (.aimodel, iOS 27 / macOS 27) — the CoreAI-Model-Zoo's first TTS.

TypeOtherModèle de basehexgrad/Kokoro-82MVersionRevision 3b87e44BClasse

Source du modèle

Type
Other
Taille du fichier
40 B–511 KB
Modèle de base
hexgrad/Kokoro-82M
Version
vRevision 3b87e44
Mis à jour
6 oct. 2026
Téléchargements
22
Source
Hugging Face

Description de la source

Kokoro-82M — Core AI

hexgrad/Kokoro-82M (Apache-2.0), a tiny high-quality StyleTTS2 + iSTFTNet text-to-speech model (82M params, 24 kHz), converted to Apple Core AI (.aimodel, iOS 27 / macOS 27) — the CoreAI-Model-Zoo's first TTS.

Non-autoregressive: phonemes + a voice/style vector → a waveform in one pass. Runs fully on-device, English-first, with grapheme→phoneme on the host.

Use it

⚡ One line — run the kit's task op on this model (import CoreAIOps; no session, no model plumbing, downloads on first use):

let audio = try await CoreAI.speak(text, options: .model("kokoro-82m"))

Twenty ops, one shape — Cookbook.

▶️ Run it (source) — the Speak runner (GUI + CLI, one app for every text-to-speech model in the catalog):

git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/Speak/Speak.xcodeproj
# → Run, then pick "Kokoro 82M" in the model picker

# agents / headless (macOS):
cd coreai-kit/Examples/Speak
swift run speak-cli --model kokoro-82m --text "Hello from Core AI." --output hello.wav

💻 Build with it — complete; the glue is kit API, copy-paste runs:

import CoreAIKit

let speaker = try await KitSpeaker(catalog: "kokoro-82m")
let audio = try await speaker.synthesize(text)
// audio.samples: 24 kHz mono PCM in [-1, 1] — play it or write a WAV

The take-home is Examples/Speak/Sources/QuickStart.swift — this exact code as one typed function, no UI; the CLI is an argument shell over it, and the GUI drives the same KitSpeaker(catalog:) and plays the samples. English-first: G2P is a dictionary over the bundled misaki lexicons (~180k words); out-of-dictionary words are letter-spelled (no neural fallback). 28 voices ride the download — af_heart is the default; the underlying KokoroTTS takes a voice: label. Streaming? synthesizeStreaming(_:onChunk:) hands you a chunk per sentence.

Integration checklist

  • SPM: https://github.com/john-rocky/coreai-kit → product CoreAIKit
  • Info.plist: none needed
  • Entitlements: none needed
  • First run downloads the model — 0.3 GB (Mac) — then it loads from the local cache (Application Support; progress via the downloadProgress callback)
  • Measure in Release — Debug is ~3× slower on per-token host work

Bundles

The acoustic graph has one data-dependent length (the duration→alignment expansion), so it is cut into three voice-independent .aimodel bundles with two cheap host steps between them:

filein → out
kokoro_predictor.aimodelinput_ids[1,128] i32, ref_s[1,256], attn_mask[1,128] → duration, d, t_en
kokoro_prosody.aimodeld, t_en, aln[1,128,512], ref_s, frame_mask[1,512] → asr, F0, N
kokoro_vocoder.aimodelasr, F0, N, har, ref_s, frame_mask → audio[1, L·600]

voices/*.pt — the 28 English voice packs (Apache-2.0). The voice is the ref_s input: ref_s = pack[len(ids)−1]. Quality leaders: af_heart, af_bella, af_nicole, bf_emma.

Token length T and frame length L are fixed buckets (128 / 512); the host left-pads to the bucket and trims the output. Longer text is split into sentences host-side. Run on the Core AI CPU compute unit. ~0.75 s / utterance on M4 Max, ~335 MB total (fp32).

Host steps

text ──(misaki G2P)──▶ ids ──▶ predictor ──▶ [build alignment] ──▶ prosody
     ──▶ [har = STFT(SineGen(f0_upsamp(F0)))] ──▶ vocoder ──▶ [trim] ──▶ 24 kHz audio

G2P is misaki (misaki[en], no espeak for English); on-device MisakiSwift gives the same English phonemes. har (the hn-nsf source's STFT) is a windowed FFT computed on the host — the one piece that must stay off the engine (its atan2 phase flips 2π at the F0→0 pad boundary under fp32).

Quality

The hn-nsf source phase is arbitrary (stock Kokoro randomizes it), so the gate is spectral: magnitude-spectrogram correlation 0.999 vs the PyTorch reference (af_heart, multiple sentences). Raw waveform correlation ~0.98 — the bounded, inaudible effect of the bucket pad boundary.

Convert / re-bucket

conversion/export_kokoro.py (python export_kokoro.py --out-dir out; --verify runs the engine-vs-torch spectral gate; --token-bucket / --frame-bucket to re-size). Card + the full port write-up: zoo/kokoro-82m.md.

License

Apache-2.0 (model weights and the 28 English voices). The Core AI export code derives from Apple's BSD-3-Clause coreai_models.


More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.

Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.

Sources

1 source
Hugging FacePrincipalVersion 3b87e44e36d8aa10aa64f26c31185b322ab7a83d
huggingface.co/mlboydaisuke/Kokoro-82M-CoreAI/tree/3b87e44e36d8aa10aa64f26c31185b322ab7a83d

Vérifié 23 août

Download files

Artefacts du modèle

57 artefacts

kokoro_host_glue/l_linear.bin

bin · 40 B · SHA-256 4d0be6c9712b…d425 · Hugging Face

Download file

kokoro_host_glue/voices/af_alloy.bin

bin · 510 KB · SHA-256 c4a6b876047f…8c45 · Hugging Face

Download file

kokoro_host_glue/voices/af_aoede.bin

bin · 510 KB · SHA-256 4a004c334307…8361 · Hugging Face

Download file

kokoro_host_glue/voices/af_bella.bin

bin · 510 KB · SHA-256 f69d836209b7…5c8b · Hugging Face

Download file

kokoro_host_glue/voices/af_heart.bin

bin · 510 KB · SHA-256 d583ccff3cdc…8f0b · Hugging Face

Download file

kokoro_host_glue/voices/af_jessica.bin

bin · 510 KB · SHA-256 a240a5e3c15b…3bd8 · Hugging Face

Download file

kokoro_host_glue/voices/af_kore.bin

bin · 510 KB · SHA-256 9be5221b6a94…819e · Hugging Face

Download file

kokoro_host_glue/voices/af_nicole.bin

bin · 510 KB · SHA-256 cd2191ab31b9…f59a · Hugging Face

Download file

kokoro_host_glue/voices/af_nova.bin

bin · 510 KB · SHA-256 18778272caa0…414f · Hugging Face

Download file

kokoro_host_glue/voices/af_river.bin

bin · 510 KB · SHA-256 00a2bcf82b1d…9c30 · Hugging Face

Download file

kokoro_host_glue/voices/af_sarah.bin

bin · 510 KB · SHA-256 4409fbc125af…2f0a · Hugging Face

Download file

kokoro_host_glue/voices/af_sky.bin

bin · 510 KB · SHA-256 4435255c9744…f0b9 · Hugging Face

Download file

kokoro_host_glue/voices/am_adam.bin

bin · 510 KB · SHA-256 162b035ed91c…5716 · Hugging Face

Download file

kokoro_host_glue/voices/am_echo.bin

bin · 510 KB · SHA-256 3968b92c3c4c…f3c3 · Hugging Face

Download file

kokoro_host_glue/voices/am_eric.bin

bin · 510 KB · SHA-256 e8b5be17edd1…2832 · Hugging Face

Download file

kokoro_host_glue/voices/am_fenrir.bin

bin · 510 KB · SHA-256 c27989f741f7…df43 · Hugging Face

Download file

kokoro_host_glue/voices/am_liam.bin

bin · 510 KB · SHA-256 52403be32fd0…1ade · Hugging Face

Download file

kokoro_host_glue/voices/am_michael.bin

bin · 510 KB · SHA-256 1d1f21dd8da3…5ba1 · Hugging Face

Download file

kokoro_host_glue/voices/am_onyx.bin

bin · 510 KB · SHA-256 da5d135b4241…45e6 · Hugging Face

Download file

kokoro_host_glue/voices/am_puck.bin

bin · 510 KB · SHA-256 fcf73c989033…74a0 · Hugging Face

Download file

kokoro_host_glue/voices/am_santa.bin

bin · 510 KB · SHA-256 61150cf726ab…227a · Hugging Face

Download file

kokoro_host_glue/voices/bf_alice.bin

bin · 510 KB · SHA-256 08afa6ba24da…5573 · Hugging Face

Download file

kokoro_host_glue/voices/bf_emma.bin

bin · 510 KB · SHA-256 669fe0647f9d…3b73 · Hugging Face

Download file

kokoro_host_glue/voices/bf_isabella.bin

bin · 510 KB · SHA-256 3754352c4aaa…e94f · Hugging Face

Download file

kokoro_host_glue/voices/bf_lily.bin

bin · 510 KB · SHA-256 5e0ee32ebe64…a335 · Hugging Face

Download file

kokoro_host_glue/voices/bm_daniel.bin

bin · 510 KB · SHA-256 6b3194bbceff…a1e8 · Hugging Face

Download file

kokoro_host_glue/voices/bm_fable.bin

bin · 510 KB · SHA-256 f88908319680…98f1 · Hugging Face

Download file

kokoro_host_glue/voices/bm_george.bin

bin · 510 KB · SHA-256 c4b235a4c1f2…c9bc · Hugging Face

Download file

kokoro_host_glue/voices/bm_lewis.bin

bin · 510 KB · SHA-256 b8f671cef828…db97 · Hugging Face

Download file

voices/af_alloy.pt

pt · 511 KB · SHA-256 6d877149dd8b…5aa3 · Hugging Face

Download file

voices/af_aoede.pt

pt · 511 KB · SHA-256 c03bd1a4c371…1cc4 · Hugging Face

Download file

voices/af_bella.pt

pt · 511 KB · SHA-256 8cb64e02fcc8…48d6 · Hugging Face

Download file

voices/af_heart.pt

pt · 511 KB · SHA-256 0ab5709b8ffa…b4ff · Hugging Face

Download file

voices/af_jessica.pt

pt · 511 KB · SHA-256 cdfdccb8cc97…4e87 · Hugging Face

Download file

voices/af_kore.pt

pt · 511 KB · SHA-256 8bfbc512321c…d69d · Hugging Face

Download file

voices/af_nicole.pt

pt · 511 KB · SHA-256 c5561808bcf5…c5da · Hugging Face

Download file

voices/af_nova.pt

pt · 511 KB · SHA-256 e0233676ddc2…bcd2 · Hugging Face

Download file

voices/af_river.pt

pt · 511 KB · SHA-256 e149459bd9c0…ab8f · Hugging Face

Download file

voices/af_sarah.pt

pt · 511 KB · SHA-256 49bd364ea3be…cef9 · Hugging Face

Download file

voices/af_sky.pt

pt · 511 KB · SHA-256 c799548aed06…512c · Hugging Face

Download file

voices/am_adam.pt

pt · 511 KB · SHA-256 ced7e284aba1…cb34 · Hugging Face

Download file

voices/am_echo.pt

pt · 511 KB · SHA-256 8bcfdc852bc9…61e8 · Hugging Face

Download file

voices/am_eric.pt

pt · 511 KB · SHA-256 ada66f0eefff…2aae · Hugging Face

Download file

voices/am_fenrir.pt

pt · 511 KB · SHA-256 98e507eca1db…c37a · Hugging Face

Download file

voices/am_liam.pt

pt · 511 KB · SHA-256 c82550757ddb…8518 · Hugging Face

Download file

voices/am_michael.pt

pt · 511 KB · SHA-256 9a443b79a4b2…bd37 · Hugging Face

Download file

voices/am_onyx.pt

pt · 511 KB · SHA-256 e8452be16cd0…d584 · Hugging Face

Download file

voices/am_puck.pt

pt · 511 KB · SHA-256 dd1d8973f4ce…6223 · Hugging Face

Download file

voices/am_santa.pt

pt · 511 KB · SHA-256 7f2f7582fa2b…97a7 · Hugging Face

Download file

voices/bf_alice.pt

pt · 511 KB · SHA-256 d292651b6af6…b3f3 · Hugging Face

Download file

voices/bf_emma.pt

pt · 511 KB · SHA-256 d0a423deabf4…a701 · Hugging Face

Download file

voices/bf_isabella.pt

pt · 511 KB · SHA-256 cdd4c3700380…eefd · Hugging Face

Download file

voices/bf_lily.pt

pt · 511 KB · SHA-256 6e09c2e481e2…9285 · Hugging Face

Download file

voices/bm_daniel.pt

pt · 511 KB · SHA-256 fc3fce4e9c12…fc5d · Hugging Face

Download file

voices/bm_fable.pt

pt · 511 KB · SHA-256 d44935f31352…079c · Hugging Face

Download file

voices/bm_george.pt

pt · 511 KB · SHA-256 f1bc812213dc…811b · Hugging Face

Download file

voices/bm_lewis.pt

pt · 511 KB · SHA-256 b5204750dcba…bd0e · Hugging Face

Download file

Extraits de sources

2 extraits

--- license: apache-2.0 language: - en library_name: coreai pipeline_tag: text-to-speech tags: - text-to-speech - tts - core-ai - coreml - on-device - styletts2 - kokoro base_model: hexgrad/Kokoro-82M --- # Kokoro-82M — Core AI [`hexgrad/Kokoro-82M`](https://huggingface.co/hexgrad/Kokoro-82M) (Apache-2.0), a tiny high-quality **StyleTTS2 + iSTFTNet** text-to-speech model (82M params, 24 kHz), converted to Apple **Core AI** (`.aimodel`, iOS 27 / macOS 27) — the [CoreAI-Model-Zoo](https://github.com/john-rocky/coreai-model-zoo)'s first TTS. Non-autoregressive: phonemes + a voice/style vector → a waveform in one pass. Runs fully on-device, English-first, with grapheme→phoneme on the host. <!-- gen-cards:use-it begin id=kokoro-82m (managed by scripts/gen-cards — edit cards.json / QuickStart.swift, not this block) --> ## Use it ⚡ **One line** — run the kit's task op on this model (`import CoreAIOps`; no session, no model plumbing, downloads on first use): ```swift let audio = try await CoreAI.speak(text, options: .model("kokoro-82m")) ``` Twenty ops, one shape — [Cookbook](https://github.com/john-rocky/coreai-kit/blob/main/docs/COOKBOOK.md). ▶️ **Run it (source)** — the [Speak runner](https://github.com/john-rocky/coreai-kit/tree/main/Examples/Speak) (GUI + CLI, one app for every text-to-speech model in the catalog): ```bash git clone https://github.com/john-rocky/coreai-kit open coreai-kit/Examples/Speak/Speak.xcodeproj # → Run, then pick "Kokoro 82M" in the model picker # agents / headless (macOS): cd coreai-kit/Examples/Speak swift run speak-cli --model kokoro-82m --text "Hello from Core AI." --output hello.wav ``` 💻 **Build with it** — complete; the glue is kit API, copy-paste runs: ```swift import CoreAIKit let speaker = try await KitSpeaker(catalog: "kokoro-82m") let audio = try await speaker.synthesize(text) // audio.samples: 24 kHz mono PCM in [-1, 1] — play it or write a WAV ``` The take-home is [`Examples/Speak/Sources/QuickStart.swift`](https://github.com/john-rocky/coreai-kit/blob/main/Examples/Speak/Sources/QuickStart.swift) — this exact code as one typed function, no UI; the CLI is an argument shell over it, and the GUI drives the same `KitSpeaker(catalog:)` and plays the samples. English-first: G2P is a dictionary over the bundled misaki lexicons (~180k words); out-of-dictionary words are letter-spelled (no neural fallback). 28 vo...

Source context: 22 downloads · 1 likes · Pipeline text-to-speech · Library coreai · Repo mlboydaisuke/Kokoro-82M-CoreAI