Skip to main content

Platform-independent runtime for grouped LLM environments

Project description

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.

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.

further reading

apache 2.0 © 2026 CGFT Inc.

Project details


Release history Release notifications | RSS feed

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.2.dev0.tar.gz (93.2 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.2.dev0-py3-none-any.whl (75.0 kB view details)

Uploaded Python 3

File details

Details for the file benchmax-0.2.2.dev0.tar.gz.

File metadata

  • Download URL: benchmax-0.2.2.dev0.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.2.dev0.tar.gz
Algorithm Hash digest
SHA256 a9b946f22efcc1daddd199999ce1e61e41877256fd46518420daeedc5db496b9
MD5 ac87dcaf4c17f7c313761dfb45388dd9
BLAKE2b-256 dedc24d5e41f44db26e7945ff1fb27c1afa2e2587293e016e9f3defe06a63afc

See more details on using hashes here.

File details

Details for the file benchmax-0.2.2.dev0-py3-none-any.whl.

File metadata

  • Download URL: benchmax-0.2.2.dev0-py3-none-any.whl
  • Upload date:
  • Size: 75.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 99514e434c514915fd0b0e5143fc2be612ab59a772c34d75d8cdfc1551fd75ef
MD5 1470f0517f8cdbed63317d278838d4b8
BLAKE2b-256 7e92fdcca8858f3ac65d452e52d38d4125c7ed5851e885051b589b84c33f454f

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