/mlx-vlm-skills:add-new-modelfrom mlx-vlm-skills
Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face model_type to a new file under mlx_vlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language, language, audio, and diffusion model ports.
Ships in mlx-vlm-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this workflow to port a new model to MLX-VLM.
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).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.mlx_vlm/models/ and adapt — don't write from scratch.model_type.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.model.safetensors.index.json in the HF repo.prompt_utils.py, processors) where possible.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.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._infer_tool_parser_from_processor against the model's actual chat template. Reuse a compatible parser in mlx_vlm/tool_parsers/; add a parser and register its template markers in __init__.py only when needed. Check that existing formats still select the right parser.process_tool_calls in mlx_vlm/server/responses_state.py: it strips the start/end markers before invoking the parser. Confirm tools and prior tool results render correctly through the chat template.TestProcessToolCalls in mlx_vlm/tests/test_server.py, reusing existing streaming tests and fixtures. Avoid a new model-specific test file or duplicated endpoint mocks. Cover a single call, argument types, malformed input, and ordinary text around calls.uv run --with pytest python -m pytest mlx_vlm/tests/test_server.py mlx_vlm/tests/test_responses_state.py -q -k 'ToolCall or tool_content'. Include existing tests for any reused parser that changed.uv run python - <<'PY'
from huggingface_hub import hf_hub_download
import json
p = hf_hub_download("<repo>", "model.safetensors.index.json")
print("\n".join(sorted(json.load(open(p))["weight_map"])[:60]))
PY
cd mlx_vlm && uv run --with pytest python -m pytest tests/test_models.py -q -k "TestMyModel"
Skill("mlx-vlm-skills:cli-inference"). Run on Apple Silicon with enough RAM for the model; isolate a submodule with random-init weights if the full model does not fit (do not run large models on an 8 GB machine).Skill("mlx-vlm-skills:contributing").Model type <x> not supported: the folder name / model_type don't match, or the arch import failed — check mlx_vlm/models/<model_type>/ exists and imports cleanly.model.safetensors.index.json.processing_*.py and prompt_utils usage.Skill("mlx-vlm-skills:reproducible-github-issues").What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/benchmarkingUse this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a PR description./cli-inferenceUse this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlx_vlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights./contributingOther plugins' skills for the same job
npx claudepluginhub yuhuabillchen/justfit-mlx --plugin mlx-vlm-skills