Skip to content

Commit 41de354

Browse files
authored
Add AgentBoard BabyAI environment (#32)
## Summary Add a self-contained AgentBoard BabyAI environment using the native Verifiers 0.4 taskset and environment APIs. - Bundle the text-game runtime, prompt, and 112 annotated episodes; no AgentBoard checkout is needed. - Preserve the existing deterministic 84/28 train/eval split across 28 task families, progress reward, action parsing, and grounding/success metrics. - Include a portable Prime Inference evaluation configuration and concise setup instructions. - Include upstream attribution and the separate runtime/prompt (Apache 2.0) and annotation (GPL 2.0) licenses. Published environment: [bhoy1/agentboard-babyai, version 0.3.0](https://app.primeintellect.ai/dashboard/environments/bhoy1/agentboard-babyai). ## Verification - Scoped pre-commit checks: Ruff lint/format, Markdown formatting/lint, and Git LFS checks all passed. - Repository package checks: 2 passed, including package build. - Existing external regression suite: 23 passed and 1 optional upstream comparison skipped. Includes 38 golden trajectory replays, all 112 initial observations, turn-limit behavior, concurrent rollout isolation, and cleanup. - Real Prime Inference evaluation from this contribution: Qwen3.5-9B, 1 held-out task with 2 rollouts, thinking disabled, 20 turns, 1,024-token output budget. Both completed without harness errors, with reward 0.25 and stop condition `max_turns`. The contribution's [evaluation run](https://app.primeintellect.ai/dashboard/evaluations/savi3ix7zcjlua3x26nxxh7u) was created. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Add AgentBoard BabyAI environment package with text simulator and eval config > - Adds a new `agentboard-babyai` package with a Gymnasium/MiniGrid-based text simulator (`BabyAI` in [agentboard_babyai_runtime.py](https://github.com/PrimeIntellect-ai/residency-environments/pull/32/files#diff-be425817e801ab23a50f90676c99504ff1476095da3d7a460d535ff253c99181)) that validates high-level actions, tracks progress reward, and reports success, failure, or step-limit termination > - Adds a Verifiers integration ([agentboard_babyai.py](https://github.com/PrimeIntellect-ai/residency-environments/pull/32/files#diff-cfd10d39b442bf92beb1f2b3a6c64379b762914f1dfb8a6f2b87f70de52d522b)) that builds prompts from the packaged JSON asset, parses model replies into single normalized actions, and drives multi-turn rollouts with metrics for success, grounding, turns, and invalid actions > - Supports `all`, `train_3_per_subtask`, and `eval_1_per_subtask` splits with a configurable base seed (default 1234) > - Includes an eval config ([eval.toml](https://github.com/PrimeIntellect-ai/residency-environments/pull/32/files#diff-650fda196fe27f64843882f04187d9520ba76efb843a7f3d84c2f6099ba6e808)) selecting Qwen/Qwen3.5-9B with thinking disabled, and packages task data, prompt assets, and upstream AgentBoard provenance docs > - Risk: the simulator reads MiniGrid internals via `env.unwrapped` and expresses the 2D cross-product test as a scalar determinant; the ordered-door verifiers (`_BeforeDoors`, `_AfterDoors`) changed failure handling, so check those if port parity matters > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 7a8d4a3.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
1 parent 3cf818a commit 41de354

11 files changed

Lines changed: 1970 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
model = "Qwen/Qwen3.5-9B"
2+
num_rollouts = 1
3+
max_concurrent = 2
4+
push = true
5+
output_dir = "outputs/agentboard-babyai"
6+
7+
[env.taskset]
8+
id = "agentboard-babyai"
9+
split = "eval_1_per_subtask"
10+
base_seed = 1234
11+
12+
[env.agent]
13+
max_turns = 20
14+
15+
[env.agent.runtime]
16+
type = "subprocess"
17+
18+
[env.agent.timeout]
19+
setup = 120
20+
rollout = 300
21+
22+
[client]
23+
type = "eval"
24+
base_url = "https://api.pinference.ai/api/v1"
25+
api_key_var = "PRIME_API_KEY"
26+
27+
[client.timeout]
28+
read = 120
29+
30+
[sampling]
31+
temperature = 0.7
32+
max_tokens = 1024
33+
top_k = -1
34+
min_p = 0.0
35+
36+
[sampling.chat_template_kwargs]
37+
enable_thinking = false
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Third-Party Notices
2+
3+
This environment contains material adapted from AgentBoard:
4+
5+
- Project: AgentBoard
6+
- Repository: https://github.com/hkust-nlp/AgentBoard
7+
- Commit: `bb7255e2daf1989069a186dad9e53f70680961db`
8+
- Authors: Chang Ma, Junlei Zhang, Zhihao Zhu, Cheng Yang, Yujiu Yang,
9+
Yaohui Jin, Zhenzhong Lan, Lingpeng Kong, and Junxian He
10+
11+
`agentboard_babyai_runtime.py` and
12+
`assets/babyai_vanilla_prompt.json` are adapted from
13+
AgentBoard code/configuration distributed under Apache License 2.0. The runtime
14+
was extracted from the larger AgentBoard framework; registry, rendering, and
15+
unrelated dependency hooks were removed. See `licenses/Apache-2.0.txt`.
16+
17+
`assets/test.jsonl` is AgentBoard dataset material
18+
distributed under GNU General Public License version 2. See
19+
`licenses/GPL-2.0.txt`.
20+
21+
The Verifiers integration consists of project-specific additions.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AgentBoard BabyAI
2+
3+
A self-contained, text-based BabyAI environment for navigation and object manipulation, adapted from AgentBoard for Verifiers.
4+
5+
Requires Python 3.11+ and Verifiers 0.4.x. The runtime, prompt, and 112 task annotations are bundled; an AgentBoard checkout is not required. The split is 84 training episodes and 28 held-out episodes across 28 task families.
6+
7+
## Evaluation
8+
9+
From this repository's root, install the package and use the supplied Prime Inference configuration. Authenticate first with `prime login` or `PRIME_API_KEY`.
10+
11+
```bash
12+
uv pip install -e ./environments/agentboard-babyai
13+
uv run --no-sync vf-eval @ configs/agentboard-babyai/eval.toml -n 1 -r 2
14+
```
15+
16+
Omit `-n 1 -r 2` to evaluate all 28 held-out episodes once. The configuration uses Qwen3.5-9B with thinking disabled, a 20-turn limit, and the tool-free `null` harness.
17+
18+
## Licensing
19+
20+
The AgentBoard runtime and prompt are under Apache 2.0; the task annotations are under GPL 2.0. See `NOTICE.md`, `UPSTREAM_AGENTBOARD.md`, and `licenses/` for attribution and license details.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# AgentBoard Provenance
2+
3+
The self-contained BabyAI runtime and assets were frozen from AgentBoard commit:
4+
5+
```text
6+
bb7255e2daf1989069a186dad9e53f70680961db
7+
```
8+
9+
Source checksums before extraction:
10+
11+
| AgentBoard source | SHA-256 |
12+
| --- | --- |
13+
| `agentboard/environment/babyai_env.py` | `9c6ed31d492772ff902d8bddcb4096199fb8a17d866b5d1841f173b1ebbf6b33` |
14+
| `data/babyai/test.jsonl` | `d63d3dec56a623ea1c381a0815b31d6cfc3f707c5693c6d66e49b47c053c25bc` |
15+
| `agentboard/prompts/VanillaAgent/babyai_vanilla_prompt.json` | `1a7e040e67617c8556beab948c78e4ca4d78494fa96f4fe9b6b02c118a208068` |
16+
17+
The port intentionally preserves AgentBoard's textual observations, high-level
18+
action expansion, action validation, progress reward, completion behavior,
19+
task annotations, prompt, and seed mapping. Its parity suite compares all 112
20+
episodes against the frozen AgentBoard checkout.
21+
22+
Two compatibility adaptations are localized in the packaged runtime. MiniGrid
23+
internal attributes are read through Gymnasium's `env.unwrapped`, while
24+
`reset()` and `step()` continue to use the wrapped environment. AgentBoard's
25+
2D `numpy.cross` test is expressed directly as the equivalent scalar
26+
determinant because newer NumPy releases reject two-element vector inputs.

0 commit comments

Comments
 (0)