Views
No views yet
coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta, 2026-06).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.import CoreAIOps; no session, no model plumbing, downloads on first use):let audio = try await CoreAI.speak(text, options: .model("kokoro-82m"))1git clone https://github.com/john-rocky/coreai-kit
2open coreai-kit/Examples/Speak/Speak.xcodeproj
3# → Run, then pick "Kokoro 82M" in the model picker
4
5# agents / headless (macOS):
6cd coreai-kit/Examples/Speak
7swift run speak-cli --model kokoro-82m --text "Hello from Core AI." --output hello.wav1import CoreAIKit
2
3let speaker = try await KitSpeaker(catalog: "kokoro-82m")
4let audio = try await speaker.synthesize(text)
5// audio.samples: 24 kHz mono PCM in [-1, 1] — play it or write a WAVExamples/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.https://github.com/john-rocky/coreai-kit → product CoreAIKitdownloadProgress callback).aimodel bundles with two cheap host
steps between them:| file | in → out |
|---|---|
kokoro_predictor.aimodel | input_ids[1,128] i32, ref_s[1,256], attn_mask[1,128] → duration, d, t_en |
kokoro_prosody.aimodel | d, t_en, aln[1,128,512], ref_s, frame_mask[1,512] → asr, F0, N |
kokoro_vocoder.aimodel | asr, 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.text ──(misaki G2P)──▶ ids ──▶ predictor ──▶ [build alignment] ──▶ prosody
──▶ [har = STFT(SineGen(f0_upsamp(F0)))] ──▶ vocoder ──▶ [trim] ──▶ 24 kHz audiomisaki[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).af_heart, multiple sentences). Raw waveform correlation ~0.98 — the bounded,
inaudible effect of the bucket pad boundary.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.coreai_models.