/mlx-vlm-skills:benchmarkingfrom mlx-vlm-skills
Benchmarks MLX-VLM changes with fork-vs-main A/B comparisons, micro-benchmarks, median-of-N timing, peak-memory reporting, correctness checks, and parameter sweeps for reproducible PR performance numbers.
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 produce credible, reproducible performance numbers for a PR.
mx.eval(...) / mx.synchronize() before stopping the timer (MLX is lazy — untimed work hides otherwise).mx.get_peak_memory()/1e9 (GB); reset with mx.reset_peak_memory() if available.flush=True.Clones upstream main and your fork, runs the identical bench on both, and joins into a speedup table:
#!/usr/bin/env bash
# <feature> perf: upstream main vs fork, random-init tiny <model>, swept over <param>.
set -euo pipefail
W=$(mktemp -d)
git clone -q --depth 1 https://github.com/Neywa-Labs/mlx-vlm "$W/main"
git clone -q --depth 1 https://github.com/<you>/mlx-vlm "$W/fork"
cat > "$W/b.py" <<'PY'
import time, numpy as np, mlx.core as mx
from mlx_vlm.models.<model> import Model, ModelConfig
cfg = ModelConfig(...tiny config...) # small enough to fit in RAM
m = Model(cfg); m.eval(); mx.eval(m.parameters())
def ms(T):
c = m.make_cache(); p = 0
while p < T: # chunked prefill avoids OOM
n = min(256, T - p)
mx.eval(m(mx.array(np.random.randint(0, cfg.vocab_size, (1, n))), cache=c).logits); p += n
for _ in range(4): mx.eval(m(mx.array([[0]]), cache=c).logits) # warmup
t = time.perf_counter()
for _ in range(20): mx.eval(m(mx.array([[0]]), cache=c).logits)
return (time.perf_counter() - t) / 20 * 1e3
for T in (16384, 32768, 65536):
print(T, round(ms(T), 2), flush=True)
PY
run() { uv venv -q "$1/.venv"; uv pip install -q -e "$1" --python "$1/.venv/bin/python"; "$1/.venv/bin/python" "$W/b.py"; }
run "$W/main" > "$W/m.txt"
run "$W/fork" > "$W/f.txt"
echo; printf "| param | main | fork | speedup |\n|--:|--:|--:|--:|\n"
join "$W/m.txt" "$W/f.txt" | awk '{printf "| %d | %.2f ms | %.2f ms | %.2fx |\n", $1, $2, $3, $2/$3}'
For one function/kernel (time + peak mem + correctness), swept over a param:
import time, statistics, mlx.core as mx
def bench(fn, it=30, warm=5):
for _ in range(warm): mx.eval(fn())
mx.synchronize()
if hasattr(mx, "reset_peak_memory"): mx.reset_peak_memory()
s = []
for _ in range(it):
t0 = time.perf_counter(); mx.eval(fn()); s.append((time.perf_counter() - t0) * 1e3)
return statistics.median(s), mx.get_peak_memory() / 1e9
# build inputs; assert new == baseline in the degenerate limit; then print a swept markdown table.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
2 plugins ship this exact skill · first indexed Nov 14, 2026
9 skills in this plugin
/add-new-modelUse 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./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./contributingnpx claudepluginhub neywa-labs/mlx-vlm --plugin mlx-vlm-skillsOther plugins' skills for the same job