Skip to main content

Overview

Harbor organizes evaluations into two hierarchical levels:
  • Trial: A single execution of one agent on one task
  • Job: A collection of multiple trials across agents, tasks, and attempts
This structure enables efficient batch evaluation and experiment management.

Trials

A trial represents one complete attempt by an agent to solve a task.

Trial Lifecycle

Trial Phases

  1. Environment Setup: Build and start the execution environment
  2. Agent Setup: Install and configure the agent
  3. Agent Execution: Run the agent on the task
  4. Verification: Grade the agent’s solution
  5. Save Results: Persist trial results to disk
  6. Cleanup: Stop and optionally delete the environment

Trial Configuration

Trials are configured using the TrialConfig model:

Timeout Multipliers

Multipliers adjust phase-specific timeouts:
  • timeout_multiplier: Applies to all phases
  • agent_timeout_multiplier: Agent execution only
  • verifier_timeout_multiplier: Verification only
  • agent_setup_timeout_multiplier: Agent setup only
  • environment_build_timeout_multiplier: Environment build only
Multipliers are multiplicative with base timeouts from task.toml.

Trial Results

Each trial produces a TrialResult:

Timing Information

Each phase tracks start and end times:
Access timing data:

Exception Handling

When trials fail, exception details are captured:
Example:

Trial Paths

Each trial has a dedicated directory structure:

Jobs

A job orchestrates multiple trials, handling parallelization, retry logic, and result aggregation.

Job Structure

The Job class is the main entry point:

Job Configuration

Jobs are configured with JobConfig:

Running a Job

Via CLI:
Via Python API:

Trial Cartesian Product

Jobs generate trials as the cartesian product of:
  • Agents
  • Tasks
  • Attempts
Example:
  • 2 agents × 10 tasks × 3 attempts = 60 trials

Parallel Execution

Control concurrency with --n-concurrent:
This runs up to 8 trials simultaneously.
High concurrency may hit API rate limits or exhaust system resources. Start conservatively.

Job Results

Jobs produce a JobResult:

Job Statistics

The JobStats class aggregates trial results:
Stats are keyed by agent-model-dataset combinations:

Resuming Jobs

Jobs can be resumed if interrupted:
The job automatically:
  1. Loads existing trial results
  2. Identifies incomplete trials
  3. Runs only remaining trials
  4. Aggregates all results

Trial Hooks

Jobs expose lifecycle hooks for monitoring:

Available Hooks

Hook Event

Registering Hooks

All Hook Methods

Orchestrators

Orchestrators manage trial execution and parallelization:

Retry Configuration

Configure automatic retries for failed trials:

Job Directory Structure

Best Practices

  • Start with low concurrency (2-4) and increase gradually
  • Monitor API rate limits
  • Consider resource constraints (CPU, memory, network)
  • Use cloud environments for high concurrency
  • Enable retries for transient failures
  • Set appropriate retry delays
  • Limit max retries to avoid infinite loops
  • Log retry attempts for debugging
  • Use descriptive job names
  • Include timestamps in job names for organization
  • Archive completed jobs regularly
  • Document job configurations
  • Monitor jobs with hooks for real-time feedback
  • Save intermediate results frequently
  • Validate results after completion
  • Export results to analysis tools

CLI Examples

Single Agent, Multiple Tasks

Multiple Agents, Comparison

With Custom Timeouts

Resume Interrupted Job

Tasks

Task structure and configuration

Agents

Agent implementation and execution

Verifiers

Verification and grading

Metrics

Result aggregation and metrics