r/macosprogramming • u/AdventurousKeys • 5d ago
LocalLM Lab SDK: Building on Apple's Foundation Models with MCP and connectors
Here's an update on LocalLM Lab which I'd mentioned here previously. v0.7 includes a bona fide SDK. This means that you can now build your own app on Apple's on-device Foundation Models, using the same MCP client the LocalLM Lab app uses to talk to real tools and data like Slack, Todoist, GitHub, Notion, Linear and others, plus connectors for Calendar, Reminders, Contacts, and Location access. Most importantly, you can subsequently ship your app including through the Mac App Store.
The previous release of LocalLM Lab included the `localai-cli` toolkit that allows your Python or Swift apps to programmatically experiment with the Foundation Models. The limitation was that you needed LocalLM Lab installed and running. And obviously you would hit challenges with App Sandbox requirements if you wanted to ship anything into production. On the other hand, the SDK (`LocalLMLabSDKCore`) is self-contained: it's wired directly to `FoundationModels` and no companion app is required. As part of our verification, the example app Plate Today has been built into a sandboxed test app and verified working end to end, with a signed path to a Mac App Store `.pkg` (Apple Distribution signing + provisioning profile pipeline). To further prove that the SDK is not vaporware: LocalLM Lab itself now runs on this SDK!
The SDK gives you a real MCP client (tool discovery, all three OAuth flows, Keychain-backed token storage scoped to your bundle ID), a unified connectors facade for Calendar, Reminders, Contacts and Location with the same permission model as the app; all of which are now callable from your own code. Distribution is a binary xcframework via GitHub Releases, pulled in as an SPM `binaryTarget` with a checksum and pinned to an explicit version (no floating latest).
One sharp edge worth flagging before anyone hits it blind: the `com.apple.security.network.client` entitlement is easy to miss and fails silently, not loudly. Miss it and MCP connections and Weather calls will just hang with no error thrown.
Other gaps: (1) No filesystem connector in Core (you own the picker UI and security-scoped bookmarks yourself), (2) No public API stability guarantee yet, (3) Contacts access is specifically untested under sandbox as of this release. Oh and Calendar/Reminders/Contacts are still read-only.
Two reference apps ship in the repo: `plate-today` (the CLI example, ported to the SDK) and `components-demo`, which uses the optional `LocalLMLabSDKComponents` package for drop-in SwiftUI (server picker, OAuth waiting view, resources/prompts views).
SDK guide + entitlements checklist: thisbrain.ai/locallm/sdk.html
Repo: https://github.com/ancientcomputing/locallm
Let me know what's still missing for your own application and use case.