A field guide for iOS & macOS engineers · iOS 26 baseline

Ship AI features with no API bill, no data leaving the device, and no vibes-based engineering.

On-Device Intelligence is a 12-chapter engineer-to-engineer guide to Apple's Foundation Models framework and MLX: from your first typed, streaming feature to model selection, memory budgets, App Review, and regression evals that run entirely on your own hardware.

Real output from the companion tools against the live system model. Not a mockup.

Why this book

The framework docs tell you what compiles. This book tells you what ships.

In 2026 every iOS team faces the same decision: Apple's free on-device model, an open model you control, or a cloud API with a per-request invoice. The difference between a demo and a product is a hundred unglamorous details: jetsam budgets, context-window overflow, availability ladders, model swaps arriving silently in OS updates.

Contents

Twelve chapters, four parts, three runnable tools.

Part I · The Decision

  1. Why Local: the economics, the latency floor, the true capability ceiling
  2. The Apple AI Stack, Mapped: one decision matrix for FM, MLX, Core ML, llama.cpp
  3. Your First On-Device Feature FREE

Part II · Foundation Models in Production

  1. Guided Generation Deep Dive
  2. Tool Calling
  3. Sessions, Context, and Memory
  4. Availability and the Device Matrix

Part III · Owning the Model

  1. MLX Swift: Bring Your Own Model
  2. Ollama as Development Infrastructure

Part IV · Shipping

  1. Memory, Thermals, Battery
  2. Privacy Architecture and App Review
  3. Evals Without a Cloud

Plus three appendices: a measured model catalog, prompt patterns for 3B-class models, and the complete GenerationError troubleshooting table, enumerated by the compiler rather than copied from docs.

Pricing

One-time purchase. Quarterly updates included.

Book $59
  • 12 chapters + appendices
  • PDF & EPUB, DRM-free
  • All future updates
Buy the book
Team $199
  • Everything in Book + Code
  • License for up to 10 engineers
  • Priority errata answers
Buy for your team

30-day refund, no questions. If the compile gates in Chapter 3 don't convince you, ask for your money back.

Free sample

Chapter 3: your first on-device feature, end to end.

Availability handling, typed guided generation, streaming into SwiftUI, and the three errors that dominate production. The complete lead chapter, free. It's the same feature the companion demo app ships.

Author

Written from a home rack, not a content calendar.

Written by Roberto Gutierrez, founder of Digital Foundry and a staff iOS/tvOS engineer with more than twelve years on Apple platforms, who runs local inference daily: Ollama on a Mac Studio M2 Ultra serving a LAN, MLX on Apple silicon, evals against golden sets before anything ships. The same person restores mechanical Nikon film cameras and modded iPod Classics, which is to say: someone who thinks broken abstractions should be opened, measured, and fixed. This book treats language models the same way.

Questions

Fair questions, straight answers.

Isn't this all going to change at the next WWDC?
Some of it. That's why updates are free and the code pins exact dependency versions. The iOS 27 material (the LanguageModel protocol, multimodal prompts, Core AI) is already tracked in clearly-marked sections and lands as a free revision when the SDK stabilizes.
I could read Apple's docs for free. What's the $99 for?
The docs describe the APIs. The book covers what they don't: which stack to pick and why, the memory budget that jetsams your app twenty turns in, the App Review notes that prevent a rejection cycle, the eval harness that catches Apple swapping the model under you, and the API drift the docs haven't caught up with, verified by compiler, with receipts.
Does it cover [some giant cloud model]?
No. This book is about the models that run on the machine in your user's hand, the 1–8B class, and it's plain about what they can't do. Chapter 1 includes the decision framework for when the cloud is still the right answer.
What do I need to run the code?
macOS 26+, Xcode 26+, Apple silicon. The eval and benchmark tools run on any M-series Mac; the demo app needs Apple Intelligence enabled. An Ollama-capable Mac (any M-series, more RAM is better) unlocks the Chapter 9–12 workflow.