Skip to main content

Submit predictions to the SWE-bench API and manage your runs

Project description

SWE-bench CLI Logo

SWE-bench CLI

A command-line interface for interacting with the SWE-bench API. Use this tool to submit predictions, manage runs, and retrieve evaluation reports.

Read the full documentation here.

Installation

pip install sb-cli

Authentication

Before using the CLI, you'll need to get an API key:

  1. Generate an API key:
sb-cli gen-api-key your.email@example.com
  1. Set your API key as an environment variable - and store it somewhere safe!
export SWEBENCH_API_KEY=your_api_key
# or add export SWEBENCH_API_KEY=your_api_key to your .*rc file
  1. You'll receive an email with a verification code. Verify your API key:
sb-cli verify-api-key YOUR_VERIFICATION_CODE

Subsets and Splits

SWE-bench has different subsets and splits available:

Subsets

  • swe-bench-m: The main dataset
  • swe-bench_lite: A smaller subset for testing and development
  • swe-bench_verified: 500 verified problems from SWE-bench Learn more

Splits

  • dev: Development/validation split
  • test: Test split (currently only available for swe-bench_lite and swe-bench_verified)

You'll need to specify both a subset and split for most commands.

Usage

Submit Predictions

Submit your model's predictions to SWE-bench:

sb-cli submit swe-bench-m test \
    --predictions_path predictions.json \
    --run_id my_run_id

Options:

  • --run_id: ID of the run to submit predictions for (optional, defaults to the name of the parent directory of the predictions file)
  • --instance_ids: Comma-separated list of specific instance IDs to submit (optional)
  • --output_dir: Directory to save report files (default: sb-cli-reports)
  • --overwrite: Overwrite existing report (default: 0)
  • --gen_report: Generate a report after evaluation is complete (default: 1)

Get Report

Retrieve evaluation results for a specific run:

sb-cli get-report swe-bench-m dev my_run_id -o ./reports

List Runs

View all your existing run IDs for a specific subset and split:

sb-cli list-runs swe-bench-m dev

Predictions File Format

Your predictions file should be a JSON file in one of these formats:

{
    "instance_id_1": {
        "model_patch": "...",
        "model_name_or_path": "..."
    },
    "instance_id_2": {
        "model_patch": "...",
        "model_name_or_path": "..."
    }
}

Or as a list:

[
    {
        "instance_id": "instance_id_1",
        "model_patch": "...",
        "model_name_or_path": "..."
    },
    {
        "instance_id": "instance_id_2",
        "model_patch": "...",
        "model_name_or_path": "..."
    }
]

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

sb_cli-0.1.1.tar.gz (185.5 kB view details)

Uploaded Source

Built Distribution

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

sb_cli-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file sb_cli-0.1.1.tar.gz.

File metadata

  • Download URL: sb_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 185.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for sb_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 39a95085bc426eaa4b47b3b808496bcab0752b1ea7b10bec82f2ee9cd939fa9e
MD5 e5df514bbde6d6b67203aba545e496c2
BLAKE2b-256 0b9eb005296e1511aa291ab19a6ecc692cdb8ab7a1e6b4e15a1c35f87d387323

See more details on using hashes here.

File details

Details for the file sb_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sb_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for sb_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff1ec94c13ca40ed686304ce6bdb86b60b9d0496e9ce0a789f2ee84b907cf32
MD5 b728a0640bb0cc709341415fa07a414b
BLAKE2b-256 c1fcdc1cb4d6dbbe916f5088ee4695a3d486b573b17cc3840b3fbafd224e1f52

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