Qwen/Qwen3-4B-MLX-8bit
Run locally on Apple devices with Mirai
- Type
- local
- From
- Alibaba
- Quantization
- MLX 8-bit
- Parameters
- 4B
- Size
- 3.9 GB
An 8-bit quantized version of Qwen3-4B, optimized for efficient inference on Apple Silicon using the MLX framework. Part of the Qwen3 generation of large language models from Alibaba's Qwen team, this variant brings powerful reasoning and conversational capabilities to local Mac hardware.
Key Features
- Dual-mode reasoning: Seamlessly switch between a thinking mode — where the model engages in step-by-step reasoning for math, coding, and logic tasks — and a non-thinking mode for fast, general-purpose dialogue. Both modes are available within a single model via the `enable_thinking` toggle or in-prompt `/think` and `/no_think` commands.
- 4 billion parameters (3.6B non-embedding) across 36 layers, using Grouped Query Attention (32 Q heads, 8 KV heads).
- 32,768 token native context, extendable to 131,072 tokens using YaRN rotary position embedding scaling.
- 100+ language support, with strong multilingual instruction following and translation capabilities.
- Agent and tool-calling proficiency, with reliable integration into external tools and frameworks like Qwen-Agent and MCP-compatible servers.
Architecture & Quantization
The base Qwen3-4B model is a causal language model that went through both pretraining and post-training stages. This MLX release applies 8-bit quantization, reducing memory footprint while retaining high output quality — ideal for on-device inference via `mlx_lm` (≥ 0.25.2).
Ideal Use Cases
- Local AI assistants on macOS with Apple Silicon
- Complex reasoning, code generation, and math problem-solving (thinking mode)
- Lightweight, responsive chat and creative writing (non-thinking mode)
- Multilingual applications and agentic workflows with tool integration
Provenance
Released by the Qwen team under the Apache 2.0 license. Compatible with `transformers` (≥ 4.52.4) and `mlx_lm` for straightforward integration.
1Choose framework
2Run the following command to install Mirai SDK
spm https://github.com/trymirai/uzu.git
3Apply code
| 1 | import Uzu |
| 2 | |
| 3 | public func runChat() async throws { |
| 4 | let engineConfig = EngineConfig.create() |
| 5 | let engine = try await Engine.create(config: engineConfig) |
| 6 | |
| 7 | guard let model = try await engine.model(identifier: "Qwen/Qwen3-4B-MLX-8bit") else { |
| 8 | return |
| 9 | } |
| 10 | for try await update in try await engine.download(model: model).iterator() { |
| 11 | print("Download progress: \(update.progress())") |
| 12 | } |
| 13 | |
| 14 | let messages = [ |
| 15 | ChatMessage.system().withText(text: "You are a helpful assistant"), |
| 16 | ChatMessage.user().withText(text: "Tell me a short, funny story about a robot") |
| 17 | ] |
| 18 | let session = try await engine.chat(model: model, config: .create()) |
| 19 | let stream = await session.replyWithStream(input: messages, config: .create()) |
| 20 | var message: ChatMessage? = nil |
| 21 | for try await update in stream.iterator() { |
| 22 | switch update { |
| 23 | case .replies(let replies): |
| 24 | message = replies.last?.message |
| 25 | case .error(let error): |
| 26 | print("Error: \(error)") |
| 27 | } |
| 28 | } |
| 29 | print("Text: \(message?.text() ?? "empty")") |
| 30 | } |
Other local models from Alibaba
trymirai/Qwen3.5-0.8B-M
438.0 MB800M
trymirai/Qwen3.5-0.8B-L
785.3 MB800M
trymirai/Qwen3.5-2B-M
1.0 GB2B
trymirai/Qwen3.5-2B-L
1.9 GB2B
trymirai/Qwen3.5-4B-M
2.3 GB4B
trymirai/Qwen3.5-4B-L
4.2 GB4B
Qwen/Qwen3-0.6B
1.1 GB600M
Qwen/Qwen3-0.6B-MLX-4bit
313.3 MB600M
Qwen/Qwen3-0.6B-MLX-8bit
597.4 MB600M
Qwen/Qwen3-1.7B
3.2 GB1.7B
Qwen/Qwen3-1.7B-MLX-4bit
883.2 MB1.7B
Qwen/Qwen3-1.7B-MLX-8bit
1.7 GB1.7B
Qwen/Qwen3-4B
7.5 GB4B
Qwen/Qwen3-4B-Instruct-2507
7.5 GB4B
Qwen/Qwen3-4B-Thinking-2507
7.5 GB4B
Qwen/Qwen3-4B-MLX-4bit
2.0 GB4B
Qwen/Qwen3-8B
15.3 GB8B
Qwen/Qwen3-8B-MLX-4bit
4.1 GB8B
Qwen/Qwen3-8B-MLX-8bit
7.9 GB8B
Qwen/Qwen3-14B
27.5 GB14B
Qwen/Qwen3-14B-MLX-4bit
7.3 GB14B
Qwen/Qwen3-14B-MLX-8bit
14.2 GB14B
Qwen/Qwen3-32B
61.0 GB32B
Qwen/Qwen3-32B-MLX-4bit
16.2 GB32B
Qwen/Qwen3-32B-MLX-8bit
31.5 GB32B
Qwen/Qwen3.5-0.8B
1.4 GB800M
mlx-community/Qwen3.5-0.8B-MLX-4bit
424.5 MB800M
mlx-community/Qwen3.5-0.8B-MLX-8bit
783.0 MB800M
Qwen/Qwen3.5-2B
3.5 GB2B
mlx-community/Qwen3.5-2B-MLX-4bit
1.0 GB2B
mlx-community/Qwen3.5-2B-MLX-8bit
1.9 GB2B
Qwen/Qwen3.5-4B
7.9 GB4B
mlx-community/Qwen3.5-4B-MLX-4bit
2.2 GB4B
mlx-community/Qwen3.5-4B-MLX-8bit
4.2 GB4B
Qwen/Qwen3.5-9B
16.7 GB9B
mlx-community/Qwen3.5-9B-MLX-4bit
4.7 GB9B
mlx-community/Qwen3.5-9B-MLX-8bit
8.9 GB9B
Qwen/Qwen3.5-27B
50.1 GB27B
mlx-community/Qwen3.5-27B-4bit
14.1 GB27B
mlx-community/Qwen3.5-27B-8bit
26.6 GB27B
Qwen/Qwen3.6-27B
53.5 GB27B