🤫husshhussh
🤫husshhusshOnePuppy
The 🤫 magazine
AppleLLMSwift

Foundation Models Framework - Apple’s Swift Gateway to On-Device AI

With the Foundation Models Framework, developers can tap into Apple’s compact, high-performance on-device LLMs using familiar Swift code, intuitive tools, and ironclad privacy.

Manish SainaniĀ·July 23, 2025Ā·4 min read
Foundation Models Framework - Apple’s Swift Gateway to On-Device AI

Introduction

Until recently, building generative AI apps required deep ML expertise and access to large cloud infrastructures. But Apple is changing that narrative. With the Foundation Models Framework, developers can tap into Apple’s compact, high-performance on-device LLMs using familiar Swift code, intuitive tools, and ironclad privacy.

This isn’t just an API wrapper. It’s a full-stack integration between the model, the OS, and the developer toolkit - giving Apple developers an unfair advantage when creating intelligent apps that run fast, stay private, and work offline.

Developer-Centric Capabilities

  • Guided Generation with Swift Macros: Developers can annotate structs and enums in Swift with @Generable, turning them into templates for LLM output. This removes the guesswork and fragility of prompt engineering. You define a format, the model fills it reliably.
  • Constrained Decoding Built-In: The framework uses a decoding engine that enforces structural correctness. Developers never need to validate or parse malformed model outputs again. This enables confident integration with downstream features like autofill, voice commands, or personalized summaries.
  • Streaming Output via Sessions: The LanguageModelSession API gives you fine-grained control over inference sessions. Not only does it persist the model’s memory through a KV cache, but it also allows you to stream responses as they’re being generated. Great for chat interfaces, live suggestions, and editing tools.
  • Optimized Performance Under the Hood: Apple’s Foundation Models Framework optimizes for Swift’s concurrency model, meaning you get low-latency, high-throughput generation by default. It manages token caching, speculative decoding, and resource prioritization without manual setup.

Tool Calling - Structured, Safe, and Powerful

Tool calling is where Apple’s design ethos truly shines:

  • Developers define tools as Swift types conforming to a simple protocol. No YAML schemas or brittle API strings.
  • The framework ensures tools are only invoked with valid arguments. This means the model won’t hallucinate function names or pass malformed inputs.
  • Tool calls can be batched, chained, or composed into graphs - enabling rich automation workflows, such as querying reminders, updating contacts, and composing emails - all in one interaction.

This kind of compositional reasoning and tool invocation is a cornerstone for building AI-native apps that do things for users - not just talk back to them.

LoRA Adapter Fine-Tuning

Some apps need more than general-purpose intelligence. For those cases, the Foundation Models Framework provides a complete adapter training pipeline:

  • Rank-32 LoRA Adapters: Fine-tune adapters on your own data (e.g., customer support transcripts, legal clauses, educational material).
  • Integrated with Background Assets: Adapters are version-locked to specific base models and downloaded dynamically to the user’s device.
  • Speculative Decoding Support: You can also train a compact draft model to accelerate generation with minimal latency.

This lets developers teach the model new tricks - without ever touching the base weights or sending user data to a server.

ļø Developer Tools & Ecosystem

Apple has made sure that using the Foundation Models Framework fits right into your workflow:

  • Xcode Playground: A visual playground to prototype and refine prompts directly in Swift.
  • Performance Profiler: Monitor token generation time, memory footprint, and decoding paths.
  • Simulator Support: Test your LLM features in iOS and visionOS simulators before deploying to actual devices.

The framework also aligns with Apple’s commitment to performance: all of this runs efficiently on Apple silicon, leveraging its custom ML accelerators and cache hierarchies.

ļø Safety and Responsible AI by Default

Apple has embedded Responsible AI practices deep into this framework:

  • Prompts and tool schemas are screened by default for safety.
  • Cultural sensitivity and locale-specific nuances are respected via region-tuned adapters.
  • Guardrails prevent unsafe generations or toxic outputs from ever reaching the user.

