LM Evaluation Harness
$ lm-eval Official Low RiskLM Evaluation Harness (lm-eval) runs standardized zero-shot and few-shot LLM benchmarks (MMLU, HellaSwag, GSM8K, etc.) across Hugging Face Transformers, vLLM, and OpenAI-compatible endpoints. It provides lm-eval ls tasks for discovery and lm-eval run --output_path to persist structured JSON scorecards.
pip install lm-eval lm-eval executes directly against local GPUs, Hugging Face model caches, and vLLM servers, making direct CLI invocation essential.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Fully non-interactive with --output_path JSON artifact writing and lm-eval ls tasks, though stdout mixes progress bars and ASCII tables rather than streaming JSON.
- Writes structured
results_*.jsonfiles via--output_path - Stdout emits tqdm progress bars and Markdown/ASCII summary tables
Read-only model evaluation by default with --limit caps, though enabling trust_remote_code=True in --model_args or code-execution tasks (humaneval) requires sandboxing.
- Supports
--limitsample caps to bound time and API cost - Local
--output_pathfile writes only
Installable via pip install lm-eval, but relies on PyTorch/Transformers and optional GPU/vLLM extras.
- Heavy PyTorch and Hugging Face runtime stack
De-facto standard academic LLM evaluation suite supporting HF, vLLM, GGUF, and commercial API backends.
- Supports
hf,vllm,local-completions, and 60+ task suites
Official EleutherAI repository (EleutherAI/lm-evaluation-harness) under MIT license with broad industry adoption.
- Official EleutherAI repository under MIT license
Well-documented docs/interface.md and helpful --help options.
- Documented CLI interface in upstream repository
Security, Auth & Guardrails
Reads Hugging Face cache/tokens (HF_TOKEN in ~/.cache/huggingface/token) or API backend keys (OPENAI_API_KEY) from environment variables.
MIT open-source CLI; local GPU compute or remote API token fees apply depending on --model backend.
# LM Evaluation Harness (lm-eval) Agent Rules - Always pass `--limit <n>` for smoke checks and `--output_path <dir>` so structured JSON metrics are saved to disk. - Verify task names with `lm-eval ls tasks` before launching a run. - Never pass `--trust_remote_code` inside `--model_args` unless the user explicitly approves the model repo.
Agent-Ready Command Recipes
Safe Read-Only Queries
lm-eval ls tasks
Prints available task and group names supported by the installed harness.
Controlled Writes & Previews
lm-eval run --model hf --model_args pretrained=gpt2 --tasks hellaswag --limit 10 --output_path ./eval_out
Evaluates 10 samples cleanly and saves structured results_*.json metrics into ./eval_out.
Strengths for Agents
- + Saves reproducible JSON result files (
--output_path) across hundreds of standardized LLM benchmarks. - + Built-in
lm-eval ls tasksmakes task discovery straightforward.
Caveats & Pitfalls
- ! No
--jsonstdout flag; agents must parse the JSON file written under--output_path. - ! Full runs without
--limitcan run for hours on large benchmarks.