benchmarking

benchmarking is a skill for Claude Code from Blaizzy/mlx-vlm. It costs 74 tokens per session (1,142 once invoked), scanned A, original, MIT.

A workflow for measuring MLX-VLM code changes with repeatable performance tests. It compares versions or isolated modules using timing, memory, correctness checks, and parameter sweeps.

In plain words
What is it for?
Use it to create PR-ready comparisons, test how performance changes with sequence length or batch size, report peak memory, and write reproducible benchmark scripts.
Why use it?
It reduces the risk of presenting misleading benchmark results by requiring warmups, median timings, synchronized work, and checks that both implementations produce the right result.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

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

Good fit Use it to create PR-ready comparisons, test how performance changes with sequence length or batch size, report peak memory, and write reproducible benchmark scripts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/blaizzy/mlx-vlm/benchmarking
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,640 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 benchmarking
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 benchmarking

README.md
[![agentmods](https://agentmods.dev/badge/skills/blaizzy/mlx-vlm/benchmarking/github.svg)](https://agentmods.dev/skills/blaizzy/mlx-vlm/benchmarking)
Your own site
<a href="https://agentmods.dev/skills/blaizzy/mlx-vlm/benchmarking"><img src="https://agentmods.dev/badge/skills/blaizzy/mlx-vlm/benchmarking/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 benchmarking

Your own site · 80×15
<a href="https://agentmods.dev/skills/blaizzy/mlx-vlm/benchmarking"><img src="https://agentmods.dev/badge/skills/blaizzy/mlx-vlm/benchmarking.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,142 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.00074 $0.01142
Opus 5.5 $0.00030 $0.00457
Sonnet 5.5 $0.00015 $0.00228
Haiku 4.5 $0.00007 $0.00114

Measured 1mo ago against content hash c8751953842b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

benchmarking 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/benchmarking/SKILL.md · 80 lines

How it starts

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

Benchmarking & PR A/B Testing

Use this workflow to produce credible, reproducible performance numbers for a PR.

Rules for a trustworthy benchmark

  • Median of N (not mean), with a few warmup iterations discarded.
  • Call mx.eval(...) / mx.synchronize() before stopping the timer (MLX is lazy — untimed work hides otherwise).
  • Report peak memory via mx.get_peak_memory()/1e9 (GB); reset with mx.reset_peak_memory() if available.
  • Include an inline correctness check — a benchmark that computes the wrong thing is meaningless. Assert the new path matches the baseline (exactly in the degenerate limit, or within tolerance).
  • Sweep one parameter (sequence length, batch, tokens, layers) and print a markdown table with flush=True.
  • Prefer a random-init synthetic model (tiny config) so the script needs no checkpoint download and runs on a fresh checkout.
  • State the hardware (Apple-Silicon chip + RAM). A model must fit in RAM; isolate the module under test with random weights if the full model won't fit — don't run large models on an 8 GB machine.

Fork-vs-main A/B (paste into the PR body)

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/Blaizzy/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}'

Read the full file on GitHub · 80 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 First seen · 80 lines · 74 tokens per session scan A c8751953842b

Subscribe to this mod's changes

benchmarking is a skill published in the GitHub repository Blaizzy/mlx-vlm (5,640 stars, last pushed today), licensed MIT. It adds 74 tokens to every session and 1,142 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

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

annotating-variants

Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST, VEP/SnpEff/ANNOVAR offline) and links variants to gnomAD population frequencies and the clinical context OpenMed extracts. Use when the user wants to predict variant consequences, map HGVS to genomic…

maziyarpanahi/openmed · 179 tokens

assembling-fhir-bundles

Package multiple FHIR R4 resources produced from OpenMed output into a single valid transaction Bundle ready to POST to an EHR, using OpenMed's verified bundle assembler openmed.clinical.exporters.fhir.tobundle. Covers deterministic urn:uuid fullUrls, automatic in-Bundle reference rewriting, request blocks…

maziyarpanahi/openmed · 131 tokens

auditing-part11-trails

Generates and verifies 21 CFR Part 11-style audit trails — who/what/when, electronic signatures, and tamper-evidence — for OpenMed pipelines in GxP and clinical-trial (GCP) settings. Use when the user runs OpenMed in a regulated/validated environment and needs an attributable, time-stamped, tamper-evident record of…

maziyarpanahi/openmed · 222 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

building-patient-timelines

Assemble a chronological patient timeline from OpenMed-extracted clinical events, normalizing dates and resolving relative time expressions on-device. Use when the user wants to build a patient timeline, order events from clinical notes, reconstruct a longitudinal history, plot a course of illness, or turn…

maziyarpanahi/openmed · 154 tokens