← all repositories
rudrankriyam/Foundation-Models-Framework-Lab

Apple's on-device AI SDK, demonstrated in 37 Swift files

A working reference app for Foundation Models Framework showing how to run LLMs locally on iOS 26 with tool calling, RAG, and HealthKit integration.

Foundation-Models-Framework-Lab
Velocity · 7d
+6.1
★ / day
star history

What it does

Foundation Lab is a Swift/SwiftUI reference implementation for Apple’s Foundation Models Framework — the SDK that lets iOS and macOS apps run generative models on-device without network calls. The repo bundles ten example categories (chat, voice, structured generation, RAG, HealthKit) and nine system integration tools (weather, calendar, contacts, web search, etc.) into a single TestFlight-ready app. It also ships a standalone foundation-models-app-builder agent skill so coding assistants can ingest the patterns without parsing the full source tree.

The interesting bit

The project doubles as curriculum. Playground chapters walk through sessions, sampling controls, tool use, and multilingual support with runnable #Playground snippets. The Health Dashboard is unusually complete — it correlates metrics, generates weekly plans, and surfaces predictions through structured @Generable models rather than free-text guessing. That’s a lot of surface area for an SDK whose public documentation is still basically a WWDC session and a header file.

Key highlights

  • Runs fully offline on Apple Silicon devices with Apple Intelligence enabled
  • 37 runnable examples covering chat, streaming, structured generation with @Generable, dynamic schemas, and voice (STT + TTS)
  • Nine built-in tools using keyless APIs where possible (OpenMeteo, Search1API) so the app works without developer API keys
  • RAG pipeline using LumoKit/VecturaKit for document indexing and semantic search
  • Agent skill installable via npx skills add for Codex, Claude Code, and compatible assistants
  • Automated TestFlight uploads via GitHub Actions with repo-local ASC workflow

Caveats

  • Requires iOS 26.0+ / macOS 26.0+ and Xcode 26 official; won’t build on earlier toolchains
  • Needs Apple Intelligence enabled on a compatible device — no simulator fallback mentioned
  • Several tools require user permissions (HealthKit, Contacts, Calendar, Location, Reminders, Music) and the Apple Music tool requires an active subscription
  • README truncates mid-sentence on multilingual support; coverage beyond the 10 listed languages is unclear

Verdict

Swift developers targeting Apple Intelligence should treat this as the unofficial textbook. Android developers, cross-platform teams, or anyone without a recent Apple Silicon device can safely skip — the framework is Apple-only and hardware-gated.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.