Skip to content

feat: nemo gym integration#1053

Open
cmunley1 wants to merge 19 commits intoPrimeIntellect-ai:mainfrom
cmunley1:cmunley1/nemo_gym_int
Open

feat: nemo gym integration#1053
cmunley1 wants to merge 19 commits intoPrimeIntellect-ai:mainfrom
cmunley1:cmunley1/nemo_gym_int

Conversation

@cmunley1
Copy link
Copy Markdown

@cmunley1 cmunley1 commented Mar 23, 2026

Description

Integrates NVIDIA NeMo Gym with a few example environments. Entire multiturn rollout is offloaded to nemo gym through the rollout collection helper in nemo gym, which includes agent, model, and resources servers.
Example usage

vf-eval nemo-gym-workplace-assistant -m local -d -n 1 -r 1
vf-eval nemo-gym-structured-outputs -m local -d -n 1 -r 1    
vf-eval nemo-gym-code-gen -m local -d -n 1 -r 1    
vf-eval nemo-gym-reasoning-gym -m local -d -n 1 -r 1    
vf-eval nemo-gym-reasoning-gym-reflection -m local -d -n 1 -r 1    

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Medium Risk
Introduces a new async/threaded integration that starts and manages external NeMo Gym servers and maps their rollouts into Verifiers state, plus expands local install path resolution; these changes touch execution lifecycle and environment installation behavior.

Overview
Adds NVIDIA NeMo Gym integration via a new NemoGymEnv that delegates rollouts to NeMo Gym’s rollout collection helper, manages head/policy server configuration and lifecycle, and converts NeMo Gym results into Verifiers trajectory/completion plus a reward sourced from NeMo Gym.

Adds multiple example NeMo Gym environment packages under environments/nemo_gym/* (each exposing load_environment() and pyproject.toml metadata) and updates docs/README and tests to reference the new integration and skip the parent nemo_gym directory.

Improves tooling compatibility by letting install_from_local() discover environments one directory deeper (nested under environments/*/<env_name>) and treating raw messages with role developer as system in message normalization.

Reviewed by Cursor Bugbot for commit bb22743. Bugbot is set up for automated code reviews on this repo. Configure here.

eligotts and others added 12 commits March 2, 2026 14:03
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
@cmunley1 cmunley1 changed the title feat: nemo gym integration draft feat: nemo gym integration Mar 23, 2026
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
@cmunley1 cmunley1 marked this pull request as ready for review March 28, 2026 05:16
Comment thread environments/README.md Outdated
Comment thread verifiers/envs/integrations/nemo_gym/env.py Outdated
cmunley1 added 2 commits April 4, 2026 02:48
…t name, use endpoint params, rename packages to hyphens, update readme, ruff

Signed-off-by: cmunley1 <cmunley@nvidia.com>
Signed-off-by: cmunley1 <cmunley@nvidia.com>
tool_call = ToolCall(
id=str(item.get("call_id") or item.get("id") or uuid.uuid4().hex[:8]),
name=str(item.get("name", "")),
arguments=str(item.get("arguments", "{}")),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tool call arguments may produce invalid JSON

Medium Severity

_nemo_item_to_assistant_message uses str() to convert the arguments field of a function call item, but ToolCall.arguments is expected to be a valid JSON string throughout the codebase. If NeMo Gym returns arguments as a dict, str() produces Python repr (e.g., "{'key': 'value'}") instead of valid JSON ('{"key": "value"}'). Multiple consumers in the codebase call json.loads(tool_call.arguments) (in tool_env.py, stateful_tool_env.py, etc.), which would fail on Python repr format. The existing _normalize_raw_tool_calls in message_utils.py handles this correctly by checking isinstance(arguments, str) first and falling back to json.dumps().

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8145b83. Configure here.

Comment thread environments/README.md
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Comment thread verifiers/envs/integrations/nemo_gym/env.py
Signed-off-by: cmunley1 <cmunley@nvidia.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bb22743. Configure here.

Comment thread docs/environments.md
- **`ReasoningGymEnv`** — wraps [reasoning-gym](https://github.com/open-thought/reasoning-gym) procedural datasets
- **`BrowserEnv`** — unified browser automation via [Browserbase](https://browserbase.com) with DOM and CUA modes
- **`OpenEnvEnv`** — wraps OpenEnv gym and MCP contracts using Prime Sandboxes with prebuilt images referenced from `.build.json`
- **`NemoGymEnv`** — wraps [NVIDIA NeMo Gym](https://github.com/NVIDIA-NeMo/Gym) environments.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NemoGymEnv install instructions missing from docs

Low Severity

NemoGymEnv is added to the integrations list but the follow-up install paragraph at line 794 only mentions extras for TextArena, BrowserEnv, and OpenEnvEnv. Since NemoGymEnv requires a different install flow (editable local clone, no pip extra defined in pyproject.toml), users reading "These require additional dependencies installed via extras" will be confused about how to install the NeMo Gym dependency.

Fix in Cursor Fix in Web

Triggered by project rule: BugBot Instructions

Reviewed by Cursor Bugbot for commit bb22743. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants