Core AI model zoo

Core AI overview

Core AI is Apple’s Core ML successor, announced at WWDC 2026 (iOS/macOS 27). It keeps the “convert once, run on ANE/GPU/CPU” idea but replaces the .mlpackage + coremltools stack with a new IR, compiler, and runtime.

The three Apple repos (open) + the closed runtime

Repo Core ML analog Role
coreai-torch coremltools converter PyTorch → Core AI IR. Entry: TorchConverter().add_exported_program(...).to_coreai(). Extension points: register_torch_lowering, composite_ops (SDPA, RoPE, RMSNorm, GatedDeltaUpdate, GatherMM), ExternalizeSpec.
coreai-optimization (coreai-opt) coremltools.optimize quant / palettization / pruning (torchao PT2E).
coreai-models Apple’s own model zoo + Swift runtime + agent skills.

The compiler + runtime are closed-source, shipped as the coreai-core Python wheel (the coreai.runtime module) + the OS Core AI framework (CoreAI.framework, on-device).

The .aimodel bundle

A .aimodel is a directory bundle: {metadata.json, main.mlirb, main.hash} (the IR + a manifest). It can hold multiple functions (entrypoints) and declares states (tensors the graph mutates in place, surfaced via a state= API at runtime) — this is how KV caches live.

The pipeline

PyTorch (re-authored model)
  → coreai-opt (optional compress: palettize / quantize)
  → coreai-torch TorchConverter → Core AI IR
  → .optimize() → save_asset() → .aimodel
  → [Python] coreai.runtime  (macOS, for convert/verify)
  → [Swift]  CoreAI.framework (on device, iOS/macOS 27)  ── AOT-compiled by `aimodelc`

Developer toolchain & app integration (WWDC 324/326)

Why this repo exists

Apple’s coreai-models zoo lags ~one generation (Qwen3 / Gemma 3, no VLM) and its Swift runtime assumes standard input_ids → logits + single KV models. Newer architectures (hybrid linear-attention SSMs, dual-KV + per-layer-embedding decoders, VLMs) need re-authoring + a runner that handles non-standard states. That’s what conversion/, swift/, and zoo/ provide.