foundation-models-on-device

Integrate Apple's FoundationModels framework into iOS 26+ apps for on-device text generation.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill foundation-models-on-device-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/foundation-models-on-device
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill foundation-models-on-device-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the need for cloud-based AI services in iOS 26+ apps, keeping all user data on the device for full privacy and offline functionality.

Core Features & Use Cases

  • On-Device Text Generation: Generate and summarize text directly on iOS devices with no internet connection, powered by Apple's FoundationModels framework.
  • Structured Output with @Generable: Extract typed, structured data from natural language input for use in forms, app logic, and data processing workflows.
  • Custom Tool Calling: Implement domain-specific AI actions like recipe search or calendar lookup by letting the on-device model invoke your custom Swift code.
  • Real-Time Snapshot Streaming: Progressively display generated structured content in SwiftUI for smooth, responsive user interfaces.
  • Use Case Example: Build a fully offline cooking assistant that suggests recipes based on user-provided ingredients and returns structured recipe data without sending any input to external servers.

Quick Start

Use the foundation-models-on-device skill to add a private on-device text summarization feature to your iOS 26 app that works without an internet connection.

Frequently Asked Questions about foundation-models-on-device

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate text on-device in iOS 26 without an internet connection?

On-device text generation in iOS 26 uses the FoundationModels framework to generate and summarize text directly on the device, ensuring full privacy and offline functionality without requiring a cloud service.

How do I extract structured data from natural language in Swift?

Structured data extraction from natural language is done using the @Generable macro in Swift, providing compile-time type safety for structured outputs that can be used directly in app logic and forms.

Can I implement custom tool calling with Apple Intelligence on iOS?

Custom tool calling with Apple Intelligence allows the on-device model to invoke your domain-specific Swift code, enabling actions like recipe search or calendar lookup without sending data to external servers.

How does snapshot streaming work for SwiftUI interfaces?

Snapshot streaming progressively displays generated structured content in SwiftUI, providing real-time UI updates for a smooth and responsive user interface experience during model generation.

Do I need a cloud-based AI service to build a private iOS assistant?

You do not need a cloud-based AI service to build a private iOS assistant, because the FoundationModels framework processes structured generation and tool calling entirely offline on the device.

What are the limitations of using FoundationModels for offline AI?

FoundationModels offline AI is limited to iOS 26+ applications and adheres to Apple Intelligence platform constraints, requiring devices that support the framework to run on-device text generation and tool calling.