LocalLM SDK
The LocalLM SDK: a free Swift package for building macOS apps with AI-powered features, using Apple Intelligence, hosted models or downloaded models, with tools, MCP servers and safety checks.
Every page about the LocalLM SDK, and the sections in each
Start with the SDK overview or the quickstart. The SDK guide covers the whole SDK in one page, and the reference lists every public type and function. New to the words? See the glossary.
Start here · Building with the SDK · MCP · Security · Decision models · Reference
What the SDK is, a first app, and working code to start from.
The LocalLM SDK: a free Swift package for building macOS apps with AI-powered features, using Apple Intelligence, hosted models or downloaded models, with tools, MCP servers and safety checks.
A working SwiftUI chat in your Mac app in about 50 lines, on Apple's on-device model, with next steps for tools, bigger models and MCP servers.
Source code for every open-source app built with the LocalLM SDK, and which one to start from.
A step-by-step account of what a LocalLM SDK reference app does, from launch to the answer on screen.
Plain meanings for the words used in the LocalLM SDK documentation: models, tools, MCP, security and the SDK itself.
The full guide, and the pages on models, the prompt cache and choosing tools.
The LocalLM SDK developer guide: add a chat assistant with tool calling to your macOS app: the model layer, tools, tool safety, MCP, App Sandbox and the Mac App Store.
Running open-weight models on the Mac with the LocalLM SDK: loading, measuring a turn, pinning versions, and the prompt cache.
Using hosted models (GPT, Claude's online API, OpenRouter, OpenAI-compatible servers) through the LocalLM SDK.
How the LocalLM SDK 3.0 lets a local model skip re-reading a conversation: faster follow-ups in a chatbot, what it costs in memory, how to turn it off, and how to show its state to your users.
How the LocalLM SDK 3.0 picks which tools a chat model sees each turn: why it matters, the three pickers, Apple's on-device model as the picker in ChatAgain, what we measured, and where it goes wrong.
Connecting your app to MCP servers, and showing their views and requests.
Give your native macOS app a real Model Context Protocol client: 2026-07-28 spec, all three auth models + CIMD, structured tool results, elicitation, diagnostics, and drop-in SwiftUI — as a Swift package. No protocol or OAuth stack to write.
The LocalLM SDK's MCP client in depth: connecting, signing in, tool results, server requests, MCP Apps, Keychain storage and diagnostics.
Show an MCP server's own interactive views (MCP Apps) inside your macOS chat app: sandboxed rendering, one approval path for the model and the view, a chat history built for it, and a working local-model example. Open source, part of the LocalLM SDK.
How the LocalLM SDK presents an MCP server's elicitation/create request to the user: a typed, validated SwiftUI form that names the server asking, shipped ready-to-use in Components.
Building an MCP server? Test it against LocalLM Lab — an independent 2026-07-28 client you can drive with Apple's on-device model, Claude, open-weight MLX models, or any online provider, with wire-level diagnostics.
What a model may do, who approves it, and how MCP servers are kept in check.
How the LocalLM SDK keeps AI apps safe: an AI model is never trusted on its own, so a runtime around it gates every action, reviews changing tools, separates what the model reads from what the user said, sandboxes programs, and records what happened.
The tool authorizer in the LocalLM SDK 3.0: the check every tool call passes before it runs, what changed in 3.0, the three ready-made authorizers and how to set one.
How the LocalLM SDK keeps an app safe when its model's tools come from other people's MCP servers: untrusted by default, a review when a server changes its tools (drift), results treated as data, sandboxed local programs, and an audit trail.
Typed answers with probabilities, on the Mac or hosted.
Decision models answer typed questions with probabilities instead of writing text. Using lab.decide in your app.
How decision models like TypeSafe's Jev differ from chatbots, and how the LocalLM SDK runs them on the Mac or hosted, next to your chat model.
JevDK: design and test decision-model (Jev) questions on your Mac and on hosted Jev, then ship them in your app. A plain-English developer guide.
jev-serve answers hosted Jev's decision API (OpenRouter's /api/alpha/decisions, Featherless's /v1/classifier) on your Mac with a local model: change the base URL, keep your code. Free, private, open source.
Every public type and function, and what to know before you upgrade.
The full function and type reference for the LocalLM SDK.
LocalLM Lab 2.2.0 (general availability): known caveats, plus the real on-device limitations carried over from the 0.8 series.