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.
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.
npx skills add apple/coreai-models --skill auditing-helper-reusegit 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/skills/apple/coreai-models/auditing-helper-reuse)<a href="https://agentmods.dev/skills/apple/coreai-models/auditing-helper-reuse"><img src="https://agentmods.dev/badge/skills/apple/coreai-models/auditing-helper-reuse/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/skills/apple/coreai-models/auditing-helper-reuse"><img src="https://agentmods.dev/badge/skills/apple/coreai-models/auditing-helper-reuse.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.00110 | $0.01449 |
| Opus 5.5 | $0.00044 | $0.00580 |
| Sonnet 5.5 | $0.00022 | $0.00290 |
| Haiku 4.5 | $0.00011 | $0.00145 |
Grade A, and why
auditing-helper-reuse 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 16d 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.
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 — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Auditing helper reuse before a model-export PR
Overview
Replace re-implemented helpers with existing ones only when the replacement is an identity transform: exported graphs, weights and outputs stay exactly the same.
A reuse that changes numbers or lowering is a model change, not a cleanup, however small the tolerance. That includes deleting a branch the target model never takes.
scripts/graph_identity.py compare is the arbiter: reading code finds candidates, compare
decides. Count added non-test source toward the 500 lines.
Preconditions and invariant
- Before: the new code has tests, and every one that can run here passes. Failures elsewhere are acceptable only if they fail the same way on the base branch in the same environment; otherwise stop and fix them. A tier that cannot run (missing package, no network) is recorded as not run: it does not block the audit, but the PR stays in draft until it has run.
- Invariant: every test has the same outcome as in the baseline, and
comparereports 0 differences.
The baseline is the unedited PR head in a detached worktree; snapshot its python/src and run
its tests there. Run the suite one test file per process (a Core AI runtime crash kills a whole
run). Rerun a differing test on its own, three times, in both trees: flaky in both is the same
outcome, flaky in one is a difference.
Process
- Snapshot the baseline first. Write a spec (see the script's docstring) that builds every new
module from tiny seeded configs. Give every branch an edit touches its own case: a GQA config
even if the real model has as many KV heads as query heads, and both values of a module flag,
set in the module that reads it after the change. Cover a caller that only builds from real
weights with its smallest submodule that uses the helper. Put config-dependent facts in
extras(): CLI--help, written metadata (no timestamps), errors from construction-time guards, andmlir_hashof converted programs. Then:- control: snapshot again;
comparemust report 0 (the spec is deterministic); - negative control: in a scratch copy, flip one constant in each area you plan to edit;
comparemust report differences for each, or the spec is blind there and must be fixed.
- control: snapshot again;
- Inventory every helper family, starting from
references/helper-map.md(check it against the tree; it goes stale). The biggest wins are often whole blocks copied from a peer model, export boilerplate and private imports, not the RoPE math. - Check each candidate by reading both implementations: layout, dtype, eps, constants, op order. A helper that fits only some call sites is still a reuse at those sites. Passing your config to a shared class is fine if the class reads only fields it already has.
- Apply only identities. Reject near-misses, anything that needs the shared helper or your
config changed to fit, and anything
comparecannot cover. Write each rejection down with its reason; it answers "why not reuse X?". A reviewer's swap request goes through the same check and the Boundaries; ifcomparediffers, reply with the first difference it reports. - Prove it:
compareexits 0 against the baseline; the suite matches the baseline (reused test helpers keep the same test count); the new code's optional tiers run via theuv run --with ...overlay their docstrings name, or are listed as not run in the PR's Tests section;ruff checkandruff format --checkpass. Have an independent reviewer try to refute each applied reuse; they also catch whatcomparecannot see, such as a new import pulling in a heavy package. - Commit. Fold each reuse into the commit that introduced the copy (
fixup! <subject>, thenGIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <base>). A promotion goes first: commit the move and the switch of callers already in the base on top of<base>, thengit rebase --onto <that commit> <base> <pr-branch>; the new code's switch is one more fixup. Confirmgit diff <tested-sha>is empty and every commit imports on its own. Rewriting history needs a force-push, so do it only on your own branch before reviews start; after that, add the reuses as new commits on top, promotion first.
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.
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.
- 16d ago First seen · 90 lines · 110 tokens per session scan A 4506a9a3da60
auditing-helper-reuse is a skill published in the GitHub repository apple/coreai-models (2,402 stars, last pushed today), licensed BSD-3-Clause. It adds 110 tokens to every session and 1,449 once invoked, about $0.0004 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-17.
auditing-helper-reuse compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| auditing-helper-reuseapple/coreai-models | Skill | 2.4k | today | BSD-3-Clause | A | 110 | Claude Code |
| autoreviewopenclaw/clawhub | Skill | 9.6k | today | MIT | A | 17 | Claude Code, Codex |
| omh-code-reviewrlaope/oh-my-hermes | Skill | 6.3k | today | MIT | A | 18 | Claude Code |
| agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skills | Skill | 2.2k | 11d ago | MIT | A | 115 | Claude Code, Codex |
| asplos-writing-stylebrycewang-stanford/Awesome-Journal-Skills | Skill | 1.5k | yesterday | MIT | A | 65 | Claude Code |
| revdiff-planumputun/revdiff | Skill | 976 | yesterday | MIT | A | 84 | Claude Code |
| re0-mergeLilMGenius/paperthin | Skill | 1.5k | today | MIT | A | 51 | Claude Code, Codex |