What’s more, Apple provides documentation, best practices, and human interface guidelines to ensure developers don’t just build cool apps - but build ethical, inclusive, and high-quality ones.

Ideal Use Cases

  • Education: Personalized learning assistants that summarize lessons, quiz students, and adjust explanations dynamically.
  • Productivity: Smart notetaking, context-aware task creation, meeting transcription summarization.
  • Accessibility: Real-time voice captioning, visual scene interpretation, screen content description.
  • Enterprise Tools: Document classification, secure summarization, contract generation - run locally without compromising privacy.

CTA

The Foundation Models Framework is more than an API - it’s a bridge between Apple’s LLM innovation and developer creativity. With native Swift integration, real-time streaming, built-in safety, and full control over inference, it opens up a new frontier in intelligent app development.

Whether you're a solo app developer or an enterprise building AI-first tools, this framework brings the power of generative AI directly to your users - safely, privately, and beautifully.

Start building the future of on-device AI today.

The 🤫 hussh magazine

Written by Manish Sainani, and built to read beautifully here — and to travel to 🤫 One on your phone, your glasses, and visionOS, as one immersive magazine you own.

More from the magazine →Back to top ↑

Keep reading

More stories from the magazine

July 26, 2025

Parallelism, Experts, and Vision: How Apple Built a Scalable Server Model

Apple’s server-based language model represents the other half of its AI story. While the on-device model powers quick, personal interactions, the server model handles complex, large-scale tasks.

July 25, 2025

Building Personal Data Agents on iOS - A Deep Dive into Apple’s On-Device AI

In 2025, Apple revolutionized AI development on its platforms by introducing the Foundation Models framework. This API gives developers access to Apple’s private, on-device ~3B parameter language model that powers Siri and Apple Intelligence.

July 21, 2025

Inside Apple’s Compact On-Device LLM - Design, Performance & Impact

Apple's approximately 3B-parameter on-device language model powers a new era of intelligent apps on iPhones, iPads, and Macs. It is designed to deliver low-latency, privacy-first generative AI directly on Apple devices.

Products

  • Agent One
  • The 🤫 One app
  • Puppy One
  • Which Puppy is right for you?
  • The Puppy 100
  • Tag One
  • The 🤫 Store
  • The 🤫 One Card
  • Pricing
  • Claim your One
  • The product roadmap

🤫 Yellow Pages

  • The 🤫 Yellow Pages
  • Discover in the feed
  • Find a local expert
  • Coverage & markets
  • Connect - in Agent One
  • Ping an expert

Business & Enterprise

  • 🤫 for Business
  • Small & medium business
  • 🤫 Concierge (VVIP)
  • 🤫 for the Enterprise
  • Industry solutions
  • Federal government & agencies
  • šŸ‡ŗšŸ‡ø Defense & national security
  • For advisors (RIAs)
  • Partner Portal
  • One for Sellers
  • Developers

Watch, read & learn

  • The media library
  • The 🤫 Feed
  • See it in a minute
  • Listen - the podcasts
  • Blogs
  • Research & papers
  • Guides - by topic
  • Academy
  • The Heartbeat
  • Wiki

Company & open

  • About
  • Team
  • Investors
  • Fund A
  • Building in the open
  • Newsroom & press
  • Release notes
  • Careers
  • Contact
  • Explore - the whole site, mapped
  • Sitemap

Trust, rights & gratitude

  • The Hussh Protocol (PCHP)
  • Day 0 Trusted Circle
  • The case - a right, made enforceable
  • Data-rights landscape
  • Accessibility
  • 🤫 Champions of the Community
  • 🤫 Faculty - the professors
  • Gratitude - people we admire
  • The 1024 - humans of the world
  • Search every page
  • Browse (developer view)
🤫husshhusshKirkland, WAPrivacyTerms

Ā© 2026 Hushh Technologies Corporation - an independent company.