Sophon-Realtime-4B-Flash for Core AI
A Core AI conversion of adventists-ai/Sophon-Realtime-4B-Flash for macOS 27 and later. Sophon is a voice you talk with: its thinker hears your audio directly, decides when you've finished speaking, and writes a reply that its talker speaks while it's still being written.
This bundle is what CoreAI Studio, a macOS app, loads for its Speech β Conversation tab and its Sophon text-to-speech voice. The host logic (prompt layout, turn questions, the session timing) is a Swift port of mac/engine.py from sophon-realtime.
Contents
| File | What it is | Precision | Size |
|---|---|---|---|
ear.aimodel |
Audio encoder: one 8 s block of Whisper-large-v3 log-mel (128 Γ 800) and a token mask in, 52 thinker embeddings out | fp16 | 376 MB |
thinker.aimodel |
Qwen3-4B decoder (36 layers), external KV cache, dynamic length up to 2048 | int8 weights | 4.0 GB |
talker.aimodel |
Qwen3-TTS talker (28 layers), external KV cache, up to 1024 | int8 weights | 1.4 GB |
code_frame.aimodel |
The 5-layer code predictor for a whole 80 ms frame: talker hidden state and codebook-0 embedding in; all 15 steps, with top-50 sampling at temperature 0.7 from host-supplied Gumbel noise, inside one graph; codebooks 1β15 and the sum of their embeddings out | fp16 | 335 MB |
speech_decoder.aimodel |
Streaming speech decoder: 16 codes in, one 80 ms frame (1920 samples at 24 kHz) out, with its convolution state and a 72-frame attention window passed in and out | fp16 | 233 MB |
tables/ |
Thinker and talker text embeddings (int8 with a per-row fp16 scale), the talker codec embeddings (fp16), and four speaker vectors: chelsie_en, chelsie_zh, brand_en, brand_zh |
680 MB | |
tokenizer/ |
The thinker's Qwen tokenizer, unchanged | 15 MB | |
sophon.json |
Shapes, token ids, prompts and turn-question layout the host needs |
The log-mel front end is Whisper-large-v3's and isn't included; CoreAIKit's AudioMelPreprocessor.whisperLargeV3() computes it.
Changes from the original
As required by section 4(b) of the Apache License 2.0, these files were modified from the original Sophon-Realtime-4B-Flash weights:
- Converted from PyTorch safetensors to Core AI
.aimodelgraphs with coreai-models. - The thinker and talker weights were quantized to int8 (symmetric, per-block of 32 along the input dimension). The ear, code predictor and speech decoder are fp16.
- The embedding tables were extracted from the checkpoints into flat files; the text embedding tables were quantized to int8 with one scale per row.
- The speech decoder was restructured into a single-frame streaming step with explicit state.
- The code predictor's 15 sequential steps, its sampling, and its codebook embedding lookups were fused into one graph.
No weights were retrained or fine-tuned.
Accuracy
Each converted graph was compared with the original model on the same inputs:
| Graph | Check | Result |
|---|---|---|
| Speech decoder | Waveform vs. the MLX reference decoder | 62.5 dB SNR |
| Ear | Embeddings vs. the MLX reference encoder | 51 dB SNR |
| Thinker (int8) | Logits on a real prompt vs. fp32 | 31β34 dB SNR, same top-1 token at every step |
| Talker (int8) | Logits on a real prefill vs. fp32 | KL β€ 0.019, same top-10 codes |
| Code frame | fp32 PyTorch module vs. the per-step predictor | 104 dB logit SNR; all 120 codes identical with the same noise |
| Code frame (compiled) | Graph samples vs. fp32 | Mean log-probability under fp32 β3.46, vs. β3.53 for fp32's own samples |
End to end on an M4 Pro (48 GB), speech is generated at 1.5β2Γ real time, the turn check takes 0.2β1.5 s, and the first reply audio arrives 0.26β0.41 s after the reply starts.
Loading notes
Load the graphs with the GPU preferred and expectFrequentReshapes = true. Without it, the decoders are re-specialized for every new sequence length, partly for the Neural Engine, whose compiler fails on the int8 talker on macOS 27.3.
License
Apache License 2.0, the same as the original. See LICENSE and NOTICE. The original weights are derived from Qwen3-4B, Qwen3-ASR and Qwen3-TTS by the Qwen team, Alibaba, all under the Apache License 2.0.
Model tree for amosgyamfi/Sophon-Realtime-4B-Flash-CoreAI
Base model
adventists-ai/Sophon-Realtime-4B-Flash