foundation-models-on-device

Generate on-device language responses using Apple FoundationModels with structured output.

1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/vinitgirdhar/GRID_ --skill foundation-models-on-device-vinitgirdhar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/vinitgirdhar/GRID_/tree/main/.agent/skills/foundation-models-on-device
Command: npx skills add https://github.com/vinitgirdhar/GRID_ --skill foundation-models-on-device-vinitgirdhar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Apple FoundationModels enable on-device language modeling, allowing apps to run LLM tasks privately without cloud transmission.

Core Features & Use Cases

  • On-device text generation with structured output via @Generable
  • Custom tool calling and snapshot streaming for offline apps
  • Privacy-preserving AI for apps that must operate without cloud data

Quick Start

Run an on-device FoundationModels session to generate a sample response and demonstrate structured output with @Generable.

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

On-device LLMs use Apple's FoundationModels to perform local language generation, preserving privacy by avoiding cloud processing entirely. This allows mobile apps to execute text generation offline while keeping user data securely on the device.

What is the best way to get structured output from an on-device language model?

The best way to get structured output from on-device language models is by applying the @Generable attribute. This feature structures the local text generation natively, allowing your iOS app to parse typed responses without cloud transmission.

Can I use custom tool calling with offline text generation on iOS?

Yes, you can use custom tool calling with offline text generation on iOS. The framework supports custom tool calls and real-time snapshot streaming, enabling responsive offline apps to trigger local actions during generation.

How does real-time snapshot streaming work for on-device LLMs?

Real-time snapshot streaming works by continuously updating the UI with partial generation results from the on-device LLM. This streaming mechanism provides a responsive interface while the local session actively generates text.

Do I need to check session availability before starting on-device text generation?

Yes, you need to check session availability before starting on-device text generation. The framework provides explicit availability checks to ensure the device supports the local FoundationModels session before attempting generation.