---
title: "When to use Core AI"
lesson_id: "03"
---

# When to use Core AI

- **Lesson ID:** 03
- **Goal:** State the Core AI job, the `.aimodel` file, the Swift API, coreai-torch, and the 27 / Xcode 27 limit.
- **Human lesson:** [03-core-ai-when.html](03-core-ai-when.html)

## Prerequisites

- Lesson 01 and 02, or a clear idea of why Core ML exists.

## Inputs, outputs, and artifacts

- **Inputs:** A custom neural or generative model and an app that can require OS 27.
- **Outputs:** When to pick Core AI, and the files and tools it uses.
- **Artifacts:** Progressive `.flow` diagrams, a short Swift load sketch, and source links.

## Agent build steps

1. Define Core AI as Apple's current Swift API for on-device inference of your own model on Apple silicon.
2. Name the portable file `.aimodel` and the PyTorch export path coreai-torch.
3. Link [developer.apple.com/core-ai](https://developer.apple.com/core-ai/) and [apple/coreai-models](https://github.com/apple/coreai-models).
4. State the published limits: iOS 27 or later, macOS 27 or later, Xcode 27 or later.
5. Say Core AI is the inference framework behind on-device Apple Intelligence, now open to apps that bring their own model. Do not invent extra product names.
6. Keep Foundation Models as a different API for Apple's system language model.
7. Link the three sibling courses, including [PyTorch to Core AI in Xcode](../pytorch-core-ai-xcode/).

## Constraints

Do not invent SDK method names beyond the published clothing-course sketch. Tell the reader to check the installed Xcode 27 docs. No quizzes, Mermaid, or em dashes.

## Key concepts

- Core AI is Apple's Swift API for on-device inference of your own model on Apple silicon.
- The portable file is `.aimodel`. PyTorch export uses `coreai-torch`.
- It needs macOS 27 or later, iOS 27 or later, and Xcode 27.
- Use it for your own neural network, including transformer and generative work.
- Foundation Models is a different API. It does not load your weights.

## Takeaways

- You can describe `.aimodel` to the Swift Core AI API on OS 27 or later.
- You can sketch `AIModel` and `loadFunction(named: "main")` and check names in your Xcode 27 docs.
- You will not plan a Core AI ship on iOS 26.

## Acceptance checks

- `.aimodel`, Swift API, coreai-torch, and the 27 / Xcode 27 limit are stated.
- Apple Core AI and coreai-models links are present.
- Foundation Models is marked as a different job.
- Sibling links, progressive `.flow` diagrams, and an Agent brief link are present.
- [ ] Proceed to [lesson 04 brief](04-mlx-when.llms.md).
