Gemma 3 12B IT β official Apple Core AI export
Pre-converted .aimodel bundles from Apple's official
coreai-models export recipe β unmodified,
with the exact environment, hashes, and measured performance published.
uv run coreai.llm.export gemma3-12b-it
Use it
β‘ One line β run the kit's task op on this model
(import CoreAIOps; no session, no model plumbing, downloads on first use):
let tldr = try await CoreAI.summarize(text, options: .model("gemma-3-12b-it"))
Twenty ops, one shape β Cookbook.
βΆοΈ Run it (source) β the ChatDemo runner (GUI + CLI, one app for every chat model in the catalog):
git clone https://github.com/john-rocky/coreai-kit
open coreai-kit/Examples/ChatDemo/ChatDemo.xcodeproj
# β Run, then pick "Gemma 3 12B" in the model picker
# agents / headless (macOS):
cd coreai-kit/Examples/ChatDemo
swift run chat-cli --model gemma-3-12b-it --prompt "What can you do, offline?"
π» Build with it β complete; the glue is kit API, copy-paste runs:
import CoreAIKit
let chat = try await ChatSession(catalog: "gemma-3-12b-it")
let reply = try await chat.respond(to: prompt)
// reply: the answer, generated fully on-device
The take-home is Examples/ChatDemo/Sources/QuickStart.swift
β this exact code as one typed function, no UI; the CLI is an argument shell over it, and
the GUI drives the same ChatSession across turns for its transcript.
Multi-turn? Hold the ChatSession and call respond(to:) per turn β it keeps the
conversation history; streamResponse(to:) yields tokens as they decode.
Integration checklist
- SPM:
https://github.com/john-rocky/coreai-kitβ product CoreAIKit - Info.plist: none needed
- Entitlements: none needed (macOS)
- First run downloads the model β 6.0 GB (Mac) β then it loads from the
local cache (Application Support; progress via the
downloadProgresscallback) - Measure in Release β Debug is ~3Γ slower on per-token host work
Why pre-converted bundles?
- The conversion needs a big-RAM Mac (the 20B export was done on 128 GB); running only needs enough RAM to mmap the artifact.
- An
.aimodelis a build artifact, not a pure function of the recipe β the same export command produced a 2.2Γ slower artifact across the macOS 26 β 27Ξ² boundary (forensics). Hosted artifacts + hashes are the reproducible ground truth; every bundle here is exactly the one measured in apple-silicon-llm-bench.
Bundles & integrity
| Bundle | Contents | SHA-256 (main.mlirb) |
|---|---|---|
macos/ |
macOS dynamic, int4 (bf16 compute) | 21f9976e535b53c514801dbaf264cc76d7e3691e53f9199a01171328a48118f0 |
Measured (Apple's official llm-benchmark, greedy)
| Bundle | Protocol | Decode tok/s | Prefill | Load (warm) | Peak RSS |
|---|---|---|---|---|---|
| macos | M4 Max, 512p/1024g | 55.0 | 578 | 5.4β7.7 s | 13.4 GB |
Export environment
- macOS 27.0 beta (build 26A5353q) Β· Xcode 27.0 (27A5194q)
coreai-core 1.0.0b1Β·coreai-torch 0.4.0Β·coreai-opt 0.2.0Β·torch 2.9.0- apple/coreai-models @
b1cb71b(export code identical to upstream0c1055f)
Run it
# CLI (from a coreai-models checkout)
swift run -c release llm-runner --model <downloaded-bundle-dir> --prompt "Hello"
swift run -c release llm-benchmark --model <downloaded-bundle-dir>
Or chat with it in CoreAIChatMac (point "Choose Models Folderβ¦" at the download directory).
iOS static bundles must be AOT-compiled before device use:
xcrun coreai-build compile <ir>.aimodel --platform iOS --preferred-compute neural-engine --architecture h18p
(h18p = iPhone 17 Pro), then set metadata.json assets.main to the .aimodelc.
Use of this model is subject to the Gemma Terms of Use. This repository redistributes a converted derivative of google/gemma-3-12b-it under those terms; by downloading you agree to them.
Maintained alongside coreai-model-zoo (community models) and coreai-samples (apps).