Core AI is a Swift API for on-device inference on Apple silicon. You load a model in the app. The model runs on the device. There is no server step and no token bill for that run.
The portable file is a .aimodel. Apple also publishes Core AI assets and recipes in apple/coreai-models. If you train in PyTorch, you convert with the Core AI PyTorch tools, often called coreai-torch. PyTorch to Core AI in Xcode shows that conversion with a clothing classifier.
OS and Xcode limits
The official coreai-models repository lists macOS 27 or later, iOS 27 or later, and Xcode 27 or later. If the app must support an older OS, use Core ML instead. Do not plan a Core AI ship date on iOS 26.
import CoreAI
let modelURL = Bundle.main.url(
forResource: "clothing",
withExtension: "aimodel"
)!
let model = try await AIModel(contentsOf: modelURL)
let function = try model.loadFunction(named: "main")
That load path matches the clothing course. Exact method names can change in the Xcode 27 SDK. Check the installed Core AI docs before you copy a name.
What Core AI is for
Use Core AI when you bring your own neural network, including transformer and other generative work. Apple says Core AI is the inference framework behind on-device Apple Intelligence, and that developers can now use it for their own models. See developer.apple.com/core-ai.
Foundation Models is still a different product. It gives your app Apple's system language model through a Swift API. Core AI is the product you use when the weights are yours, or they come from a recipe you exported.
Core AI models, typed explains the official preset list. Model architectures in plain English explains language and image shapes before you pick a file.
Next, look at MLX, the Mac training and research tool.
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 usescoreai-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
.aimodelto the Swift Core AI API on OS 27 or later. - You can sketch
AIModelandloadFunction(named: "main")and check names in your Xcode 27 docs. - You will not plan a Core AI ship on iOS 26.