SuperAPI AI Directory

evals

An open-source library for evaluating task performance of language models and prompts.

Open website

About this tool

Evals is a framework for evaluating large language models (LLMs) and systems built on top of LLMs, and it is also an open-source eval benchmark registry. Its main purpose is to help developers measure model performance on specific tasks and compare the impact of different model versions on their own use cases.

Main capabilities:

  • Provides an existing eval registry for testing different dimensions of OpenAI models.
  • Supports writing custom evals to cover specific use cases that users care about.
  • Supports building private evals with your own data, reflecting common LLM patterns in workflows, without disclosing any data.
  • Supports configuring and running Evals directly in the OpenAI Dashboard.
  • Supports running and creating evals through Weights & Biases.
  • Supports logging eval results to a Snowflake database (requires providing the corresponding environment variables).
  • Provides the Completion Function Protocol, suitable for more advanced use cases such as prompt chains or tool-using agents.

How to use: Running evals requires setting and specifying an OpenAI API key, specified through the OPENAI_API_KEY environment variable. Please note that using the API when running evals will incur corresponding costs. The minimum required Python version is 3.9.

Downloading evals: The eval registry uses Git-LFS for storage. After installing LFS, you can pull the eval data in the local evals repository and populate the pointer files under evals/registry/data; you can also fetch only the data for selected evals.

Creating evals: It is recommended to clone the repository directly from GitHub and install the dependencies with the specified command (using -e makes changes take effect immediately). Optionally install the pre-commit formatting tool and run pre-commit install to install pre-commit into git hooks, after which it will run on every commit.

Local-only running: If you do not want to contribute new evals and only want to run them locally, you can install the evals package via pip. Complete instructions for running existing evals are in run-evals.md, and existing eval templates are in eval-templates.md.

Contributing evals via templates: If you build basic evals or model-graded evals by following the existing eval templates, then you do not need to write any evaluation code; you only need to provide JSON-format data and specify eval parameters in YAML; build-eval.md provides step-by-step instructions, and the Jupyter notebooks in the examples folder can help you get started quickly.

Applicable scenarios:

  • When building LLM applications, you need to create high-quality evals to understand the impact of model version changes on your use case.
  • You want to build private evals with your own data without disclosing the data.
  • You want to contribute evals via templates without writing custom code (evals containing custom code are currently not accepted, but model-graded evals with custom model grading YAML files can be submitted).

Limitations and notes:

  • Running evals requires you to bear the API usage costs yourself.
  • Submissions of evals containing custom code are currently not accepted.
  • Known issue: evals sometimes hang after the final report; it is safe to interrupt, and the eval should complete immediately afterward.
  • By contributing evals, you agree to release the eval logic and data under the MIT license; you must have sufficient rights to upload the data; OpenAI reserves the right to use the data in future service improvements; contributions are subject to the OpenAI usage policies.

More getting-started suggestions: You can refer to build-eval.md to go through the process of building an eval, custom-eval.md to see examples of implementing custom eval logic, completion-fns.md to write your own completion functions, and the Getting Started with OpenAI Evals guide to get started.