mlx-community/gemma-3-4b-it-4bit
Run locally on Apple devices with Mirai
- Type
- local
- From
- Quantization
- MLX 4-bit
- Parameters
- 4B
- Size
- 2.1 GB
A 4-bit quantized version of Google's Gemma 3 4B Instruct model, converted to Apple's MLX format for efficient on-device inference on Apple Silicon hardware. This community conversion was produced using mlx-vlm v0.1.18, preserving the multimodal capabilities of the original model in a significantly smaller footprint.
Origin & Architecture
The base model is google/gemma-3-4b-it, part of Google's Gemma 3 family — a lightweight yet capable series of instruction-tuned language models. Gemma 3 4B supports image-text-to-text generation, meaning it can process both visual and textual inputs to produce natural language responses. The 4-bit quantization dramatically reduces memory requirements, making it practical for local use on MacBooks and other Apple Silicon devices.
Key Highlights
- MLX-native format — purpose-built for Apple's MLX framework, enabling hardware-accelerated inference without external GPU dependencies.
- 4-bit quantization — substantially reduces model size and memory usage compared to the full-precision original, with minimal quality trade-off for most tasks.
- Multimodal capability — handles both image understanding and text generation tasks, from visual question answering to image description.
- Instruction-tuned — fine-tuned for conversational and instruction-following use cases, responding naturally to user prompts.
Use Cases
This model is well-suited for developers and researchers looking to run a capable multimodal model locally on Mac hardware. Common applications include image captioning, visual Q&A, conversational AI, and general text generation — all without cloud API dependencies.
Access
Usage requires acknowledgment of Google's Gemma license agreement via Hugging Face. Refer to the original model card for full details on capabilities and limitations.
spm https://github.com/trymirai/uzu.git
| 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: "mlx-community/gemma-3-4b-it-4bit") 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 | } |