Skip to main content

benchmax

benchmax envs is where you define datasets, how to execute the rollout, and scoring each rollout.

for installation and project setup, start with the main readme. working environments live in examples/.

choose an environment

all benchmax environments implement the same dataset and rollout contracts. choose the adapter based on who owns the agent loop:

environment use it when what it provides
BaseEnv default environment to extend - runs a simple loop with the option to make tool calls chat completions, tool dispatch, turn limits, and reward hooks
HarborEnv you already have a Harbor task or harness Harbor agents, sandboxes, verifiers, and RewardKit integration
Environment extend Environment if you need custom behavior not covered by BaseEnv and HarborEnv the fundamental dataset, group execution, and outcome contracts

most custom environments should extend BaseEnv. most Harbor users configure HarborEnv directly rather than subclassing it.

sft datasets

supervised finetuning does not use an environment. construct a validated benchmax.sft.SftDataset from chat-format rows and upload it through the castform package; validation is strict and all-or-nothing.

architecture

an environment defines its dataset and how a group of rollouts runs against each example.

Environment
├── create_dataset(split, base_dir, max_examples)
│   └── Dataset
│       └── Example(id, payload)
└── run_group(requests)
    ├── run_rollout(request) × group_size → RolloutAttempt × group_size
    ├── adapter-specific scoring
    ├── optional group-relative scoring
    └── RolloutOutcome(rewards, termination_reason, error)

every environment follows this shape. the environment decides what an example contains, how each attempt runs, which tools are available, and how the result is scored.

datasets

create_dataset receives a train or eval split and returns a fixed, ordered Dataset of Example objects.

each example contains:

  • a stable id used to identify the datapoint across runs;
  • an environment-owned payload consumed by its rollout implementation.

the optional max_examples argument limits how many examples are returned. when the data source supports it, the environment should stop loading once it reaches that limit.

JsonlDataset, Harbor datasets, and custom datasets all produce the same fundamental Dataset type. the trainer and validation flow do not depend on the source file format.

tools

BaseEnv exposes OpenAI-compatible function tools through list_tools and executes them through run_tool. an environment can provide no tools, one tool, or a collection of stateful tools.

with HarborEnv, the Harbor agent and harness define the available tools and how they interact with the sandbox. benchmax does not convert Harbor tools into BaseEnv tools.

execution and scoring

run_group receives multiple rollout requests for the same example, runs them concurrently, waits for all siblings, and returns one RolloutOutcome for each request.

successful scoring hooks return their named reward components. operational failures return no rewards and do not cancel successful siblings; the trainer treats absent components as zero. partial attempts that reach a context, output, turn, or tool limit can still be scored.

  • BaseEnv runs the model and tool loop, then passes the transcript and example payload to compute_reward. compute_group_rewards can score the completed sibling group.
  • HarborEnv runs the configured Harbor agent and sandbox, then preserves its verifier or RewardKit reward components.

helpers

benchmax.rewards provides deterministic text helpers, model judges, rubrics, ranking, adaptive rubrics, and diversity scoring for BaseEnv and direct Environment implementations. see the rewards guide.

Harbor environments normally use their harness verifier and RewardKit instead of benchmax reward helpers.

bundling

a bundle contains the environment class, its constructor arguments, the project-local source it needs, and its declared remote dependencies.

environment class + constructor arguments
                 + local source
                 + dependency metadata
                           │
                           ▼
                    portable bundle

benchmax creates the portable artifact so the same environment can be loaded outside the author's checkout. castform handles uploading the bundle, validating it remotely, and using it for training.

Remote runtimes install pip_dependencies without enabling prereleases globally. If a dependency graph needs a prerelease, list that package explicitly even when it would normally be transitive. For example, use pip_dependencies=["parent-package==1.0.0", "transitive-package==2.0.0rc1"].

further reading

apache 2.0 © 2026 CGFT Inc.

Download files

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

Source Distribution

benchmax-0.2.4.tar.gz (127.5 kB view details)

Uploaded Source

Built Distribution

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

benchmax-0.2.4-py3-none-any.whl (100.2 kB view details)

Uploaded Python 3

File details

Details for the file benchmax-0.2.4.tar.gz.

File metadata

  • Download URL: benchmax-0.2.4.tar.gz
  • Upload date:
  • Size: 127.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchmax-0.2.4.tar.gz
Algorithm Hash digest
SHA256 df4107f8817bb4027e35e624df7723df63aad88f0b8f767b33b0e1caed7d2316
MD5 0ecf7946147aea0c7ce1637a3928a20b
BLAKE2b-256 bc17cf7d6ffaff0860cda4c35f46df7a4846aa515b653306d7de8edc58ca2fe3

See more details on using hashes here.

File details

Details for the file benchmax-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: benchmax-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 100.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchmax-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5c9c55fa01bfe1413d09f94af5ab11eb6a2b7f91ec5c077cb01bc85c1ae70afe
MD5 645370877ac80617e0da7ff903a2d011
BLAKE2b-256 068aabd66ee150c02cfcbf4eacb74682227a78bdb1176f1daad8b5fdc8f328e5

See more details on using hashes here.

Release history Release notifications | RSS feed

Supported by

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