Qwen 3.5 4B Vision β Stateless Multi-Context CoreML (Apple Neural Engine)
Standalone stateless Apple Neural Engine (ANE) CoreML conversion of Qwen/Qwen3.5-4B (0 MLState ops, explicit KV + Gated DeltaNet conv/SSM state tensors) with weight-sharing multi-context support (2048 / 4096 / 8192) designed for on-device iOS (8 GB+ iPhone) and macOS inference.
Bundle Highlights
- Architecture: Hybrid Gated DeltaNet (24 linear-attention layers) + Full GQA (8 full-attention layers) + Lazy 384Γ384 Vision Encoder (
144soft visual tokens) - Format: Precompiled
.mlmodelcweight-sharing multifunction bundles (decode_<ctx>T=1+prefill_<ctx>T=8forctx β {2048, 4096, 8192}, default4096) - Chunking: 8 balanced chunks (4 layers per chunk = 3 Gated DeltaNet + 1 Full GQA,
224β337 MBper chunk) for low peak ANE compiler memory & fast first-run compilation on iOS - Quantization: Auto-calibrated mixed INT4 / INT6 exact
kmeans1dLUT palettization (group_size=32), 4-slice INT6lm_head, INT8mmap-friendly embeddings (embed_tokens_q8.bin), lazy INT6 vision encoder (vision_encoder.mlmodelc) - Supported Context Lengths:
2048,4096(default),8192tokens β weights are 100% shared across all three context buckets (+7 MBtotal overhead over single-context 2K!) - Total Size:
3.86 GB(3,858,100,000bytes) - Zero
MLStateops: Verified stateless across every compiledmodel.milfor reliable background / locked-screen ANE execution
Files
model_config.jsonβ full model, multi-context (supported_contexts), chunk split, quantization, and vision metadatachunk_0.mlmodelc..chunk_7.mlmodelcβ 8 multifunction (decode_2048/4096/8192T=1,prefill_2048/4096/8192T=8) transformer chunkslm_head_0.mlmodelc..lm_head_3.mlmodelcβ 4 vocab-sliced LM head chunks (248,320vocab)vision_encoder.mlmodelcβ lazy 384Γ384 ViT image encoder (144visual embeddings)embed_tokens_q8.bin&embed_tokens_scales.binβ streaming INT8 token embeddingshf_model/β original tokenizer & chat template files
License
Apache 2.0 (inherited from Qwen/Qwen3.5-4B).