Qwen 3.5 9B Mirai-M
- Vendor
- Alibaba
- Quantization
- Mirai-M
- Parameters
- 9B
- Size
- 4.9 GB
$ brew install mirai$ mirai --model trymirai/Qwen3.5-9B-MIntegrate with SDK
1Choose framework
2Run the following command to install Mirai SDK
https://github.com/trymirai/uzu-swift
3Apply code
| 1 | import Foundation |
| 2 | import Uzu |
| 3 | |
| 4 | public func runChat() async throws { |
| 5 | let engineConfig = EngineConfig.create() |
| 6 | let engine = try await Engine.create(config: engineConfig) |
| 7 | |
| 8 | guard let model = try await engine.model(identifier: "alibaba:qwen3.5:0.8b:mirai:mirai-m:4") else { |
| 9 | return |
| 10 | } |
| 11 | for try await update in try await engine.download(model: model).iterator() { |
| 12 | print(String(format: "\r\u{001B}[2KDownload progress: %.2f%%", update.progress() * 100), terminator: "") |
| 13 | fflush(stdout) |
| 14 | } |
| 15 | print() |
| 16 | |
| 17 | let messages = [ |
| 18 | ChatMessage.system().withText(text: "You are a helpful assistant"), |
| 19 | ChatMessage.user().withText(text: "Tell me a short, funny story about a robot") |
| 20 | ] |
| 21 | let session = try await engine.chat(model: model, config: .create()) |
| 22 | let stream = await session.replyWithStream(input: messages, config: .create()) |
| 23 | var message: ChatMessage? = nil |
| 24 | for try await update in stream.iterator() { |
| 25 | switch update { |
| 26 | case .replies(let replies): |
| 27 | let reply = replies.last |
| 28 | message = reply?.message |
| 29 | print("Generated tokens: \(reply?.stats.tokensCountOutput ?? 0)") |
| 30 | case .error(let error): |
| 31 | print("Error: \(error)") |
| 32 | } |
| 33 | } |
| 34 | print("Reasoning: \(message?.reasoning() ?? "empty")") |
| 35 | print("Text: \(message?.text() ?? "empty")") |
| 36 | } |
| 37 | |
Details
Mirai's Qwen3.5-9B Medium Quantization
A compact 4-bit quantization of Qwen3.5-9B prepared for efficient local inference on Apple silicon. Mirai Medium uses asymmetric integer quantization with 4-bit zero points, bfloat16 scales, and group size 32. Block-diagonal Random Hadamard Transforms reduce activation and weight outliers, and the checkpoint combines post-training quantization with quantization-aware distillation. Performance and quality measurements have not been finalized.
sh
brew install mirai
mirai --model trymirai/Qwen3.5-9B-MCurrently only Apple silicon inference is supported. See the Uzu build overview and Mirai API documentation. The model is released under the Apache 2.0 License.