evals README

The project's README from github.com/openai/evals. As one markdown file: README.md.

OpenAI Evals

You can now configure and run Evals directly in the OpenAI Dashboard. Get started →

Evals provide a framework for evaluating large language models (LLMs) or systems built using LLMs. We offer an existing registry of evals to test different dimensions of OpenAI models and the ability to write your own custom evals for use cases you care about. You can also use your data to build private evals which represent the common LLMs patterns in your workflow without exposing any of that data publicly.

If you are building with LLMs, creating high quality evals is one of the most impactful things you can do. Without evals, it can be very difficult and time intensive to understand how different model versions might affect your use case. In the words of OpenAI's President Greg Brockman:

https://x.com/gdb/status/1733553161884127435?s=20

Setup

To run evals, you will need to set up and specify your OpenAI API key. After you obtain an API key, specify it using the OPENAI_API_KEY environment variable. Please be aware of the costs associated with using the API when running evals. You can also run and create evals using Weights & Biases.

Minimum Required Version: Python 3.9

Downloading evals

Our evals registry is stored using Git-LFS. Once you have downloaded and installed LFS, you can fetch the evals (from within your local copy of the evals repo) with:

cd evals
git lfs fetch --all
git lfs pull

This will populate all the pointer files under evals/registry/data.

You may just want to fetch data for a select eval. You can achieve this via:

git lfs fetch --include=evals/registry/data/${your eval}
git lfs pull

Making evals

If you are going to be creating evals, we suggest cloning this repo directly from GitHub and installing the requirements using the following command:

pip install -e .

Using -e, changes you make to your eval will be reflected immediately without having to reinstall.

Optionally, you can install the formatters for pre-committing with:

pip install -e .[formatters]

Then run pre-commit install to install pre-commit into your git hooks. pre-commit will now run on every commit.

If you want to manually run all pre-commit hooks on a repository, run pre-commit run --all-files. To run individual hooks use pre-commit run <hook_id>.

Running evals

If you don't want to contribute new evals, but simply want to run them locally, you can install the evals package via pip:

pip install evals

You can find the full instructions to run existing evals in run-evals.md and our existing eval templates in eval-templates.md. For more advanced use cases like prompt chains or tool-using agents, you can use our Completion Function Protocol.

We provide the option for you to log your eval results to a Snowflake database, if you have one or wish to set one up. For this option, you will further have to specify the SNOWFLAKE_ACCOUNT, SNOWFLAKE_DATABASE, SNOWFLAKE_USERNAME, and SNOWFLAKE_PASSWORD environment variables.

Writing evals

We suggest getting starting by:

Please note that we are currently not accepting evals with custom code! While we ask you to not submit such evals at the moment, you can still submit model-graded evals with custom model-graded YAML files.

If you think you have an interesting eval, please open a pull request with your contribution. OpenAI staff actively review these evals when considering improvements to upcoming models.

FAQ

Do you have any examples of how to build an eval from start to finish?

Do you have any examples of evals implemented in multiple different ways?

When I run an eval, it sometimes hangs at the very end (after the final report). What's going on?

There's a lot of code, and I just want to spin up a quick eval. Help? OR,

I am a world-class prompt engineer. I choose not to code. How can I contribute my wisdom?

Disclaimer

By contributing to evals, you are agreeing to make your evaluation logic and data under the same MIT license as this repository. You must have adequate rights to upload any data used in an eval. OpenAI reserves the right to use this data in future service improvements to our product. Contributions to OpenAI evals will be subject to our usual Usage Policies: https://platform.openai.com/docs/usage-policies.

evals (openai/evals)

Searching Database…

19.6K ·GitHub
这是什么?Evals 是 OpenAI 推出的框架,用于评测大语言模型(LLM)及基于 LLM 构建的系统,同时附带一个开源的基准测试注册表,你可以直接运行其中的测试,也可以对其进行扩展。
它是我要导入的库,还是我要在命令行中运行的工具?它是一个通过 pip 安装的 Python 包,你可以在命令行中运行它,对模型执行评测。
我怎样运行一个现有的评测?先用 pip 安装该包,然后按照 run-evals.md 中的说明,运行 eval-templates.md 中列出的某个现有评测模板。
使用它需要 OpenAI 的 API 密钥吗?文档中没有明确说明,但由于它用于评测 OpenAI 的模型,你需要有 API 访问权限;另外,可以配置一个可选的 Snowflake 数据库,用于记录结果。
我能用自己的数据创建私有评测吗?可以,你可以使用自己的数据创建私有评测,来体现你工作流中常见的 LLM 使用模式,而无需将这些数据公开。
什么是 Completion Function Protocol?它是 Evals 支持的一种机制,适用于提示链或使用工具的智能体等更高级的场景,超出了简单的单次调用评测。
在编写自己的评测之前,在哪里可以看到示例?examples 文件夹中包含完整的示例,evals/registry/evals/coqa.yaml 则展示了如何用多种不同的评测模板实现同一个数据集。
OpenAI 真的会查看社区提交的评测吗?会的,OpenAI 工作人员会积极审查通过 Pull Request 提交的评测,以便在考虑改进即将推出的模型时加以参考。
Creator
openai
Size
6.5 MB
Stars
19.6K
Updated
CommitApr 14
Age
3y
Commits · 90 Days