foundation-models-on-device

Integrate Apple FoundationModels on-device for private LLM tasks in iOS apps.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill foundation-models-on-device-kanakmalpani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/KanakMalpani/General-Private-Skills/tree/main/skills/foundation-models-on-device
Command: npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill foundation-models-on-device-kanakmalpani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels on-device enables private, offline LLM capabilities by running language models directly on iOS devices, ensuring user data never leaves the device.

Core Features & Use Cases

  • On-device execution: privacy-first, offline operation.
  • Structured generation with @Generable: define typed outputs and safer prompts.
  • Tool calling and snapshot streaming: integrate with app logic for real-time updates.
  • Use Case: In a chat app, generate local responses, extract structured data from user input without sending data to cloud.

Quick Start

Enable on-device model execution in your app and start a session to generate responses locally.

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 run LLMs on-device for iOS apps without sending data to the cloud?

You can run LLMs on-device for iOS apps by using the FoundationModels framework to start a local session, enabling private text generation and offline operation without cloud access.

How do I extract structured data from unstructured text using Swift?

To extract structured data in Swift, you apply the @Generable attribute to define typed outputs, enabling safer prompts and structured generation directly from the on-device model.

Can I use tool calling and streaming with on-device FoundationModels?

Yes, FoundationModels supports tool calling to integrate with app logic and snapshot streaming to provide real-time updates during local text generation.

What are the requirements for implementing on-device LLM workflows in iOS?

Implementing on-device LLM workflows requires Swift, the FoundationModels framework, and on-device runtime support to handle local text generation, tool integration, and snapshot streaming.

When should I use on-device LLMs instead of cloud-based generation?

You should use on-device LLMs for privacy-conscious workflows or offline scenarios where user data must not leave the device, ensuring local execution without relying on cloud access.