coreai-models: Instructions file for Codex

AGENTS.md

coreai-models AGENTS.md is an instructions file for Codex, OpenCode from apple/coreai-models. It costs 1,942 tokens per session, scanned A, original, BSD-3-Clause.

Repository instructions for coding agents and reviewers working on the coreai-models project. They describe where code lives, how to check changes, and rules such as adding tests for new behavior.

In plain words
What is it for?
Use them when changing the Python model library, Swift runtime, export tools, or agent skills in coreai-models. They cover formatting, linting, tests, and signed commits.
Why use it?
They reduce guesswork about the project's structure and expected checks. They also help agents avoid adding duplicate code or submitting changes that fail the project's checks.

Instructions file for CodexOpenCode ✓ vendor

Written for Codex and OpenCode: the file is AGENTS.md.

This is apple/coreai-models's own configuration. It tells Codex and OpenCode how to work on coreai-models itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything coreai-models configures →

About the project

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.

apple/coreai-models · 2,402 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/apple/coreai-models/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/apple/coreai-models

Made for: Codex, OpenCode.

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 coreai-models AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/apple/coreai-models/agents-md/github.svg)](https://agentmods.dev/instructions/apple/coreai-models/agents-md)
Your own site
<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.

agentmods 80×15 button for coreai-models AGENTS.md

Your own site · 80×15
<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>
Per session 1,942 This file is loaded in full into every session.
When invoked 1,942 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.01942 $0.01942
Opus 5.5 $0.00777 $0.00777
Sonnet 5.5 $0.00388 $0.00388
Haiku 4.5 $0.00194 $0.00194

Measured today against content hash 9b9a3d67f916, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

AGENTS.md · 115 lines

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, and export/ the LLM and VLM export pipeline plus the shared compression, presets and bundle metadata. llm/, vlm/, embedding/, diffusion/ and segmentation/ are the per-task front ends (coreai.llm.export and the like; segmentation runs through models/sam3/export.py and models/sam3_video/export.py). model_registry.py (coreai.model.registry) is the catalogue of supported models and presets.
  • primitives/ and models/ each have a macos/ and an ios/ folder, and export/ has macos.py and ios.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, an export.py.
  • swift/Sources/ has one library per task (CoreAILanguageModels, CoreAIDiffusionPipeline, CoreAISpeech, ...), shared code in CoreAIShared, the llm-server request types in CoreAILMCommon, and the command-line tools in Tools/.

Read the full file on GitHub · 115 lines

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. today Changed · +9 lines · +74 tokens per session 9b9a3d67f916
  2. 14d ago First seen · 106 lines · 1,868 tokens per session scan A 2048e5055e12

Subscribe to this mod's changes

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.

Related

coreai-models AGENTS.md compared with instructions from other repositories

coreai-models AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
coreai-models AGENTS.mdapple/coreai-modelsInstructions file2.4ktodayBSD-3-ClauseA1,942Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deno copilot-instructions.mddenoland/denoInstructions file109kyesterdayMITA3,077GitHub Copilot