Skip to main content

Configuration

Experiment configuration lives in a hive.yaml file that you pass explicitly to hive create exp -c hive.yaml.

Field reference

Below, we document the fields that can be specified in a configuration YAML.

Top level fields

  • apiversion (string, default: v1alpha1)
    Configuration schema version.
  • experiment_name (string, required)
    Name of the experiment. Must be a valid DNS label ([a-z0-9-], max 63 characters, no leading -). If it ends with -, a random suffix is appended for uniqueness.

repo

Repository configuration for the experiment source code.
  • source (string)
    Where the experiment source code comes from. Can be:
    • A remote git URL — https://, ssh://, or git@.
    • A local directory path (absolute or relative; ~ and environment variables are expanded). The directory is uploaded directly, so you can run experiments on uncommitted local changes.
    If omitted (null), no source is uploaded — the base image must already contain the code at the sandbox workdir.
  • files (list of strings, default: [])
    Files and directories to include from source. An empty list includes everything. Patterns are applied in order; prefix an entry with ! to exclude. Globs (*, ?, […]) are supported. Hidden files and symlinks are skipped.
  • branch (string, default: main)
    Branch to use when cloning a remote source.
  • evaluation_script (string, default: evaluation.py)
    Script that evaluates experiment results (path relative to repo root).
  • evaluation_arguments (list, default: [])
    Splits the evaluation into a multi-evaluator, with one entry per evaluator. Each entry is passed to evaluation_script as its command-line arguments. Write a single value for one argument, or a list for several. Requires aggregation_script.
  • aggregation_script (string, default: null)
    Script that combines the per-evaluator results into the experiment’s final result. Only valid together with evaluation_arguments. See multi-evaluator.
  • target_code (list of strings, default: [])
    Code for agents to evolve. Must be a YAML list — see file list syntax.
    An empty list allows the Hive to evolve any file in the specified codebase (except for the evaluation script). Prefix an entry ! to exclude it from evolution, e.g.,
    allows the Hive to evolve any file except for fixed.py and the evaluation script.
  • additional_context (list of strings, default: [])
    Additional files to include as context. Must be a YAML list — see file list syntax.
The clone happens client-side. For private repos, consider using SSH (e.g. git@github.com:<org>/<repo>.git).

File list syntax

The target_code and additional_context fields must be YAML lists. Each entry is a file path with an optional line range:

Multi-evaluator

By default a single evaluator produces the fitness. Setting evaluation_arguments splits the evaluation into several sub-evaluators that run concurrently on the available sandboxes, and an aggregation_script combines their results. This is useful when the objective decomposes into independent pieces (e.g. slices of a dataset, or several benchmarks) that can be scored in parallel.
One reason to reach for a multi-evaluator is GPU provisioning. A single large allocation such as a100-80gb:8 is far slower to schedule than eight separate a100-80gb:1 sandboxes. Splitting the evaluation across many small single-GPU sandboxes provisions much faster than requesting one big multi-GPU sandbox.
How it works:
  1. For each entry in evaluation_arguments, the Hive runs evaluation_script with those arguments. Each sub-evaluator emits the usual final-line JSON: {"status": "success", "result": {"fitness": ...}} on success, or {"status": "failed", "error": ...} on failure.
  2. The aggregation_script receives a single argument: the path to a JSON file holding the list of per-evaluator results, in evaluation_arguments order. Failed evaluators appear in that list too, so the aggregator must check each status field.
  3. The aggregation script’s own output follows the same contract as evaluation_script, and its fitness becomes the experiment’s fitness.
A typical aggregation script looks something like:
The sub-evaluators run in parallel across sandboxes, so set runtime.num_sandboxes high enough to realise the parallelism. A good rule of thumb is one sandbox per sub-evaluation times the number of parallel sub-evaluations.

runtime

Controls experiment execution.
  • num_sandboxes (integer, default: 1)
    Number of parallel sandboxes to run. (Formerly num_agents, now deprecated but still accepted.)
  • max_runtime_seconds (integer, default: -1)
    Maximum execution time in seconds. -1 = unlimited.
  • max_iterations (integer, default: -1)
    Maximum iterations per agent. -1 = unlimited.
  • stochastic_evaluator (boolean, default: false)
    Whether the evaluator is stochastic. When true, the Hive accounts for evaluation noise by re-evaluating high-variance candidates so fitnesses can be compared reliably.

sandbox

Container environment configuration.
  • base_image (string, required)
    Docker base image (e.g. python:3.14-slim).
  • workdir (string, default: /app)
    Working directory inside the container.
  • setup_script (string, default: null)
    Shell script to run before the experiment starts (e.g. install dependencies). Omit or set to null if no setup is needed.
  • evaluation_timeout (integer, default: 60)
    Maximum time (seconds) for the evaluation script to run.
  • envs (list)
    Environment variables to set in the container. Each entry has a name and value:
  • services (list)
    Sidecar services to run alongside the sandbox. See sandbox.services below.

sandbox.resources

  • cpu (string, default: "1")
    CPU limit (e.g. "2", "500m").
  • memory (string, default: "2Gi")
    Memory limit (e.g. "4Gi", "512Mi").
  • accelerators (string)
    GPU resources (e.g. a100-80gb:8).
  • shmsize (string)
    Size of /dev/shm (e.g. "1Gi"). This is only supported if accelerators is unspecified, or if an AWS accelerator is specified.

sandbox.services[]

Each entry defines a sidecar container that runs alongside the sandbox.
  • name (string, required)
    Service name.
  • image (string, required)
    Docker image for the service.
  • ports (list)
    Ports to expose. Each entry has a port (integer) and optional protocol (TCP or UDP, defaults to TCP).
  • envs (list)
    Environment variables (same format as sandbox.envs).
  • command (list of strings)
    Container entrypoint override.
  • args (list of strings)
    Arguments to the entrypoint.
  • resources.cpu (string, default: "1")
    CPU limit for this service.
  • resources.memory (string, default: "2Gi")
    Memory limit for this service.

provider.regions

  • regions (string or list of strings, default: us)
    Where the sandboxes run, and so where the experiment’s code and data are processed: us for only the US region, or all for every region. Setting all may help with GPU availability, since sandboxes can land on capacity in any region. Only set all if your code and data may leave the US.

prompt

Optional prompt configuration for the Hive agents. Omit this section entirely to use defaults.
  • context (string)
    Experiment-specific context to provide to agents.
  • ideas (list of strings)
    Ideas that will be randomly sampled and injected into the Hive.
  • attachments (list of strings, default: null) PDF reference material for agents. Accepts local PDF files, local directories, and PDF URLs.

PDF attachments

PDFs provide reference material for agents and are not included in candidate code.
Relative paths resolve from the directory where you run hive. Directories are searched recursively for PDFs. Each PDF can be up to 20 MiB. URLs must return a PDF. The CLI validates attachments before creating the experiment.

agents

Which agents generate new versions of your code. Omit this section to run the default preset, medium-effort. You can either specify a preset agent configuration, or choose a custom weighted list of models yourself.
  • preset (string)
    A preset tier of agents, by name. One of low-effort, medium-effort, or high-effort.
  • models (list)
    A custom ensemble of models. Each entry takes:
    • model (string, required) — The model to run. Run hive list models to see the names.
    • weight (float, default: 1) — How likely the model is to be used, relative to the rest of the ensemble. Must be greater than 0.
hive get exp <name> reports the ensemble an experiment was created with.

Full example

hive.yaml

Next steps

Managing experiments

Create, monitor, and manage your Hive experiments.