Measures task accuracy of text models served by MAX using standard benchmarks (GSM8K, MMLU, HellaSwag, ARC, AIME, GPQA, TruthfulQA, WinoGrande, BABILong). Useful for benchmarking, comparing with model-card scores, or verifying new MAX model correctness.
Ships in max-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A model that serves cleanly can still answer benchmark questions wrong. This skill measures how accurately a text model behind MAX answers standard datasets — GSM8K, MMLU, HellaSwag, ARC, AIME, GPQA, TruthfulQA, WinoGrande, and BABILong. It checks endpoint compatibility before each run, separates serving failures from wrong answers, and writes reproducible per-task scores you can compare against a model card.
Use this skill when you're benchmarking a served model, comparing it with model-card or reference scores, verifying that a newly imported MAX model answers correctly, or running repeatable dataset evaluations against a MAX OpenAI-compatible endpoint.
Do not use this skill when the model doesn't serve yet. Bring the model up
first (import-model); if it serves but generates wrong output, chase the
divergence with debug-model before benchmarking.
| File | Read when |
|---|---|
| references/examples.md | You want more command variants — remote endpoints, artifact paths, long context |
| references/fast-fail-thresholds.md | Before changing seed floors or adding a seed task |
| references/heartbeat-protocol.md | Building a program that consumes the progress stream |
Read the reference for what you're doing, not all of them upfront.
Resolve the absolute path to the directory containing this SKILL.md and save
it as SKILL_DIR. Every command below depends on it, so set it from the skill's
real location — not the user's working directory and not the literal placeholder
below. If you were handed the skill path, export that directly; otherwise resolve
it from the path to this file:
export SKILL_DIR="$(cd "$(dirname /path/to/eval-model/SKILL.md)" && pwd)"
Confirm it points at the manifest before continuing, so a wrong value fails here rather than midway through a run:
test -f "$SKILL_DIR/pixi.toml" && echo "SKILL_DIR ok: $SKILL_DIR"
Install the evaluator environment from its Pixi manifest:
pixi install --manifest-path "$SKILL_DIR/pixi.toml"
This environment holds the evaluator's own dependencies (lm-eval, datasets, transformers).
Some datasets require internet access, Hugging Face authentication, or license
acceptance. Set HF_TOKEN before the run when the dataset requires it.
The tasks fall into two groups that serve the model differently — decide which you're running, or serve so you can run both:
gsm8k, aime) score a generated answer and run
against a normally served model.mmlu, hellaswag, arc_easy, arc_challenge,
winogrande, truthfulqa, gpqa) score by prompt log probabilities, which
MAX only returns when the server starts with --enable-echo.Serve from an environment where MAX is installed.
For generation tasks, start the model normally:
max serve --model meta-llama/Llama-3.1-8B-Instruct
For multiple-choice tasks, add --enable-echo:
max serve \
--model meta-llama/Llama-3.1-8B-Instruct \
--enable-echo
You can't toggle echo on a live server. If one is already running without
--enable-echo, stop and restart it before evaluating a multiple-choice task —
there's no way to add the capability to a running process. The evaluator's
preflight is the authoritative check: it verifies prompt log probabilities
before downloading datasets and reports a configuration error if they're
unavailable.
If a model's generation_config.json sets a non-default repetition_penalty
(the Qwen2.5 family ships 1.05, for example), MAX auto-enables its penalty
sampling path, which is shape-incompatible with echo and crashes the serving
worker at startup with a repetition_penalty tensor-shape error. Models that
leave repetition_penalty unset (such as Llama-3.1 and Qwen3) don't trigger this
path. If you hit the crash, evaluate a model whose generation config leaves
repetition_penalty unset, or restrict the run to generation tasks (gsm8k,
aime).
Invoke the evaluator through its Pixi manifest from any working directory:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "meta-llama/Llama-3.1-8B-Instruct" \
--tasks gsm8k
For a quick endpoint and scoring check, lower both limits and use the bundled scorer:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "meta-llama/Llama-3.1-8B-Instruct" \
--tasks gsm8k \
--seed-limit 4 \
--full-limit 8 \
--direct-http
Use --direct-http only for connectivity and parsing checks like this one. Its
bundled scorer is 0-shot with a custom prompt, so its numbers run far below the
few-shot chain-of-thought scores on a model card — in one measured run the same
model scored 33% under the direct seed scorer and 82% on the lm-eval full pass.
Don't compare --direct-http results with published benchmarks; drop the flag
for any card comparison so the default lm-eval pass runs instead.
For multiple-choice tasks on an aliased served model, pass the Hugging Face
tokenizer ID with --tokenizer. This is required, not optional: lm-eval needs a
real tokenizer to compute token boundaries, and without it the tokenizer
defaults to --model and lm-eval fails trying to load the alias as a Hugging
Face repo.
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "my-served-alias" \
--tokenizer "meta-llama/Llama-3.1-8B-Instruct" \
--tasks mmlu,hellaswag
The --model value must match an ID returned by /v1/models.
--apply-chat-template wraps each prompt in the model's chat template. Whether
to use it depends on your comparison baseline, not just on whether the model is
instruction-tuned:
The command uses these exit codes:
0: All tasks completed, or every explicit --target was met.1: Setup, dependency, endpoint, dataset, or lm-eval failure.2: At least one explicit --target was missed.3: A direct seed task scored below its fast-fail floor.Without --target, a valid full run has status completed; the evaluator
doesn't impose model-independent accuracy targets. A completed or met status
means the run finished cleanly — it's not by itself a verdict that the model is
correct or at parity. To turn a run into a pass/fail or a comparison, supply a
baseline yourself.
The evaluator doesn't know any model's expected scores, so a real comparison is a few explicit steps:
--target. Be aware --target is a one-sided floor: the
run fails (exit 2) only when accuracy falls below it, so it gates rather
than measuring a two-sided delta.accuracy from the task's summary JSON and report the actual difference
from the reference. Allow for sampling noise — the default full run is 200
samples per task (or per subtask for grouped tasks), not the full test set,
so treat small gaps as noise rather than regressions. Raise --full-limit
toward the full dataset when you need a tighter estimate.pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "meta-llama/Llama-3.1-8B-Instruct" \
--tasks gsm8k,mmlu \
--target "gsm8k:0.84,mmlu:0.68"
Summaries default to eval-results/<model-name>/:
eval-results/meta-llama_Llama-3.1-8B-Instruct/
├── eval_summary.json
├── gsm8k_summary.json
└── mmlu_summary.json
Use --output-dir to choose another location or --run-id to change only the
default directory label. The combined summary records the effective CLI
configuration and evaluator dependency versions needed to interpret the run.
Task behavior is as follows:
gsm8k and aime: Direct-HTTP seed check, followed by an lm-eval full run.
Add --direct-http to use the bundled exact-match scorer for the full run.mmlu, hellaswag, arc_easy, arc_challenge, winogrande, and
truthfulqa: lm-eval full run through /v1/completions; require
--enable-echo.gpqa: lm-eval multiple-choice run through /v1/completions; requires
--enable-echo, and the dataset can require Hugging Face access.babilong: lm-eval chat run; defaults to
{"max_seq_lengths": "16k"} metadata.Each full run defaults to 200 samples (200 per subtask for grouped tasks such as
mmlu; gpqa and babilong default to 100). This is a spot check, not the
whole test set — raise --full-limit when you need a tighter estimate, and
expect small run-to-run variation at the default size. The summary reports the
aggregate number of effective child samples for grouped tasks.
Only the generation tasks (gsm8k, aime) run the direct seed pass; the
multiple-choice tasks skip straight to the full run, so seeing no seed accuracy
for mmlu and friends is expected. The seed's fast-fail floor is a
plumbing gate — it catches an unusable endpoint, a malformed request, or broken
answer extraction, not normal model-quality variation. To judge quality, use
--target (see "Compare against a model card"), not the fast-fail floor.
ChartQA isn't registered because stock lm-eval ChartQA prompt formatting isn't compatible with MAX image-token injection. Add a validated MAX-specific task configuration before enabling it.
Print the effective task configuration without installing MAX or starting a server:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" validate
For a MAX model whose chat template accepts reasoning_effort, pass one of
low, medium, high, or xhigh:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "<MODEL_ID>" \
--tasks gsm8k,aime \
--reasoning-effort low
The evaluator sends this value through
chat_template_kwargs={"reasoning_effort": ...} and automatically selects the
direct-HTTP full scorer for supported generation tasks. The preflight request
fails clearly if the endpoint doesn't accept the field.
Heartbeat records go to stdout; human-readable logs go to stderr. To archive them, capture each stream to its own file:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "<MODEL_ID>" \
--tasks gsm8k \
> heartbeats.jsonl \
2> eval.log
To watch liveness while the run proceeds, keep stdout on a pipe rather than a plain file, so a consumer can read heartbeats as they arrive — the example consumer in the heartbeat reference can't tail a file redirect alone:
pixi run --manifest-path "$SKILL_DIR/pixi.toml" eval \
--model "<MODEL_ID>" --tasks gsm8k \
2> eval.log | tee heartbeats.jsonl | python your_consumer.py
Treat a missing heartbeat for twice --heartbeat-interval as a possible stall.
For reasoning models, a single generation can legitimately exceed the default
30-second interval, so raise --heartbeat-interval (and with it the stall
threshold) to avoid false alarms on slow-but-healthy runs. The evaluator emits
done only after writing the corresponding task summary.
Use these checks:
curl http://localhost:8000/v1/models and
pass an exact returned model ID.--enable-echo (it can't be
enabled on a running server); confirm the selected runtime supports log
probabilities.repetition_penalty
tensor-shape error: The served model's generation_config.json sets a
non-default repetition_penalty (common in Qwen2.5), so MAX auto-enables a
penalty path that echo doesn't support. Use a model whose generation config
leaves repetition_penalty unset (Llama-3.1, Qwen3) for multiple-choice tasks,
or restrict the run to generation tasks (gsm8k, aime).No module named 'pydantic' from max serve: The serving environment has the
slim max package but not max-pipelines. Install max-pipelines.pixi install --manifest-path "$SKILL_DIR/pixi.toml" again.pixi run --manifest-path "$SKILL_DIR/pixi.toml" lm-eval ls tasks, then print
the effective task configuration with
pixi run --manifest-path "$SKILL_DIR/pixi.toml" validate (the validate task
runs the script's --validate-thresholds mode).--num-concurrent,
--full-limit, or the model's served context length as appropriate.pixi.toml (opens in a new tab)references/examples.md (opens in a new tab)references/fast-fail-thresholds.md (opens in a new tab)references/heartbeat-protocol.md (opens in a new tab)scripts/_eval_tasks.py (opens in a new tab)scripts/eval_dataset.py (opens in a new tab)tests/test_eval_dataset.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/benchmark-modelBenchmark a model served on MAX with the `max benchmark` command: measure throughput (tokens/sec), latency (TTFT, TPOT, inter-token latency), and GPU utilization by driving load against a running `max serve` endpoint. Use this whenever the user wants to benchmark, load-test, or measure the performance of a MAX model, get tokens-per-second / TTFT / TPOT numbers, run a concurrency or request-rate sweep, compare latency vs throughput, size a deployment, or produce benchmark JSON, even if they don't say "benchmark" by name. Also use when a `max benchmark` run fails to connect or reports zero/garbage numbers.
/debug-modelDebug a MAX model that loads, compiles, serves, and generates tokens but whose output disagrees with a reference implementation. Use whenever parity debugging stalls on scalar taps, the model returns gibberish or wrong greedy tokens, logit cosine is high but argmax differs, or generation is coherent then diverges. Applies during an architecture port, a quantization bring-up, a multi-GPU conversion, or after a MAX upgrade. Triggers on "parity failure", "silent corruption", "logits match but tokens diverge", "top-1 mismatch", "greedy divergence", and "model serves but generates garbage". Not for crashes on load or pre-serve scaffolding (use import-model). Mandates reference-vs-MAX tensor-dump comparators first, numerical verification of fixes before recompiling, and a serve-vs-pipeline bisect when dumps match but text diverges.
/import-modelUse when importing a new model architecture into MAX from a Hugging Face model ID. Triggers on: "import a model into MAX", "add model to MAX", "bring up <HF model> in MAX". Workflow: inspect the Hugging Face config and modeling code, then scaffold from a similar ModuleV3 architecture. Implement each layer as a max.nn Module that matches HF, serve, then verify against the Hugging Face reference. When the server runs but output is wrong (gibberish, greedy mismatch, coherent-then-diverges), load debug-model for the divergence hunt.
/migrate-max-v2-to-v3Use when migrating a MAX model from the V2 graph API (max.nn.legacy, TensorValue, explicit Graph construction) to ModuleV3 (max.nn, Tensor, F.lazy() + compile()). Triggers on: "migrate to ModuleV3", "port a max.nn.legacy model to max.experimental", "convert TensorValue to Tensor", "update my model to the V3 API", "ModuleV3 migration". Workflow: read the concept map, rewrite imports and __call__ signatures, and replace graph building with compile(weights=...). Align weight names with the new module hierarchy and move the KV cache unflatten into forward(). Port sharding to a DeviceMesh when the V2 model is sharded, then verify greedy outputs match the V2 implementation.
/new-modular-projectCreates a new Mojo or MAX project. Use when wanting to start a new Mojo or MAX project, initializing the `pixi` or `uv` environment to use Mojo or MAX, or when the user wants to begin a new Mojo or MAX project from scratch./profile-modelProfile a model running on MAX to find where it spends time and whether the GPU is saturated. Use when the user asks to "profile my model," "where is my model spending time," "why is inference slow," "is my GPU being utilized," "how much GPU am I using," "get a kernel breakdown," "capture an nsys/rocprof/ncu trace of max serve," or wants to measure MAX inference performance. Works for any model MAX can run — built-in architectures and custom ones loaded with --custom-architectures — from a pip or pixi install (max generate, max serve, or a Python script) on NVIDIA or AMD GPUs. Decide cheapest-first: a GPU utilization check, then a kernel breakdown, then a single-kernel deep dive only when one kernel dominates.
/max-skills:eval-model --model <MODEL_ID> --tasks gsm8k [--host localhost]from max-skills
npx claudepluginhub modular/skills --plugin max-skillsOther plugins' skills for the same job