google/functiongemma-270m-it
Run locally on Apple devices with Mirai
- Type
- local
- From
- Quantization
- No
- Parameters
- 270M
- Size
- 543.4 MB
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: "google/functiongemma-270m-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 | } |
Other local models from Google
google/gemma-3-1b-it
1.9 GB1B
mlx-community/gemma-3-1b-it-4bit
568.8 MB1B
mlx-community/gemma-3-1b-it-8bit
1.0 GB1B
google/gemma-3-4b-it
7.3 GB4B
mlx-community/gemma-3-4b-it-4bit
2.1 GB4B
mlx-community/gemma-3-4b-it-8bit
3.9 GB4B
google/gemma-3-27b-it
50.3 GB27B
mlx-community/gemma-3-27b-it-4bit
14.2 GB27B
mlx-community/gemma-3-27b-it-8bit
26.8 GB27B