Skip to main content

Agent evaluation toolkit

Project description

agent-eval

A utility for evaluating agents on a suite of Inspect-formatted evals, with the following primary benefits:

  1. Task suite specifications as config.
  2. Extracts the token usage of the agent from log files, and computes cost using litellm.
  3. Submits task suite results to a leaderboard, with submission metadata and easy upload to a HuggingFace repo for distribution of scores and logs.

Installation

To install from pypi, use pip install agent-eval.

For leaderboard extras, use pip install agent-eval[leaderboard].

Usage

Run evaluation suite

agenteval eval --config-path CONFIG_PATH --split SPLIT LOG_DIR

Evaluate an agent on the supplied eval suite configuration. Results are written to agenteval.json in the log directory.

See sample-config.yml for a sample configuration file.

For aggregation in a leaderboard, each task specifies a primary_metric as {scorer_name}/{metric_name}. The scoring utils will look for a corresponding stderr metric, by looking for another metric with the same scorer_name and with a metric_name containing the string "stderr".

Weighted Macro Averaging with Tags

Tasks can be grouped using tags for computing summary statistics. The tags support weighted macro averaging, allowing you to assign different weights to tasks within a tag group.

Tags are specified as simple strings on tasks. To adjust weights for specific tag-task combinations, use the macro_average_weight_adjustments field at the split level. Tasks not specified in the adjustments default to a weight of 1.0.

See sample-config.yml for an example of the tag and weight adjustment format.

Score results

agenteval score [OPTIONS] LOG_DIR

Compute scores for the results in agenteval.json and update the file with the computed scores.

Publish scores to leaderboard

agenteval lb publish [OPTIONS] LOG_DIR

Upload the scored results to HuggingFace datasets.

View leaderboard scores

agenteval lb view [OPTIONS]

View results from the leaderboard.

To save plots:

agenteval lb view --save-dir DIR [OPTIONS]

Administer the leaderboard

Prior to publishing scores, two HuggingFace datasets should be set up, one for full submissions and one for results files.

If you want to call load_dataset() on the results dataset (e.g., for populating a leaderboard), you probably want to explicitly tell HuggingFace about the schema and dataset structure (otherwise, HuggingFace may fail to propertly auto-convert to Parquet). This is done by updating the configs attribute in the YAML metadata block at the top of the README.md file at the root of the results dataset (the metadata block is identified by lines with just --- above and below it). This attribute should contain a list of configs, each of which specifies the schema (under the features key) and dataset structure (under the data_files key). See sample-config-hf-readme-metadata.yml for a sample metadata block corresponding to sample-comfig.yml (note that the metadata references the raw schema data, which must be copied).

To facilitate initializing new configs, agenteval lb publish will automatically add this metadata if it is missing.

Development

See Development.md for development instructions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_eval-0.1.37.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_eval-0.1.37-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_eval-0.1.37.tar.gz.

File metadata

  • Download URL: agent_eval-0.1.37.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for agent_eval-0.1.37.tar.gz
Algorithm Hash digest
SHA256 176ef94e13e54ccbda53e507edb018cc18c2b5f57f4038d7777efd6690a140fc
MD5 87e7f2322daee0ce1498dd37e122a4bb
BLAKE2b-256 088a1955e4bafa65a274cd285f5ba53d7cc911f1a14c2913085d79318600a3ef

See more details on using hashes here.

File details

Details for the file agent_eval-0.1.37-py3-none-any.whl.

File metadata

  • Download URL: agent_eval-0.1.37-py3-none-any.whl
  • Upload date:
  • Size: 40.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for agent_eval-0.1.37-py3-none-any.whl
Algorithm Hash digest
SHA256 c1e23a2ca51449a577df146386403af79cfef815b9835403f72d1e55771ce0a3
MD5 bf9a0b4eb6ea46371a0b285eccf511bb
BLAKE2b-256 5b5a5bcd0501fc5c508aed699862d141cfa4a54115ef49faf265c642ab410292

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page