Benchmark a language model across standard tasks with lm-evaluation-harness
domain: github.com/EleutherAI/lm-evaluation-harness · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Install the package with pip install lm-eval (optionally with a backend extra like lm-eval[hf])
Run an evaluation with lm_eval --model hf --model_args pretrained=<model>,dtype=float32 --tasks hellaswag,mmlu
List available tasks with lm-eval ls tasks to pick the right benchmark set
Control few-shot prompting with --num_fewshot and set --batch_size (a fixed integer, or auto to let it detect the largest batch that fits)
Save results with --output_path, and use --apply_chat_template for instruct-tuned models that need chat formatting
Known gotchas
The PyPI package name is lm-eval but the CLI/import name is lm_eval, which trips up copy-pasted install instructions
--apply_chat_template changes how multiple-choice targets are delimited, which can alter scores versus a run without it — keep it consistent when comparing model versions
--batch_size auto is convenient but hardware-dependent and non-deterministic across machines; pin a fixed integer for reproducible comparisons between runs
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?