Downloads · 30 days
1K
35% of all-time downloads
takanori-ishikawa/Qwen3.5-ANE-CoreML
Qwen3.5-ANE-CoreML is a text generation model from takanori-ishikawa. Use it when you need the model to write or continue text. It is set up for coreml. The card lists the license as apache-2.0.
[!WARNING] This repository is no longer maintained. Core ML behavior depends heavily on the hardware and OS version and is hard to predict, so development has stopped. The files remain available as they are.
Downloads · 30 days
1K
35% of all-time downloads
All-time downloads
3K
Public
Repo size
119 GB
Likes
2
Public
Click a slice to open those files.
.bin39 GB · 100%
From the Hugging Face model README
[!WARNING] This repository is no longer maintained. Core ML behavior depends heavily on the hardware and OS version and is hard to predict, so development has stopped. The files remain available as they are.
Run Qwen3.5 text models on Apple Silicon with Core ML. These packages use 6-bit compressed linear weights and include a four-token prompt-prefill graph alongside the one-token decoder.
The repository contains nine model/context packages: 0.8B at 2,048 tokens; 2B at 2,048 and 16,384 tokens; and 4B and 9B at 2,048, 8,192, and 16,384 tokens. This is an unofficial conversion and is not affiliated with or endorsed by the Qwen team. It is based on the original Qwen3.5-0.8B, Qwen3.5-2B, Qwen3.5-4B, and Qwen3.5-9B models.
These agreement scores compare next-token choices on fixed sequences. They are conversion checks, not measures of general task accuracy.
| Model | Context | Multifunction artifact | Core ML size | Shared embedding |
|---|---|---|---|---|
| 0.8B | 2,048 | qwen3.5-0.8b_ctx2048_chunks6_multifunction_lut6_kvslice_gqagrouped | 0.54 GiB | 243 MiB |
| 2B | 2,048 | qwen3.5-2b_ctx2048_chunks6_multifunction_lut6_kvslice_gqagrouped | 1.33 GiB | 485 MiB |
| 2B | 16,384 | qwen3.5-2b_ctx16384_chunks6_multifunction_lut6_kvslice_gqagrouped | 1.35 GiB | 485 MiB |
| 4B | 2,048 | qwen3.5-4b_ctx2048_chunks8_multifunction_lut6_kvslice_gqagrouped | 2.98 GiB | 607 MiB |
| 4B | 8,192 | qwen3.5-4b_ctx8192_chunks8_multifunction_lut6_kvslice_gqagrouped | 2.99 GiB | 607 MiB |
| 4B | 16,384 | qwen3.5-4b_ctx16384_chunks8_multifunction_lut6_kvslice_gqagrouped | 3.00 GiB | 607 MiB |
| 9B | 2,048 | qwen3.5-9b_ctx2048_chunks8_multifunction_lut6_kvslice_gqagrouped | 5.59 GiB | 970 MiB |
| 9B | 8,192 | qwen3.5-9b_ctx8192_chunks8_multifunction_lut6_kvslice_gqagrouped | 5.60 GiB | 970 MiB |
| 9B | 16,384 | qwen3.5-9b_ctx16384_chunks8_multifunction_lut6_kvslice_gqagrouped | 5.61 GiB | 970 MiB |
Download the selected artifact and the embedding table for its model size. The embedding table is shared across that model's context variants. This example downloads the 2B package with a 2,048-token context and the Python driver used below:
hf download takanori-ishikawa/Qwen3.5-ANE-CoreML \
--include 'qwen3.5-2b_embed_tokens.int8.bin' \
--include 'qwen3.5-2b_ctx2048_chunks6_multifunction_lut6_kvslice_gqagrouped/**' \
--include 'examples/**' \
--local-dir artifacts
Each package directory contains metadata.json and the .mlpackage chunks
for that model and context. The metadata lists the chunks in execution order.
On the Hub, each model/context package is a top-level directory, while its
shared embedding table is stored at the repository root. This layout matches
the paths recorded in metadata.json and lets a runtime select a package by
pointing to its directory.
Every published artifact contains the standard one-token decoder and a four-token prefill graph. A compatible runtime can process each complete group of four input prompt tokens with the prefill graph. Any remaining prompt tokens and all generated tokens use the one-token decoder. All nine packages listed above include both graphs.
Some older packages predate conversion-signature metadata and mark their
compatibility records as legacy_unverified. The 4B/8K, 4B/16K, 9B/8K, and
9B/16K packages include conversion-signature metadata. For 0.8B/2K, five runs
confirmed that the prefill path produced the same token IDs as the one-token
decoder.
The checks below compare each Core ML-generated token with the top-1 token from the original Hugging Face BF16 model when teacher-forced over the same sequence.
| Model | Sequence | Top-1 agreement | Result |
|---|---|---|---|
| 2B one-token decode, LUT6 | 64 tokens | 60 / 64 (93.75%) | pass |
| 9B one-token decode, LUT6 | 64 tokens | 58 / 64 (90.63%) | pass |
The 9B graph includes the numerically stable DeltaNet softplus conversion. On a separate fixed 138-token regression sequence, that change improved top-1 agreement from 111/138 (80.43%) to 127/138 (92.03%).
Quantization and Core ML execution can still change generated sequences, especially where the original model has near-tied logits. Validate the model on your own prompts and target OS/device.
Eight of the nine packages passed an end-to-end Swift/Core ML smoke test: the
0.8B/2K package, 2B/2K package, and all 4B and 9B packages. The test loaded each
package and generated Qwen ANE ready. The 2B/16K package was not included.
This checks integration, not task quality. Longer context changes the static
state capacity, but no separate fidelity comparison is available for the
longer-context packages.
examples/generate.py is a minimal Python reference driver built with
coremltools and NumPy. It supports greedy decoding and configurable
temperature, top-k, top-p, and repetition-penalty sampling, with a reproducible
random seed. The example shows how to load packages, manage model state, look
up host-side embeddings, and run the chunks.
Source code for a Swift runtime with chat templates, sampling, streaming, reset, multi-turn state reuse, and optional four-token prompt prefill is available in the local-llm repository.
Requirements: an Apple Silicon Mac, Python 3.12, and coremltools 9.
pip install "coremltools>=9,<10" numpy transformers
python artifacts/examples/generate.py \
--artifact-dir artifacts/qwen3.5-2b_ctx2048_chunks6_multifunction_lut6_kvslice_gqagrouped \
--prompt "What is the capital of Japan?" \
--max-new-tokens 64 \
--temperature 0.7 \
--top-p 0.8 \
--top-k 20 \
--repetition-penalty 1.05 \
--seed 42
The example loads its tokenizer and chat template from the original Qwen
repository. By default, --tokenizer is Qwen/Qwen3.5-2B; set this option to
the matching model repository when using another model size. The default
--temperature 0 preserves greedy decoding; pass a positive temperature to
enable sampling.
Each artifact contains one metadata.json and a sequence of .mlpackage
directories. Run the chunks in metadata order for every token:
current_pos.metadata.json records graph revision, tensor names, chunk order, state layout,
embedding checksum, quantization format, and conversion signature. The 9B final
vocabulary projection is split into four outputs to keep the last Core ML
package below the package-size limit.
Key format details:
current_posMeasured on a MacBook Pro (Mac14,7, Apple M2, 16 GB) running macOS 15.7.9. Each variant used the same fixed 128-token prompt ID array, greedy decoding, seed 1, two warmup generations, and five measured generations of 64 tokens each. The multifunction artifact's four-token graph handled prompt prefill. Prefill and decode rates are medians across the five runs. Cold load used an empty compiled-model cache; cached load reused that cache in a new process. Each load duration is one observation. Results vary with hardware, OS, cache, context length, and system load.
| Model | Context | Cold load | Cached load | Prefill median | Decode median |
|---|---|---|---|---|---|
| 0.8B | 2,048 | 49.96 s | 1.85 s | 127.6 tok/s | 50.1 tok/s |
| 2B | 2,048 | 76.77 s | 1.96 s | 75.4 tok/s | 26.0 tok/s |
| 4B | 2,048 | 159.33 s | 2.28 s | 39.4 tok/s | 11.5 tok/s |
| 4B | 8,192 | 163.97 s | 2.38 s | 19.9 tok/s | 10.1 tok/s |
| 4B | 16,384 | 161.41 s | 2.38 s | 14.3 tok/s | 6.5 tok/s |
| 9B | 2,048 | 355.09 s | 3.21 s | 27.9 tok/s | 8.2 tok/s |
| 9B | 8,192 | 343.69 s | 5.45 s | 21.5 tok/s | 7.4 tok/s |
| 9B | 16,384 | 358.66 s | 5.57 s | 11.7 tok/s | 5.1 tok/s |
Prompt ID SHA-256: e263916a82c9374465881fbc50252f47a72b46f40ccfe27438d7bd1244e96e43.
Conversion code and technical notes are maintained in ishikawa/local-llm.
Apache 2.0, the same as the original Qwen3.5 models. The license text is included
in LICENSE; the original models are by the Qwen team at Alibaba Cloud.