Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

LM Evaluation Harness

$ lm-eval Official Low Risk
EleutherAI · AI & Media · MIT · macos / linux / windows

LM 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.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
pip install lm-eval
CLI vs MCP Decision CLI Preferred vs MCP

lm-eval executes directly against local GPUs, Hugging Face model caches, and vLLM servers, making direct CLI invocation essential.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

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_*.json files via --output_path
  • Stdout emits tqdm progress bars and Markdown/ASCII summary tables
Trust & Safety 19 / 25

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 --limit sample caps to bound time and API cost
  • Local --output_path file writes only
Setup & Portability 10 / 15

Installable via pip install lm-eval, but relies on PyTorch/Transformers and optional GPU/vLLM extras.

  • Heavy PyTorch and Hugging Face runtime stack
Utility & Efficiency 13 / 15

De-facto standard academic LLM evaluation suite supporting HF, vLLM, GGUF, and commercial API backends.

  • Supports hf, vllm, local-completions, and 60+ task suites
Maintenance & Lineage 9 / 10

Official EleutherAI repository (EleutherAI/lm-evaluation-harness) under MIT license with broad industry adoption.

  • Official EleutherAI repository under MIT license
Docs & Verifiability 8 / 10

Well-documented docs/interface.md and helpful --help options.

  • Documented CLI interface in upstream repository

Security, Auth & Guardrails

Auth Modes
Env API Key No Auth
Credential Storage

Reads Hugging Face cache/tokens (HF_TOKEN in ~/.cache/huggingface/token) or API backend keys (OPENAI_API_KEY) from environment variables.

Side Effects
Read-Only Local Write Billing Impact
Cost & Quotas

MIT open-source CLI; local GPU compute or remote API token fees apply depending on --model backend.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

List all registered benchmark tasks
lm-eval ls tasks

Prints available task and group names supported by the installed harness.

Controlled Writes & Previews

Run a 10-sample smoke benchmark and save JSON results
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 tasks makes task discovery straightforward.

Caveats & Pitfalls

  • ! No --json stdout flag; agents must parse the JSON file written under --output_path.
  • ! Full runs without --limit can run for hours on large benchmarks.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI