add-new-model

add-new-model is a skill for Claude Code from Blaizzy/mlx-vlm. It costs 83 tokens per session (1,497 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,652 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/github.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/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 add-new-model

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,497 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.01497
Opus 5.5 $0.00033 $0.00599
Sonnet 5.5 $0.00017 $0.00299
Haiku 4.5 $0.00008 $0.00150

Measured 1mo ago against content hash 2d3366b16bbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 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. Check tool calling for every model. Inspect the official model card, chat template, and reference parser to establish support, including for models that reuse an existing architecture. If supported, complete Tool Calling; otherwise record whether support is absent or still unknown.
  8. 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.
  9. 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 · 74 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. 1mo ago Changed 2d3366b16bbe
  2. 1mo ago Changed · +10 lines 4eaba286c8c6
  3. 1mo 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,652 stars, last pushed today), licensed MIT. It adds 83 tokens to every session and 1,497 once invoked, about $0.0003 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-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

loading-openmed-models

Load OpenMed clinical/biomedical NER models from the Hugging Face Hub or a local path and reuse them efficiently across calls. Use when the user wants to load an OpenMed model, control the model cache, run fully offline after a one-time download, reuse a ModelLoader to avoid reloading, set a cachedir or device, or…

maziyarpanahi/openmed · 118 tokens

normalizing-rxnorm

Normalizes drug mentions extracted by OpenMed to RxNorm RxCUIs using the free public RxNav/RxNorm REST API. Use when the user wants to code, standardize, or de-duplicate medication names, resolve a brand/generic/ingredient to a stable RxCUI, link strength+dose-form to an SCD/SBD, attach NDCs, or build a US Core…

maziyarpanahi/openmed · 187 tokens