Core AI Models is a toolkit for exporting AI models, creating model components in Python, and running exported models in macOS and iOS apps through Swift utilities. It is for developers building on-device AI applications with Core AI. Its catalogue skills and plugin help coding agents work with the model export and runtime tooling.
Borrowing it
Nothing to install: this file belongs to apple/coreai-models. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/apple/coreai-models/main/AGENTS.mdgit clone --depth 1 https://github.com/apple/coreai-modelsWrote 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.
[](https://agentmods.dev/instructions/apple/coreai-models/agents-md)<a href="https://agentmods.dev/instructions/apple/coreai-models/agents-md"><img src="https://agentmods.dev/badge/instructions/apple/coreai-models/agents-md/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.
<a href="https://agentmods.dev/instructions/apple/coreai-models/agents-md"><img src="https://agentmods.dev/badge/instructions/apple/coreai-models/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01942 | $0.01942 |
| Opus 5.5 | $0.00777 | $0.00777 |
| Sonnet 5.5 | $0.00388 | $0.00388 |
| Haiku 4.5 | $0.00194 | $0.00194 |
Grade A, and why
coreai-models AGENTS.md scanned grade A with 0 findings 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 today.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
coreai-models — guidance for agents and reviewers
Core AI Python exports of models (python/src/coreai_models/, models/), the Swift runtime and tools
that run them (swift/Sources/), and agent skills (skills/).
Check your change
See CONTRIBUTING.md for setup. CI runs these checks; run them locally first:
uv run --frozen --only-group lint ruff check python/src/ python/tests/ models/
uv run --frozen --only-group lint ruff format --check python/src/ python/tests/ models/
swift format lint --strict --recursive swift/Sources/ swift/Tests/
uv run --frozen pytest python/tests/test_model_units -x -q
swift test --arch arm64 --disable-sandbox --filter <the suites you touched> # needs Xcode 27
--disable-sandbox turns off SwiftPM's own sandbox, which cannot start inside another one (an agent's
sandbox, a CI task). --frozen keeps uv from re-locking. Do not commit uv.lock unless a
pyproject.toml changed; discard an accidental change with git checkout -- uv.lock.
New functionality and bug fixes need tests, and every commit must be signed.
Where things live
python/src/coreai_models/is the export library.primitives/holds the building blocks (attention, norms, RoPE, caches, MLPs),models/the architectures built from them, andexport/the LLM and VLM export pipeline plus the shared compression, presets and bundle metadata.llm/,vlm/,embedding/,diffusion/andsegmentation/are the per-task front ends (coreai.llm.exportand the like; segmentation runs throughmodels/sam3/export.pyandmodels/sam3_video/export.py).model_registry.py(coreai.model.registry) is the catalogue of supported models and presets.primitives/andmodels/each have amacos/and anios/folder, andexport/hasmacos.pyandios.py. The macOS code builds models for the GPU. The iOS code rewrites the LLMs and the EmbeddingGemma 2 encoders for the Neural Engine, with float16 math and channels-first layouts. iOS diffusion, CLIP and CLAP exports stay on the GPU. A layer in both folders is two separate implementations, not shared code: a fix to model behavior (config, RoPE scaling, masking) usually belongs in both, while a numerics or layout fix usually does not.models/<name>/at the repo root holds per-model READMEs, compression configs and, where needed, anexport.py.swift/Sources/has one library per task (CoreAILanguageModels,CoreAIDiffusionPipeline,CoreAISpeech, ...), shared code inCoreAIShared, thellm-serverrequest types inCoreAILMCommon, and the command-line tools inTools/.
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.
- today Changed · +9 lines · +74 tokens per session 9b9a3d67f916
- 14d ago First seen · 106 lines · 1,868 tokens per session scan A 2048e5055e12
coreai-models AGENTS.md is an instructions file published in the GitHub repository apple/coreai-models (2,402 stars, last pushed today), licensed BSD-3-Clause. It adds 1,942 tokens to every session, about $0.0078 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-19.
coreai-models AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| coreai-models AGENTS.mdapple/coreai-models | Instructions file | 2.4k | today | BSD-3-Clause | A | 1,942 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 9,887 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 144k | today | MIT | A | 7,230 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 150k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 196k | today | MIT | A | 3,303 | GitHub Copilot |
| deno copilot-instructions.mddenoland/deno | Instructions file | 109k | yesterday | MIT | A | 3,077 | GitHub Copilot |