Downloads · 30 days
13
3% of all-time downloads
smkrv/Qwen3-0.6B-CoreML-4bit
Qwen3-0.6B-CoreML-4bit is a text generation model from smkrv. 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.
CoreML version of Qwen/Qwen3-0.6B with 4-bit palettization, optimized for Apple Silicon and Neural Engine.
Downloads · 30 days
13
3% of all-time downloads
All-time downloads
438
Public
Repo size
300 MB
Likes
2
Public
Click a slice to open those files.
.bin597 MB · 100%
From the Hugging Face model README
CoreML version of Qwen/Qwen3-0.6B with 4-bit palettization, optimized for Apple Silicon and Neural Engine.
| Device | Size | Tokens/sec | Latency (Prefill) | Latency (Decode) |
|---|---|---|---|---|
| M4 MacBook Air | 572 MB | 12-15 | 25-30 ms | 8-10 ms |
| M3 Pro | 572 MB | 15-18 | 20-25 ms | 6-8 ms |
| iPhone 15 Pro | 572 MB | 10-12 | 35-40 ms | 12-15 ms |
This model uses 4-bit Palettization with K-means clustering:
This approach provides:
This repository contains two models for efficient inference:
Qwen3-0.6B-Prefill-4bit.mlpackage (286 MB)
inputIds, causalMasklogitsQwen3-0.6B-Decode-4bit.mlpackage (286 MB)
inputIdslogitsimport CoreML
// Load models
let prefillURL = Bundle.main.url(forResource: "Qwen3-0.6B-Prefill-4bit", withExtension: "mlpackage")!
let decodeURL = Bundle.main.url(forResource: "Qwen3-0.6B-Decode-4bit", withExtension: "mlpackage")!
let prefillModel = try MLModel(contentsOf: prefillURL)
let decodeModel = try MLModel(contentsOf: decodeURL)
// Configure for ANE
let config = MLModelConfiguration()
config.computeUnits = .cpuAndNeuralEngine // Enable Neural Engine
// Inference
let prefillInput = try MLDictionaryFeatureProvider(dictionary: [
"inputIds": inputTokens,
"causalMask": causalMask
])
let prefillOutput = try prefillModel.prediction(from: prefillInput)
# Using git-lfs
git lfs install
git clone https://huggingface.co/smkrv/Qwen3-0.6B-CoreML-4bit
# Or using huggingface-cli
pip install huggingface-hub
huggingface-cli download smkrv/Qwen3-0.6B-CoreML-4bit
A complete Swift implementation is available in the Examples/qwen3coreml.swift file. This example demonstrates how to integrate the CoreML models into an iOS or macOS app, handling model loading, tokenization, and text generation.
let prompt = "Write a short story about a robot:"
let story = await model.generate(prompt)
print(story)
let question = "What is the capital of France?"
let answer = await model.generate(question)
// Output: "The capital of France is Paris."
let codePrompt = "Write a Python function to sort a list:"
let code = await model.generate(codePrompt)
let text = "I has a dreem to becum a docter"
let corrected = await model.generate("Correct this text: \(text)")
// Output: "I have a dream to become a doctor"
let translatePrompt = "Translate to Spanish: Good morning, how are you?"
let translation = await model.generate(translatePrompt)
// Output: "Buenos días, ¿cómo estás?"
let longText = """
<long article text>
"""
let summary = await model.generate("Summarize this text:\n\n\(longText)\n\nSummary:")
Tested on M4 MacBook Air (16GB RAM):
Model: Qwen3-0.6B-CoreML-4bit
Device: M4 Air, 16GB RAM, macOS 15
Context: 512 tokens
Prefill Time: 27ms avg
Decode Time: 9ms avg
Throughput: 13 tokens/sec
Memory Peak: 820MB
Power Consumption: Low (ANE active)
This model was converted from PyTorch to CoreML using the following process:
torch.jit.trace for CoreML compatibilitycoremltools 8.1 with:
cto.palettize_weights():
Tools used:
coremltools: 8.1PyTorch: 2.4.1transformers: 4.45.0The conversion reduces model size from 3GB to 572MB while maintaining ~98-99% of original quality.
If you use this model, please cite both the original Qwen3 model and this CoreML conversion:
@misc{qwen3-coreml-4bit,
title={Qwen3-0.6B Core ML 4-bit},
author={SMKRV},
year={2025},
howpublished={\url{https://huggingface.co/smkrv/Qwen3-0.6B-CoreML-4bit}},
note={4-bit palettized CoreML version of Qwen3-0.6B}
}
@article{qwen3,
title={Qwen Technical Report},
author={Qwen Team},
journal={arXiv preprint},
year={2024}
}
Apache License 2.0 - Same as base model Qwen/Qwen3-0.6B