Qwen3-ASR 1.7B for Core ML (8-bit, Neural Engine)
Core ML packages of Qwen3-ASR 1.7B: an INT8 audio encoder and an 8-bit text decoder with a stateful KV cache, built to run on the Apple Neural Engine. This is the file set that KeyVoice for Mac downloads for on-device dictation.
For: KeyVoice users (the app downloads these files itself), and developers who want prebuilt Neural Engine packages of Qwen3-ASR 1.7B and will write their own pipeline. Not for: running speech recognition from this download alone. No inference code is included; mel preprocessing, prompt assembly, the decode loop, and detokenization are the host's job. Platform: Apple Silicon Mac, macOS 15 or later (the decoder uses Core ML state). Measured on one machine only (M5 Max, macOS 27.2.1).
Quick start
hf download okayuji/Qwen3-ASR-1.7B-CoreML-8bit --local-dir ./qwen3-asr-coreml
Inspect an interface without running inference:
from coremltools.models.utils import load_spec
spec = load_spec("./qwen3-asr-coreml/encoder.mlpackage/Data/com.apple.CoreML/model.mlmodel")
print(spec.description)
Load every package with MLModelConfiguration.computeUnits = .cpuAndNeuralEngine (see Operational notes for why not .all).
In KeyVoice for Mac, the same files are downloaded from Settings → Models. App builds that include this download are released separately from this repository.
Sample output
One utterance from FLEURS (ja_jp test, 6.42 s):
| System | Output |
|---|---|
| Official PyTorch Qwen3-ASR | スブリングボックにとっては五連敗が止まりました。 |
| These packages, driven from Python with coremltools on CPU_AND_NE | スブリングボックにとっては五連敗が止まりました。 (14 generated tokens) |
The same audio in the KeyVoice pipeline (Swift, Debug build, M5 Max, macOS 27.2.1) took 393 ms when transcriptions ran back to back, and 528 ms for the first transcription after 20 s or more without inference.
Key numbers
Conditions for every row: Apple M5 Max, 128 GB, macOS 27.2.1, measured 2026-11-15 and 2026-11-16.
"App" is the KeyVoice Swift pipeline in a Debug build with .cpuAndNeuralEngine. "Python" is a coremltools 9.0 harness on CPU_AND_NE.
| Item | Value | Measured with |
|---|---|---|
| Decoder time per token | 16.05 ms (ctx512), 19.73 ms (ctx1024) | App |
| 6.42 s utterance, end to end | 393 ms back to back; 528 ms first after 20 s or more idle | App |
| 28.2 s utterance, end to end | 1,916 ms back to back; 2,026 ms first after 20 s or more idle | App, ctx1024 decoder already loaded |
| First load on a machine | about 54 s, plus about 42 s for the ctx1024 decoder | App; includes on-device preparation for the Neural Engine |
| Later loads | 1.2 to 1.4 s | App |
| Process footprint right after load and one transcription | 3,374 MiB (ctx512 only); 6,830 MiB (ctx512 and ctx1024) | App, phys_footprint |
| CER, FLEURS ja 12 + en 12 utterances | ja 4.33% (29 / 670), en 1.30% (23 / 1,770) | Python |
| Same audio, official PyTorch | ja 4.18% (28 / 670), en 1.24% (22 / 1,770) | Official implementation as is |
| Same audio, official PyTorch with input padded to 30 s | ja 4.33% (29 / 670), en 1.36% (24 / 1,770) | Same input shape as this encoder |
CER uses NFKC, lowercasing, and removal of punctuation and symbols; the reference is the FLEURS raw transcription. With 24 utterances, a difference of one or two edits is within noise.
How it is built
- Encoder. The official audio tower, re-implemented in PyTorch for a fixed 30 s input (bit-identical to the official implementation, max |Δ| = 0), then converted with coremltools 9.0 (ML Program, FLOAT16 compute, macOS 14 target) and quantized to INT8 weights (linear symmetric, per channel). GELU is written out as its tanh approximation with elementwise operations. With the built-in
geluoperation, the encoder output on the Neural Engine differed from the official implementation by 21% (relative L2) on the test machine; with the tanh form, the Neural Engine execution error was 1.3% against PyTorch with the same INT8 weights. - Decoder. Converted with Anemll (commit
8d2791c): one package with two functions,prefill(64 tokens per call) andinfer(one token), sharing weights and a Core ML state for the KV cache; 8-bit palettization (k-means, 256 values per group of 8 output channels). The output projection is a separate package (qwen_lm_head_lut8) that returns the vocabulary in 16 slices. - Two context lengths. The ctx512 decoder is the default. The ctx1024 decoder has the same weights and a longer KV cache for long utterances; KeyVoice switches to it when the prompt plus the expected output would not fit in 512 positions.
text/. The token embedding table (embed_tokens.safetensors) is the tensorthinker.model.embed_tokens.weightcopied byte for byte from the official checkpoint (bf16), because the host does the embedding lookup. The tokenizer files are unchanged copies from the official repository.
Source weights: Qwen/Qwen3-ASR-1.7B at revision 7278e1e70fe206f11671096ffdd38061171dd6e5.
Interfaces
Read from the model definitions in this repository.
| Package | Function | Inputs | Outputs and state |
|---|---|---|---|
encoder.mlpackage |
main | input_features Float32 [1, 128, 3000] |
audio_embeds Float32 [1, 390, 2048] |
ane-v2/qwen_FFN_PF_lut8_chunk_01of01.mlpackage |
infer |
hidden_states Float16 [1, 1, 2048], position_ids Int32 [1], causal_mask Float16 [1, 1, 1, 512], current_pos Int32 [1] |
output_hidden_states Float16 [1, 1, 2048]; state model_model_kv_cache_0 Float16 [56, 8, 512, 128] |
prefill |
hidden_states Float16 [1, 64, 2048], position_ids Int32 [64], causal_mask Float16 [1, 1, 64, 512], current_pos Int32 [1] |
same output and state | |
ane-v2/qwen_FFN_PF_lut8_chunk_01of01_ctx1024.mlpackage |
infer, prefill |
as above with 1024 in place of 512 | state [56, 8, 1024, 128] |
ane-v2/qwen_lm_head_lut8.mlpackage |
main | hidden_states Float16 [1, 1, 2048] |
logits1 to logits16, Float16 [1, 1, 9496] each (16 × 9,496 = 151,936 vocabulary entries) |
The encoder input is a 128-bin log-mel spectrogram of 30 s at 16 kHz (3,000 frames), as defined by preprocessor_config.json in the official repository (Whisper-style feature extractor, n_fft 400, hop 160). Shorter audio is padded to 30 s. The prompt format and special tokens are those of the official implementation (QwenLM/Qwen3-ASR).
Files
| Path | Bytes | Contents |
|---|---|---|
encoder.mlpackage |
318,636,163 | Audio encoder, INT8 weights |
ane-v2/qwen_FFN_PF_lut8_chunk_01of01.mlpackage |
1,448,916,594 | Decoder, ctx512, 8-bit |
ane-v2/qwen_FFN_PF_lut8_chunk_01of01_ctx1024.mlpackage |
1,449,440,883 | Decoder, ctx1024, 8-bit |
ane-v2/qwen_lm_head_lut8.mlpackage |
320,921,457 | Output projection, 8-bit |
text/embed_tokens.safetensors |
622,330,152 | Token embedding table, bf16 |
text/vocab.json, text/merges.txt, text/tokenizer_config.json |
4,461,173 | Tokenizer files from the official repository |
Total 4,164,706,422 bytes, excluding this card, LICENSE, and NOTICE. Keep each .mlpackage directory intact.
Requirements
- Apple Silicon Mac.
- macOS 15 or later for the decoder packages (Core ML state, specification version 9). The encoder targets macOS 14.
- A host implementation for audio preprocessing, prompt assembly, embedding lookup, the decode loop, and detokenization.
Operational notes and troubleshooting
- Set the compute units explicitly. On the test machine, loading the decoder with
.allplaced it on the GPU and one token took 51 ms instead of 16 ms. Use.cpuAndNeuralEngine. The stateful decoder did not load with.cpuOnly. - The first load is slow. Core ML prepares each package for the Neural Engine the first time it is loaded on a machine (about 54 s plus about 42 s here). The result is cached by the system, and later loads take about a second. An operating system update can trigger the preparation again.
- Compile once. Compile each
.mlpackageto.mlmodelcand keep the compiled result next to it for reuse. - Memory is not held while idle. On the test machine, after about 20 s without inference the Neural Engine model memory left the process footprint, and came back on the next inference. The first transcription after such a pause was 110 to 135 ms slower.
- Audio longer than 30 s. The encoder takes exactly 30 s. The host has to split longer audio; KeyVoice splits at silence.
Limitations
- No inference code is included, and the packages are not a drop-in replacement for the official Python runtime.
- All measurements come from one Mac (M5 Max, macOS 27.2.1). There are no results for M1 to M4, other macOS versions, or iOS.
- App timings were taken in a Debug build.
- The output is not bit-identical to the official PyTorch model: 21 of 24 test utterances matched exactly (see Verification).
- Accuracy was checked on 24 utterances in Japanese and English only. The other languages supported by Qwen3-ASR were not measured for this conversion.
- Packages for speculative decoding are not part of this file set.
Verification
- Decoder against fp32 PyTorch. The top-1 token agreed at 16 of 16 positions on one Japanese answer and at 245 of 250 positions (98.0%) over 12 sentences (Japanese 6, English 6), with a mean KL divergence of 0.0023. The 5 disagreements are at positions where the reference margin between its top two tokens is 0.006 to 0.235. On the Neural Engine, the
prefillpath and token-by-tokeninferproduced bit-identical logits at 250 of 250 positions. Beyond position 512 with the ctx1024 decoder (one 640-token sequence), top-1 agreed at 117 of 127 positions (92.1%, mean KL 0.0016), against 466 of 479 (97.3%, mean KL 0.0019) below position 512 in the same sequence; all 10 disagreements beyond 512 had a reference margin below 0.1. - End to end against the official PyTorch output (FLEURS, Japanese 12 and English 12, Python harness): 21 of 24 utterances matched exactly, and 99.84% of characters matched.
- KeyVoice pipeline against the Python harness: an edit distance of 2 over 367 characters in 4 utterances.
License and attribution
Released under the Apache License 2.0; see NOTICE for attribution and the list of changes.
- The weights are derived from Qwen/Qwen3-ASR-1.7B, which is released under Apache-2.0. Changes: conversion to Core ML, a fixed 30 s encoder input, GELU written in its tanh form, INT8 and 8-bit quantization, and extraction of the embedding table into a separate file.
- The tokenizer files are unchanged copies from the same repository.
This is an independent conversion and is not affiliated with or endorsed by the Qwen team. Qwen is a trademark of its owner.
- Downloads last month
- 61
Model tree for okayuji/Qwen3-ASR-1.7B-CoreML-8bit
Base model
Qwen/Qwen3-ASR-1.7B