mlboydaisuke/embeddinggemma-300m-CoreAI
Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's coreai-torch (LLMs: coreai.llm.export) into .aimodel bundles that run on the GPU or the Neural Engine, e.g. Qwen3-8B 4-bit decodes at 94 tok/s on an M4 Max GPU, MLX 90 under the same protocol (apple-silicon-llm-bench, macOS 27 beta 26A5353q, 2026-06-11).
<!-- gen-cards:devicemark begin (managed by scripts/gen-cards + tools/devicemark_row.py — edit cards.json, not this block) --> This model has no row on DeviceMark, the on-device LLM leaderboard. <!-- gen-cards:devicemark end -->
EmbeddingGemma 300m — Core AI export
google/embeddinggemma-300m as a single static Core AI graph: the full sentence-transformers pipeline (transformer → mean pooling → dense projection → L2 normalize) runs in-graph, so one call returns a normalized 768-d embedding. On-device semantic search / RAG for macOS 27 / iOS 27.
Runs out of the box with CoreAIKit's TextEmbedder:
let embedder = try await TextEmbedder() // downloads this repo
let doc = try await embedder.embed(document: "Tokyo is the capital of Japan.")
let query = try await embedder.embed(query: "what is the capital of Japan")
let score = TextEmbedder.cosineSimilarity(doc, query)Retrieval prompt prefixes (task: search result | query: / title: none | text: ) are applied automatically by TextEmbedder.
Bundle layout
model/
├── embeddinggemma-300m_float32_static.aimodel
├── tokenizer/ (HF tokenizer files)
└── reference.json (torch reference cosines used by the parity test)Graph contract
Precision: fp32. Cross-runtime parity vs the torch SentenceTransformer pipeline is exact to 6 decimal places (see reference.json). fp16 variants (full cast AND mixed-precision autocast) produce NaN embeddings on-device — Gemma3 activations overflow half precision — so fp32 is shipped; a smaller int8 variant is future work.
License
Gemma Terms of Use (see the upstream model card). Conversion script: this repo's sibling, based on apple/coreai-models' recipe patterns (BSD-3-Clause).
<!-- funnel:v1 -->
More models in this format: Core AI Model Zoo — 75 models, each with the recipe that produced it.
Want a different model on-device? Open a request — free, open weights only; the export and its measured numbers get published publicly.
<!-- /funnel:v1 -->
