SDK contents

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

Start here

What the SDK is, a first app, and working code to start from.

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.

Quickstart: a working chat in your Mac app

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.

SDK source code examples

Source code for every open-source app built with the LocalLM SDK, and which one to start from.

Walking through a reference app's user experience, step by step

A step-by-step account of what a LocalLM SDK reference app does, from launch to the answer on screen.

Glossary

Plain meanings for the words used in the LocalLM SDK documentation: models, tools, MCP, security and the SDK itself.

Building with the SDK

The full guide, and the pages on models, the prompt cache and choosing tools.

Using the LocalLM SDK

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.

Open-weight models on the Mac (MLX)

Running open-weight models on the Mac with the LocalLM SDK: loading, measuring a turn, pinning versions, and the prompt cache.

Online providers — GPT, Claude online, OpenRouter (LocalLMLabSDKRemote)

Using hosted models (GPT, Claude's online API, OpenRouter, OpenAI-compatible servers) through the LocalLM SDK.

A prompt cache for local chat

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.

Choosing tools per turn

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.

MCP

Connecting your app to MCP servers, and showing their views and requests.

An MCP client for your app

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 MCP client guide

The LocalLM SDK's MCP client in depth: connecting, signing in, tool results, server requests, MCP Apps, Keychain storage and diagnostics.

MCP Apps in your app

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.

MCP elicitation UI

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.

Testing your MCP server with LocalLM Lab

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.

Security

What a model may do, who approves it, and how MCP servers are kept in check.

Security in the SDK

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: who decides whether a tool call may run

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.

MCP security in your app

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.

Decision models

Typed answers with probabilities, on the Mac or hosted.

Decision models (Jev) — lab.decide

Decision models answer typed questions with probabilities instead of writing text. Using lab.decide in your app.

Decision models (Jev) 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: a developer's guide

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: hosted Jev's API on your Mac

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.

Reference

Every public type and function, and what to know before you upgrade.

Full function/type reference

The full function and type reference for the LocalLM SDK.

Known issues

LocalLM Lab 2.2.0 (general availability): known caveats, plus the real on-device limitations carried over from the 0.8 series.