google/gemma-3-4b-it
Run locally on Apple devices with Mirai
- Type
- local
- From
- Quantization
- No
- Parameters
- 4B
- Size
- 7.3 GB
Gemma 3 4B IT is a lightweight, instruction-tuned multimodal model from Google, part of the Gemma 3 family built on the same research and technology behind Google's Gemini models. Despite its compact 4-billion parameter size, it handles both text and image inputs and generates text output — making it a versatile choice for resource-constrained deployments.
Key Capabilities
This instruction-tuned variant is designed for interactive and task-oriented use cases, including:
- Question answering and conversational AI
- Summarization and content generation
- Reasoning over text and images
- Multilingual tasks across 140+ supported languages
Architecture Highlights
Gemma 3 4B IT features a generous 128K token context window, enabling it to process long documents, extended conversations, and detailed image-text interactions in a single pass. Its multimodal design accepts both text and image input natively, broadening its applicability beyond text-only models in the same size class.
Deployment & Accessibility
At 4 billion parameters, this model is specifically positioned for environments where compute is limited — laptops, desktops, edge devices, or modest cloud infrastructure. It brings state-of-the-art capabilities to settings where larger models would be impractical, making it an excellent option for developers and researchers seeking high-quality results without heavy hardware requirements.
Provenance
Gemma 3 4B IT is developed by Google and released with open weights. It is the instruction-tuned counterpart to the pre-trained Gemma 3 4B base model, fine-tuned to follow instructions and engage in structured dialogue out of the box.
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: "google/gemma-3-4b-it") 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 | } |