---
title: "When to use MLX"
lesson_id: "04"
---

# When to use MLX

- **Lesson ID:** 04
- **Goal:** State that MLX is the Mac training and research framework, not the main App Store inference product, and that shipping usually means export to Core AI.
- **Human lesson:** [04-mlx-when.html](04-mlx-when.html)

## Prerequisites

- Lessons 01 to 03, or a clear split between Core ML and Core AI.

## Inputs, outputs, and artifacts

- **Inputs:** A Mac with Apple silicon and a model the reader wants to train, test, or shrink.
- **Outputs:** When to use MLX, and what to do before an App Store build.
- **Artifacts:** Progressive `.flow` diagrams, a short `mlx.core` sketch, and the MLX GitHub link.

## Agent build steps

1. Define MLX as Apple's open-source array and machine-learning framework for Apple silicon.
2. Link [github.com/ml-explore/mlx](https://github.com/ml-explore/mlx).
3. List the jobs: experiment, train, research, fine-tune, and shrink a model on a Mac.
4. Say MLX is not the API you put in an App Store app to run the model.
5. After the Mac work is done, export and ship with Core AI on 27 or later.
6. Point at [PyTorch to Core AI in Xcode](../pytorch-core-ai-xcode/) as one export-and-ship course. Also link the other two sibling courses.

## Constraints

Do not invent a required export CLI. Keep the code sample to the public array API. No quizzes, Mermaid, or em dashes.

## Key concepts

- MLX is Apple's open-source array and ML framework for Apple silicon.
- Use it on a Mac to experiment, train, fine-tune, or shrink.
- MLX is not the API you put in an App Store app to run the model on device.
- After MLX work, export and ship with Core AI, for example through `coreai-torch`.

## Takeaways

- You can say MLX is for Mac training and research, not App Store inference.
- You can name the handoff: MLX work, then export, then ship with Core AI.
- You will not call MLX the on-device App Store runtime.

## Acceptance checks

- Training and research on a Mac are the stated MLX jobs.
- The page says to export before shipping a custom neural model.
- The MLX GitHub link is present.
- Sibling links, progressive `.flow` diagrams, and an Agent brief link are present.
- [ ] Proceed to [lesson 05 brief](05-choose-with-confidence.llms.md).
