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 agentmods add skills/scouzi1966/maclocal-api/add-afm-modelnpx skills add scouzi1966/maclocal-api --skill add-afm-modelgit clone --depth 1 https://github.com/scouzi1966/maclocal-apiWrote 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/scouzi1966/maclocal-api/add-afm-model)<a href="https://agentmods.dev/skills/scouzi1966/maclocal-api/add-afm-model"><img src="https://agentmods.dev/badge/skills/scouzi1966/maclocal-api/add-afm-model.svg" alt="Measured on agentmods" 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.00048 | $0.01419 |
| Opus 5 | $0.00024 | $0.00709 |
| Sonnet 5 | $0.00010 | $0.00284 |
| Haiku 4.5 | $0.00005 | $0.00142 |
Grade A, and why
add-afm-model 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 6d 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 — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add AFM Model
Investigate and add support for a HuggingFace MLX model to the AFM server.
Usage
/add-afm-model <model-id>— e.g.,/add-afm-model mlx-community/Qwen3-8B-4bit/add-afm-model <url>— e.g.,/add-afm-model https://huggingface.co/mlx-community/Qwen3-8B-4bit
Instructions
Step 1: Parse Input
Extract the HuggingFace model ID from the user's input:
- Full URL:
https://huggingface.co/org/model→org/model - Model ID:
org/model→ use as-is - If ambiguous, ask the user.
Step 2: Fetch config.json
Fetch https://huggingface.co/<model-id>/resolve/main/config.json using WebFetch.
Not MLX check: If config.json has no quantization or quantization_config field, the model is not MLX-quantized. Inform the user:
"This model is not in MLX format. Look for an MLX-quantized version on huggingface.co/mlx-community, or quantize it yourself with
mlx_lm.convert."
Stop here if not MLX.
Step 3: Extract model_type
Read the model_type field from config.json. This is the key that maps to a Swift model implementation.
Also note: architectures, num_experts/num_local_experts (MoE indicator), image_token_id/vision_config (VLM indicator).
Step 4: Check LLMTypeRegistry
Search Scripts/patches/LLMModelFactory.swift for the model_type string in the LLMTypeRegistry.shared dictionary (lines ~25-80).
If found → Already supported. Tell the user:
"This model is already supported! Run it with:
MACAFM_MLX_MODEL_CACHE=/Volumes/edata/models/vesta-test-cache afm mlx -m <model-id> --port 9999 ```"
Suggest running /test-macafm for validation if this is a new model variant.
Stop here if already registered.
Step 5: Check Existing Architectures
The model_type is NOT in the registry. Now determine if an existing Swift implementation can handle it.
- List files in
vendor/mlx-swift-lm/Libraries/MLXLLM/Models/ - Search for the model's base architecture name (e.g., if model_type is
foo_moe, check forFoo.swiftor similar) - Read the model's config.json fields and compare against existing implementations — some architectures handle variants (e.g., DeepseekV3 handles
kimi_k2, Qwen2 handlesacereason) - Check if an existing model has a dense fallback (e.g.,
numExperts == 0path)
What ships with it
2 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.
- 6d ago First seen · 124 lines · 48 tokens per session scan A 822843a066dc
add-afm-model is a skill published in the GitHub repository scouzi1966/maclocal-api (337 stars, last pushed yesterday), licensed MIT. It adds 48 tokens to every session and 1,419 once invoked, about $0.0002 per session on Opus 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-08-30.
Other skills, from other repositories
apple-foundation-models-conversation-context-builder
Extract context and build continuation prompts for multi-turn conversations.
apple-foundation-models-playground-learning
Interactive learning examples and playground experiments for Foundation Models.
apple-foundation-models-session-patterns
Create and configure LanguageModelSession for single-turn and multi-turn conversations.
apple-foundation-models-streaming-chat-context
Stream responses and manage context window with progressive rendering.
apple-foundation-models-token-budget-management
Count tokens and manage context budgets to optimize API usage.
apple-foundation-models-dynamic-schemas
Build schemas dynamically at runtime for flexible structured output.