← All courses ← Course home

Lesson 05 of 05

Pick a stack with a table

Start from the OS, the model, and the output. Then pick Core ML, Core AI, or MLX. Use the table and the list below.

Agent brief (llms.md)

Do not start from a brand name. Start from what the app must do and which OS it must support.

NeedOS, model, and output
NeedOS, model, and output
StackCore ML, Core AI, or MLX
NeedOS, model, and output
StackCore ML, Core AI, or MLX
CheckFile and OS match

Decision table

If you need Use Because
An older OS, or a classic ML model such as a classifier or a tree model Core ML You convert with coremltools to a .mlmodel. The OS picks much of the run path. Apple still maintains this path. There is no announced deprecation.
A custom neural or generative model on iOS 27 or later, or macOS 27 or later Core AI You ship a .aimodel and call the Swift API. Export from PyTorch with coreai-torch. You need Xcode 27.
To train, test, or shrink a model on a Mac MLX, then export MLX is the Mac research and training framework. After the model is ready, export it and ship with Core AI.
Apple's system language model, not your own weights Foundation Models That Swift API is a different product. It is not the path for a file you trained.

Checklist before you start work

  1. Write the lowest iOS or macOS version the app must support.
  2. Write the model job in one line. Example: label a photo, chat, or generate an image.
  3. If that version is below 27, pick Core ML.
  4. If the job is classic ML and Core ML already fits, pick Core ML even on 27 or later.
  5. If you will ship your own neural or generative model on 27 or later, pick Core AI.
  6. If you are still training or shrinking the model on a Mac, use MLX first, then export for Core AI.
  7. If you only need Apple's system language model, use Foundation Models. Stop there.

Where to go next

Use Model architectures in plain English to name the input and output. Use Core AI models, typed to read Apple's official Core AI presets. Use PyTorch to Core AI in Xcode to train a small model, convert it, and run it in SwiftUI.

Primary sources: developer.apple.com/core-ai, apple/coreai-models, and MLX on GitHub.

Short form. Older OS or classic ML means Core ML. Custom neural or generative work on 27 or later means Core AI. Train on a Mac with MLX, then export to ship.

Key concepts

  • Start from OS, model job, and output, not a brand name.
  • Older OS or classic ML: Core ML, .mlmodel, coremltools.
  • Custom neural or generative on 27 or later: Core AI, .aimodel, Xcode 27.
  • Train or shrink on a Mac: MLX, then export before you ship.
  • Apple's system LLM: Foundation Models, not your trained file.

Takeaways

  • You can run the checklist and get one stack pick before you start work.
  • You can justify Core ML versus Core AI versus MLX versus Foundation Models.
  • You can check that file type and OS match before you build.