Apple Core AI Models: Export Recipes, Python Primitives, and Swift Runtime for On-Device AI

Explore Apple's Core AI Models repository: export recipes for popular models, Python authoring primitives, and a Swift runtime for deploying AI on macOS and iOS.

Apple has open-sourced the Core AI Models repository, a comprehensive toolkit for building and deploying on-device AI on Apple platforms. This repo provides model export recipes, Python primitives for authoring custom models, and a Swift runtime for integrating AI into macOS and iOS apps. It's designed to bridge the gap between PyTorch model development and production deployment on Apple silicon.

What's Inside the Repository

The repo is organized into four main directories:

  • models/: A model catalog with README files and export recipes for converting popular open-source models (from Hugging Face and other sources) to the Core AI format (.aimodel files).
  • python/: Python primitives for authoring custom Core AI models in PyTorch, plus utilities for exporting them.
  • swift/: A Swift package (coreai-models) that provides runtime utilities for running Core AI models in your app on macOS and iOS.
  • skills/: Pluggable skills for coding agents (like Claude Code, Codex CLI, Gemini CLI) to leverage Core AI more effectively.

Requirements and Setup

For Model Export

You need to install uv (a fast Python package manager):

brew install uv

Or via the official installer:

curl -LsSf https://astral.sh/uv/install.sh | sh

Once installed, clone the repo and explore the available models:

git clone https://github.com/apple/coreai-models.git
cd coreai-models
uv run coreai.model.registry --list-models

Use uv run coreai.model.registry --help for more details.

For Running Models in Apps

  • macOS and iOS 27.0+
  • Xcode 27.0+

Core AI models are exported as standalone .aimodel files. Some models (like language models or diffusion models) require additional resources (e.g., tokenizers, multiple models in a pipeline). In these cases, the export recipes produce a resource folder containing one or more .aimodel files alongside any required resources. The Swift package provides runtime utilities for integrating these into an app.

CLI tools are also included for running exported models directly on a Mac (requires Xcode 27.0+). See each model's README for available tools and example invocations.

Agent Skills for Coding Agents

The repository includes a plugin with skills that enable coding agents to use Core AI like an expert. Three skills are available:

Skill Description
working-with-coreai End-to-end workflow for deploying PyTorch models on Apple silicon, covering export with coreai-torch and running with the Core AI runtime.
model-authoring Empirical rules for authoring PyTorch models for on-device execution on Apple platforms, covering BC1S layout, op compatibility, KV cache patterns, precision rules, MoE, and common issues.
model-compression-exploration Systematically explore weight compression configurations (quantization and palettization) for a PyTorch model using coreai-opt.

Installation for Different Coding Agents

Claude Code:

/plugin marketplace add [email protected]:apple/coreai-models.git
/plugin install coreai-skills@coreai-models

Codex CLI:

codex plugin marketplace add https://github.com/apple/coreai-models
codex plugin add coreai-skills@coreai-models

Gemini CLI:

gemini extensions install /path/to/coreai-models/skills

Once installed, the skills activate automatically based on your task context, or you can invoke them explicitly.

Why This Matters for Developers

On-device AI offers several advantages over cloud-based solutions: lower latency, offline capability, better privacy (data stays on device), and reduced server costs. Apple's Core AI framework provides the runtime, but until now, there wasn't a clear path for converting popular open-source models to the .aimodel format. This repository fills that gap with tested export recipes and reusable primitives.

The Python primitives in the python/ directory allow you to author custom models in PyTorch that are compatible with Core AI's constraints (e.g., BC1S layout, specific op support). The Swift package then makes it easy to load and run those models in your app with minimal boilerplate.

Current Limitations and Community Involvement

Apple is not accepting code contributions at this time. The project is focused on maintaining a curated, well-tested gallery of models and a reliable Swift package. Pull requests will be closed. However, GitHub Issues are open for:

  • Bug reports
  • Model requests
  • Feature requests for the workflow or Swift utilities

This is a deliberate scope decision for the initial release, allowing Apple to learn how the community uses the project before opening up contributions.

License

The project is licensed under the BSD 3-Clause License.

Getting Started

  1. Clone the repository: git clone https://github.com/apple/coreai-models.git
  2. Install uv and explore the model registry: uv run coreai.model.registry --list-models
  3. Pick a model from the models/ directory and follow its README for export instructions.
  4. Integrate the exported .aimodel file into your app using the Swift package.

For more details, visit the official repository.

Source

apple/coreai-models: Model export recipes, Python primitives, and Swift runtime utilities for on-device AI