add-new-model

add-new-model is a skill for Claude Code from Blaizzy/mlx-vlm. It costs 83 tokens per session (1,087 once invoked), scanned A, original, MIT.

A development guide for adding a new model architecture to MLX-VLM, a machine-learning library for vision-and-language models.

In plain words
What is it for?
Use it when porting a Hugging Face model type into MLX-VLM, including creating configuration and model files, reusing similar code, and validating the result.
Why use it?
It provides a defined way to adapt an existing model, map its configuration and weight names, add tests, and check that the port works.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the mlx-vlm-skills plugin — 8 skills shipped together

Good fit Use it when porting a Hugging Face model type into MLX-VLM, including creating configuration and model files, reusing similar code, and validating the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/blaizzy/mlx-vlm/add-new-model
About the project

MLX-VLM is a Python package for running inference and fine-tuning vision-language models, which process images and text together, on Mac computers using MLX. It is used by developers working with multimodal models and includes command-line, web, server, scripting, and training workflows.

Blaizzy/mlx-vlm · 5,477 stars · on GitHub

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 Blaizzy/mlx-vlm --skill add-new-model
Clone the repo
git clone --depth 1 https://github.com/Blaizzy/mlx-vlm

Made for: Claude Code.

Or install mlx-vlm-skills, the plugin that ships this one along with the rest of its 8 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 add-new-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/blaizzy/mlx-vlm/add-new-model.svg)](https://agentmods.dev/skills/blaizzy/mlx-vlm/add-new-model)
Your own site
<a href="https://agentmods.dev/skills/blaizzy/mlx-vlm/add-new-model"><img src="https://agentmods.dev/badge/skills/blaizzy/mlx-vlm/add-new-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,087 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00083 $0.01087
Opus 5 $0.00042 $0.00544
Sonnet 5 $0.00017 $0.00217
Haiku 4.5 $0.00008 $0.00109

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

Security

Grade A, and why

add-new-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 8d 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.

skills/skills/add-new-model/SKILL.md · 64 lines

How it starts

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

Add a New Model

Use this workflow to port a new model to MLX-VLM.

Layout Rules

  • New model lives in mlx_vlm/models/<model_type>/, and the main file is named after the config.json model_type (e.g. model_type: "llava"mlx_vlm/models/llava/llava.py). The loader resolves the arch by importing mlx_vlm.models.<model_type> (see MODEL_REMAPPING in mlx_vlm/utils.py for aliases).
  • Split by concern like the existing families: language.py, vision.py, config.py, processing_*.py. A new kernel/helper goes in its own file in the model dir, not inside language.py.
  • Start from a similar existing model in mlx_vlm/models/ and adapt — don't write from scratch.

Steps

  1. Confirm weights are safetensors. If not, convert them first (HF safetensors converter), then proceed.
  2. Copy a close relative as scaffolding (same attention/vision style). Rename to the new model_type.
  3. Write config.py. A ModelConfig dataclass; give every new field a backward-compatible default (None/0/False) so existing configs still load unchanged. Add inline # comments.
  4. Map layer/weight names. Determine them by one of:
    • the Transformers implementation, if you know it;
    • loading the weights and printing key names;
    • reading model.safetensors.index.json in the HF repo.
  5. Wire the forward pass (embeddings → vision/audio encoder → projector → language model), reusing shared helpers (prompt_utils.py, processors) where possible.
  6. Convert to MLX to get loadable weights — Skill("mlx-vlm-skills:convert-quantize"). Upload them to to mlx-community (which is self-add) on HF if there is no usable official repo. If the model is already usable directly from HF, you can skip this step and just use the repo directly.
  7. Add a test class in mlx_vlm/tests/test_models.py (e.g. TestMyModel) — a tiny random-weight config, a shape/forward check, and (if applicable) an exactness check against a reference path in the degenerate limit. Do not create a standalone test file.
  8. Add a README in the model dir with a short description of the model, supported HF repos, and example usage.

Read the full file on GitHub · 64 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. 8d ago First seen · 64 lines · 83 tokens per session scan A a6f2376a7ddc

Subscribe to this mod's changes

add-new-model is a skill published in the GitHub repository Blaizzy/mlx-vlm (5,477 stars, last pushed yesterday), licensed MIT. It adds 83 tokens to every session and 1,087 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

mlx-model-porting

Guides and validates architecture-aware ports of PyTorch/Hugging Face models to Apple MLX, inspects existing local MLX projects, and plans evidence-gated optimizations for Apple Silicon. Use when the user asks to run, port, convert, inspect, quantize, benchmark, or fix a model (LLM, VLM, audio/TTS/ASR, diffusion, SSM…

Amal-David/mlx-porting-skill · 244 tokens

batch-processing-clinical-text

Run large-scale batch NER, PII extraction, or de-identification over many clinical notes on-device with OpenMed, with sharding, checkpointing, resumability, and append-only JSONL output. Use when the user needs to process a corpus or folder of notes, de-identify a dataset, run NER over thousands of documents, build a…

maziyarpanahi/openmed · 161 tokens

bridging-presidio-and-spacy

Combine OpenMed clinical NLP with Microsoft Presidio, spaCy, or LangChain through OpenMed's built-in interop adapter registry (openmed.interop). Covers the lazy adapter registry (availableadapters, getadapter, adapterspec), the presidio/spacy/langchain pip extras, and the verified callables — Presidio…

maziyarpanahi/openmed · 154 tokens

exporting-to-fhir

Convert OpenMed NER output (entities from openmed.analyzetext) into FHIR R4 resources — Condition, MedicationStatement, Observation — using OpenMed's built-in FHIR R4 export helpers in openmed.clinical.exporters. Covers the verified CodeableConcept builder (coding, codeableconcept, systemuri), deterministic fullUrl…

maziyarpanahi/openmed · 163 tokens

authoring-model-cards

Generate a model card for an OpenMed clinical NER or de-identification model documenting intended use, quantitative metrics, subgroup performance, limitations, and a medical-device disclaimer for clinical AI governance. Use when the user wants to write or update a model card, a README model section, or governance…

maziyarpanahi/openmed · 135 tokens

building-gold-corpus

Scaffold a synthetic gold-standard annotation project for evaluating OpenMed NER and de-identification models — label schema, annotation guidelines, BRAT or Label Studio config, and disjoint train/dev/test splits. Use when the user wants to create eval fixtures, set up annotation, define a label set, write guidelines…

maziyarpanahi/openmed · 159 tokens