Build with an AI coding agent

Set up Claude Code, Codex or another coding agent so that what it writes against the SDK compiles, and is safe

For developers who already build Mac apps and want an agent to do the SDK part. Terms: see the glossary.

You need a Mac with Apple Silicon, macOS 27 and Xcode 27, and Apple Intelligence turned on. Apple’s on-device model also runs on macOS 26; open-weight, hosted and Private Cloud Compute models need macOS 27. The first chat needs no account or key.

The short version. The repo ships an AGENTS.md and a skill, locallm-swift-app. Start your agent in a clone of the repo and it finds both. Then tell it what it can’t read from the SDK: the version, which models, how the app is distributed, who approves tool calls, and how to check the result.

Set it up

Two ways, depending on where the agent works.

An agent that reads the web can start from llms.txt, which lists the docs worth fetching, with links to the raw files.

Two prompts to start from

A good prompt names the things an agent can’t infer. Change the details to fit your app.

Starting from nothing (no project yet, new to Mac apps):

Use the locallm-swift-app skill. I have a Mac with Apple Silicon, macOS 27 and Xcode 27, but I have never built a Mac app.
Create a new SwiftUI Mac app called Chatty, using LocalLM SDK 3.0.0-GA, with a chat window that talks to Apple's on-device
model. Start from docs/quickstart.md in the repo. I don't use Xcode much, so make it a Swift package I can open in Xcode and
run. Build it, then tell me exactly how to run it, and explain in plain language what each file does and where the SDK is used.

Adding to an existing app: a chat on Apple’s on-device model with a tool:

Use the locallm-swift-app skill. In this Xcode project, add a SwiftUI chat on LocalLM SDK 3.0.0-GA using Apple's
on-device model and the Calendar tool. It is a direct-download app with a window, so ask the user before any tool that
changes data. Start from examples/mcp-chat for the chat window and examples/plate-today-tools for the Calendar tools, and confirm
API names in docs/api-surface.md, not from memory. When you are done, run a turn that creates a calendar event and show me
it was not denied.

An open-weight model that is downloaded with the user’s consent:

Use the locallm-swift-app skill. Add Qwen3-4B-4bit through MLX to this app. Loading must not download silently: check
the size, ask the user, then download. Show a progress bar, and handle a model that is not on disk.

We ran all three against a fresh agent. Each produced code that compiled against the 3.0.0-GA frameworks and followed the rules below. We did not run the resulting apps with a person at the keyboard, so the approval sheet and the download were not exercised.

↑ Top

What an agent gets wrong in 3.0

These are the points AGENTS.md puts first, because each one fails quietly or only at build time.

Check what it built

↑ Top

More: Quickstart · Examples · Security in the SDK · the skill · llms.txt