Configuration
Experiment configuration lives in ahive.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://, orgit@. - 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.
null), no source is uploaded — the base image must already contain the code at the sandboxworkdir. - A remote git URL —
-
files(list of strings, default:[])
Files and directories to include fromsource. 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 toevaluation_scriptas its command-line arguments. Write a single value for one argument, or a list for several. Requiresaggregation_script. -
aggregation_script(string, default:null)
Script that combines the per-evaluator results into the experiment’s final result, and the test evaluator results into the test result. Only valid together withevaluation_argumentsortest_evaluation_arguments. See multi-evaluator. -
test_evaluation_arguments(list, default:null)
Defines a held-out test set using the same format and execution model as evaluation_arguments. Versions which the Hive found during evolution are also evaluated on this test set, but test fitness is for reporting only and doesn’t affect evolution. If you provide multiple entries, you must also setaggregation_script. See held-out evaluation. -
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 forfixed.pyand 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
Thetarget_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. Settingevaluation_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.
How it works:
- For each entry in
evaluation_arguments, the Hive runsevaluation_scriptwith those arguments. Each sub-evaluator emits the usual final-line JSON:{"status": "success", "result": {"fitness": ...}}on success, or{"status": "failed", "error": ...}on failure. - The
aggregation_scriptreceives a single argument: the path to a JSON file holding the list of per-evaluator results, inevaluation_argumentsorder. Failed evaluators appear in that list too, so the aggregator must check eachstatusfield. - The aggregation script’s own output follows the same contract as
evaluation_script, and itsfitnessbecomes the experiment’s fitness.
The sub-evaluators run in parallel across sandboxes, so set
runtime.num_sandboxes
high enough to realize the parallelism. A good rule of thumb is one sandbox per
sub-evaluation times the number of parallel sub-evaluations.Held-out evaluation (experimental)
Evolution optimizes whatever your evaluator measures. When that’s a sample of a wider set of inputs (a set of problem instances, a dataset split, a suite of scenarios), the evolution can overfit to the sample: versions get better on those exact inputs without getting better in general. Settingtest_evaluation_arguments gives the experiment a held-out test set. As the evolution runs, the Hive picks some of the versions it has found (always including the most promising ones, plus a spread across the fitness range) and scores them on the held-out test set too, reporting that test fitness next to their fitness. The test fitness never guides the evolution: it isn’t used to pick parents, rank versions or write prompts, so it tells you two things:
- Generalization: whether the evolved code improves on inputs it was never optimized for.
- Evaluator quality: whether your evaluation is a good proxy, i.e. whether a better fitness actually means a better test fitness.
- Each entry in
test_evaluation_argumentsrunsevaluation_scriptwith those arguments, exactly like an entry inevaluation_arguments, and emits the same final-line JSON. - With a single entry, its
fitnessis the test fitness. With several, theaggregation_scriptcombines them into one test result, just as it does for the multi-evaluator. - Test evaluations share the experiment’s sandboxes. Use
test_evaluation_configto choose how many, and how the versions to test are picked.
Held-out evaluation is experimental.
runtime
Controls experiment execution.
-
num_sandboxes(integer, default:1)
Number of parallel sandboxes to run. (Formerlynum_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 number of iterations for the experiment.-1= unlimited. -
stochastic_evaluator(boolean, default:false)
Whether the evaluator is stochastic. Whentrue, the Hive accounts for evaluation noise by re-evaluating high-variance candidates so fitnesses can be compared reliably.
test_evaluation_config
How the held-out test set is evaluated. Only valid together with repo.test_evaluation_arguments — see held-out evaluation.
-
num_test_sandboxes(integer, default: 20% ofruntime.num_sandboxes)
Number of sandboxes given to test evaluation, at mostruntime.num_sandboxes. Each test evaluation holds one sandbox pertest_evaluation_argumentsentry. -
greedy_fraction(float, default:0.5)
Share of test evaluations spent on the best untested version, between0and1. The rest are spread across the fitness range.
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 tonullif 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 anameandvalue: -
services(list)
Sidecar services to run alongside the sandbox. Seesandbox.servicesbelow. -
cpu_consistency(string, default:none)
Whether every sandbox runs on the same CPU platform. Use this when your score depends on how fast the code runs.required: every sandbox runs on one platform, and waits for capacity on it.preferred: sandboxes run on one platform when it has capacity, and on others when it doesn’t.none: sandboxes run on any platform.
sandbox.resources
-
cpu(string, default:"1")
CPU limit (e.g."2","500m"). -
cpu_platform(string)
CPU platform every sandbox runs on. Setting it impliescpu_consistency: required, so leavecpu_consistencyunset or set it torequired. You can’t set it together withaccelerators, because the GPU instance type decides the CPU. -
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"). You can’t set it together withaccelerators. Data in/dev/shmcounts toward the sandbox’smemorylimit, so setmemorylarge enough to hold it.
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 aport(integer) and optionalprotocol(TCPorUDP, defaults toTCP). -
envs(list)
Environment variables (same format assandbox.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:usfor only the US region, orallfor every region. Settingallmay help with GPU availability, since sandboxes can land on capacity in any region. Only setallif 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.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 oflow-effort,medium-effort, orhigh-effort. -
models(list)
A custom ensemble of models. Each entry takes:model(string, required) — The model to run. Runhive list modelsto 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 list models:
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.