Skip to main content
When running benchmarks, it can be helpful to manage them using the Phylo API. This example uses BiomniBench-DA task da-18-7, then starts a second Biomni task to score the result. In a dev run, the benchmark took about 8 minutes, the judge took about 3 minutes, and the full script took about 11 minutes. This recipe launches two Biomni tasks for the benchmark:
  1. The first task runs the BiomniBench-DA task
  2. The second task grades the results from the first BiomniBench-DA task

Prerequisites

  • An API key
  • Python 3.10 or later with the requests package
Install requests, then set your API key:
The script uses https://api.phylo.bio/v1. If you’re an Enterprise customer, set PHYLO_BASE_URL environment variable to the API base URL shared by your Phylo representative.

Run the benchmark

1

Set up a Python client

For the purposes of this recipe, we’ll use the Python client recipe. Open Building a Python client, save the client as phylo_client.py, and place it in the directory where you will run the benchmark. The benchmark imports PhyloClient from that file.
2

Create the benchmark script

Save this script – which includes prompts for the benchmark and scoring – as benchmark.py beside phylo_client.py:
benchmark.py
3

Run the script

Run the benchmark from the directory containing both Python files:
The script downloads the public cBioPortal study archive, then stages and uploads three benchmark files totaling about 4.8 MB. The first task runs the BiomniBench-DA task, and the second task grades its results. Candidate output is saved under benchmark-results/<task-id>/; judge output is saved in its judge/ subdirectory.

Adapting this for your benchmark

To adapt this to your benchmark, you can either:
  1. Replace PROMPT and JUDGE_PROMPT with your benchmark prompt and rubric.
  2. Use this as a base for a larger distributed benchmark.
If you choose to launch multiple benchmark tasks at once, you may hit the limits for your account. These will be reflected as 429 errors from either the Phylo API or internal tools used by the Biomni agent, such as tasks spawned on the HPC. If you encounter these errors, limit the number of tasks you start with the Phylo API. Happy benchmarking!