foundation-models

foundation-models is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 29 tokens per session (5,838 once invoked), scanned A, original, MIT.

A guide to using Apple’s Foundation Models framework for on-device language features. On-device means the model runs on the user’s device, which can keep supported input private.

In plain words
What is it for?
Use it to add text generation, summarization, extraction, classification, structured output, or tool-calling features to Apple apps.
Why use it?
It helps choose suitable tasks and design prompts around the limits of Apple’s small on-device model instead of expecting it to handle general knowledge, mathematics, or code generation.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Good fit Use it to add text generation, summarization, extraction, classification, structured output, or tool-calling features to Apple apps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/foundation-models
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rshankras/claude-code-apple-skills --skill foundation-models
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for foundation-models

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/foundation-models/github.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/foundation-models)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/foundation-models"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/foundation-models/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for foundation-models

Your own site · 80×15
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/foundation-models"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/foundation-models.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,838 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.05838
Opus 5 $0.00015 $0.02919
Sonnet 5 $0.00006 $0.01168
Haiku 4.5 $0.00003 $0.00584

Measured 9d ago against content hash a821c5f4b3fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

foundation-models scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let weather = await WeatherService.shared.fetch(for: arguments.location)
skills/apple-intelligence/foundation-models/SKILL.md · 682 lines

How it starts

The opening of the file, as written. The whole thing — 682 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Foundation Models

Integrate Apple's on-device LLM into your apps for privacy-preserving AI features. Companion references: safety-and-guardrails.md (model limits, prompt design, the four-layer safety stack), models-and-agents.md (Private Cloud Compute, LanguageModel protocol, vision input, DynamicProfile agentic sessions — the iOS 27 wave), and utilities-package.md (Apple's open-source utilities package: OpenAI-compatible endpoints, just-in-time Skills, history compression).

When This Skill Activates

  • User wants AI text generation features
  • User needs structured data from natural language
  • User asks about prompting or LLM integration
  • User wants to implement AI assistants or agentic features (tool loops, multi-profile sessions)
  • User needs content summarization or extraction
  • User asks about Private Cloud Compute, guardrails, or model safety

Model Fit — Check Before Building

The on-device model is ~3B parameters (2-bit quantized): built for summarization, extraction, classification, tagging, revision, short chat — not math, code generation, facts, or world knowledge (WWDC25 248). For capability boundaries, prompt-design rules, and the safety stack, read safety-and-guardrails.md first. For anything bigger, PrivateCloudComputeLanguageModel (32k context, reasoning) and third-party backends are in models-and-agents.md.

Quick Start

1. Check Availability

import FoundationModels

struct IntelligentView: View {
    private var model = SystemLanguageModel.default

    var body: some View {
        switch model.availability {
        case .available:
            ContentView()
        case .unavailable(.deviceNotEligible):
            UnsupportedDeviceView()
        case .unavailable(.appleIntelligenceNotEnabled):
            EnableIntelligenceView()
        case .unavailable(.modelNotReady):
            ModelDownloadingView()
        case .unavailable(let reason):
            ErrorView(reason: reason)
        }
    }
}

Read the full file on GitHub · 682 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 682 lines · 29 tokens per session scan A a821c5f4b3fa

Subscribe to this mod's changes

foundation-models is a skill published in the GitHub repository rshankras/claude-code-apple-skills (710 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 5,838 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.