
lm-evaluation-harness
A Python framework that runs standard benchmark tests on language models and reports scores.
- Stars
- 14.4k
- Forks
- 3.7k
- Licence
- MIT
- Language
- Python
- Last update
- 2 months ago
- Type
- Dev tool
What it is
This is a command-line framework from EleutherAI for testing large language models on a wide set of standard benchmarks. You point it at a model (from Hugging Face, vLLM, or a commercial API) and choose tasks, and it reports how the model scores. Researchers use it to compare models with the same prompts so results are reproducible.
- Run the hellaswag benchmark on a Hugging Face model with a single lm_eval command
- List available tasks with lm-eval ls tasks
- Evaluate a model served by vLLM or an OpenAI-compatible API using the matching model type
- Define a task or evaluation in a YAML config file and run it with --config
- Evaluate a local model path or a GGUF model through the hf backend
Great for
- Researchers who need reproducible scores on standard academic benchmarks
- Engineers comparing several language models on the same tasks
- Teams evaluating a locally hosted or Hugging Face model
- People who want to add their own custom tasks or metrics
Not ideal for
- People who just want to chat with a model; this only runs evaluations
- Anyone without Python experience, since setup and configuration assume it
- Users needing a GUI; the README describes a command-line interface
- Multimodal evaluation at scale, since the README describes multimodal support as a prototype and points to lmms-eval for broader coverage
How to get it
- 1
Clone and build from source
You'll need: Python · pip · CUDA-compatible GPU (for the HuggingFace example in the README)
Clone the repository
git clone --depth 1 https://github.com/EleutherAI/lm-evaluation-harnessEnter the directory
cd lm-evaluation-harnessInstall the package
pip install -e .Install the HuggingFace backend
pip install "lm_eval[hf]" - 2
Run it
- Install the package and the hf backend extra
- List available tasks with lm-eval ls tasks
- Run an evaluation on a Hugging Face model: lm_eval --model hf --model_args pretrained=EleutherAI/gpt-j-6B --tasks hellaswag --device cuda:0 --batch_size 8
- Review the scores printed by the run
- 3
Get the most out of it
- Use --batch_size auto to let the tool pick the largest batch that fits your device
- Use YAML config files via --config for repeatable evaluations
- Register custom backends, filters, or metrics through the plugin system described in the Plugin Guide
- Use the Python API (simple_evaluate) to run evaluations from your own code
- Pass revision= in --model_args to evaluate partially trained checkpoints
Downloads
Strengths
- Covers a large number of standard benchmarks (the README says over 60) with many subtasks
- Supports many backends, including Hugging Face transformers, vLLM, SGLang, and commercial APIs
- Permissive MIT license and an active project with a DOI for citation
Trade-offs
- The base install omits model backends, so you must add extras such as lm_eval[hf] before running
- Some benchmarks and backends need a GPU and significant setup, and the README's examples assume CUDA
- The README is truncated here, so details on the full set of options and extras are not confirmed
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| lm-evaluation-harness (this) | 14.4k | Dev tool | intermediate | 2 months ago | Researchers who need reproducible scores on standard academic benchmarks |
| promptfoo | 26.7k | Dev tool | intermediate | 4 days ago | Developers building apps on top of LLM APIs who want repeatable prompt tests |
| whisper.cpp | 54.9k | Library | intermediate | 7 days ago | Developers who want to embed offline speech-to-text in a C, C++, or other native app |
| nano-vllm | 16.3k | Library | intermediate | 6 months ago | Developers who want to understand how LLM inference engines work internally |
| LoRA | 13.9k | Library | intermediate | 1.9 years ago | Machine learning engineers adapting RoBERTa, DeBERTa or GPT-2 style models in PyTorch |
| generative-ai-for-beginners | 123k | Learning resource | beginner | 5 days ago | Developers who know some Python or TypeScript and want a guided introduction to generative AI |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.