foundation-models-on-device

Generate on-device LLM responses with FoundationModels for iOS 26+ apps.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/cescrafli/compyrasion --skill foundation-models-on-device-cescrafli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: foundation-models-on-device
Source: https://github.com/cescrafli/compyrasion/tree/main/skills/foundation-models-on-device
Command: npx skills add https://github.com/cescrafli/compyrasion --skill foundation-models-on-device-cescrafli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

On-device LLM generation enables private, offline AI responses without cloud data transmission.

Core Features & Use Cases

  • On-device execution for privacy: All processing happens on the device, with no data sent to external servers.
  • Structured outputs with @Generable: Generate typed, structured results instead of free text.
  • Tool calling and streaming: Integrate domain tools and stream results to UI for real-time updates.
  • Use cases include building privacy-first chat assistants, data extraction workflows, and offline AI features in iOS apps.

Quick Start

Initialize an on-device FoundationModels session and generate a concise, privacy-preserving response to a user prompt.

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 structured outputs from an on-device LLM in iOS?▼

On-device LLM generation enables private, offline AI responses without cloud data transmission. It uses FoundationModels to process text generation, structured outputs, and tool calling directly on iOS devices.

Can I stream LLM responses directly to my iOS app UI?▼

Yes, you can stream LLM responses to your iOS app UI using snapshot streaming patterns. This FoundationModels feature provides real-time updates during on-device generation without cloud transmission.

Does on-device LLM generation support tool calling for iOS apps?▼

Yes, on-device LLM generation supports tool calling within FoundationModels sessions. You can integrate domain tools alongside @Generable structured outputs and snapshot streaming for offline iOS apps.

What are the limitations of using FoundationModels for offline AI?▼

Limitations of using FoundationModels for offline AI include requiring careful model availability checks and single-session requests. It also requires iOS 26+ and proper Generable types to ensure reliability.

How do I ensure privacy during on-device text generation?▼

To ensure privacy during on-device text generation, use FoundationModels sessions which process all data locally. No user data is sent to external servers, keeping offline AI responses completely private.