Awesome
<p align="center"> <br/> <img alt="lighteval library logo" src="./assets/lighteval-doc.svg" width="376" height="59" style="max-width: 100%;"> <br/> </p> <p align="center"> <i>Your go-to toolkit for lightning-fast, flexible LLM evaluation, from Hugging Face's Leaderboard and Evals Team.</i> </p> <div align="center"> </div>Documentation: <a href="https://github.com/huggingface/lighteval/wiki" target="_blank">Lighteval's Wiki</a>
Unlock the Power of LLM Evaluation with Lighteval ๐
Lighteval is your all-in-one toolkit for evaluating LLMs across multiple backendsโwhether it's transformers, tgi, vllm, or nanotronโwith ease. Dive deep into your modelโs performance by saving and exploring detailed, sample-by-sample results to debug and see how your models stack-up.
Customization at your fingertips: letting you either browse all our existing tasks and metrics or effortlessly create your own, tailored to your needs.
Seamlessly experiment, benchmark, and store your results on the Hugging Face Hub, S3, or locally.
๐ Key Features
- Speed: Use vllm as backend for fast evals.
- Completeness: Use the accelerate backend to launch any models hosted on Hugging Face.
- Seamless Storage: Save results in S3 or Hugging Face Datasets.
- Python API: Simple integration with the Python API.
- Custom Tasks: Easily add custom tasks.
- Versatility: Tons of metrics and tasks ready to go.
โก๏ธ Installation
pip install lighteval
Lighteval allows for many extras when installing, see here for a complete list.
If you want to push results to the Hugging Face Hub, add your access token as an environment variable:
huggingface-cli login
๐ Quickstart
Lighteval offers two main entry points for model evaluation:
lighteval accelerate
: evaluate models on CPU or one or more GPUs using ๐ค Acceleratelighteval nanotron
: evaluate models in distributed settings using โก๏ธ Nanotronlighteval vllm
: evaluate models on one or more GPUs using ๐ VLLMlighteval endpoint
inference-endpoint
: evaluate models on one or more GPUs using ๐ Inference Endpointtgi
: evaluate models on one or more GPUs using ๐ Text Generation Inferenceopenai
: evaluate models on one or more GPUs using ๐ OpenAI API
Hereโs a quick command to evaluate using the Accelerate backend:
lighteval accelerate \
"pretrained=gpt2" \
"leaderboard|truthfulqa:mc|0|0"
๐ Acknowledgements
Lighteval started as an extension of the fantastic Eleuther AI Harness (which powers the Open LLM Leaderboard) and draws inspiration from the amazing HELM framework.
While evolving Lighteval into its own standalone tool, we are grateful to the Harness and HELM teams for their pioneering work on LLM evaluations.
๐ Contributions Welcome ๐๐๐๐๐งก
Got ideas? Found a bug? Want to add a task or metric? Contributions are warmly welcomed!
If you're adding a new feature, please open an issue first.
If you open a PR, don't forget to run the styling!
pip install -e .[dev]
pre-commit install
pre-commit run --all-files
๐ Citation
@misc{lighteval,
author = {Fourrier, Clรฉmentine and Habib, Nathan and Wolf, Thomas and Tunstall, Lewis},
title = {LightEval: A lightweight framework for LLM evaluation},
year = {2023},
version = {0.5.0},
url = {https://github.com/huggingface/lighteval}
}