Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ versions:
- display-name: Main
path: versions/main.yml
slug: main
- display-name: "0.5.0"
path: versions/v0.5.0.yml
slug: v0.5.0
availability: stable
- display-name: "0.4.0"
path: versions/v0.4.0.yml
slug: v0.4.0
Expand Down
115 changes: 114 additions & 1 deletion fern/versions/latest/pages/about/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,120 @@ position: 4
---

<AccordionGroup>
<Accordion title="v0.4.0" defaultOpen>
<Accordion title="v0.5.0" defaultOpen>

### Release Summary

The NeMo Gym 0.5.0 release expands the sandbox ecosystem to seven providers, adds four new general-purpose agent harnesses (Codex, KiloCode, RemoteAgent, and Any-SWE) bringing the total to 20, adds 21 new benchmarks and environments, and wires rollout observability end-to-end from the model server boundary through agent transcripts.

Highlights:

- Seven sandbox providers: Docker, Daytona, ECS Fargate, Enroot, and OpenShell join OpenSandbox and Apptainer; large-scale OpenSandbox reliability significantly improved
- Four new agent harnesses: Codex CLI, KiloCode, RemoteAgent, and `anyswe_agent`
- Recompute rewards from stored rollouts without re-running inference with `gym eval reverify`
- Rollout observability joined end-to-end: model-call capture, agent observations, and a standardized `ng_trajectory` schema
- 21 new environments across six domains: Agentic, Knowledge and instruction following, Long context, Science and coding, Translation and multilingual, and Reasoning

### First-Time Contributors

We welcomed 22 new contributors to NeMo Gym with this release:

- **@mpatel31415** added `gym eval reverify` command and `--judge-failed-only` flag for recovering failed judge rows
- **@Glorf** added per-rollout model-call capture, Docker and ECS Fargate sandbox providers, rollout observation contract, Claude Code rollout observations, and standardized `ng_trajectory` schema
- **@nblintao** added per-request policy endpoint override for the SWE agents, enabling RL training frameworks to route each episode through a per-episode recording proxy
- **@JeffPengCoder** brought OSWorld — a stateful desktop GUI benchmark — into the benchmark catalog
- **@rystewart-nvidia** added the Legal Agent Bench integration, exposing Harvey's 1,749-task LAB benchmark through standard Gym eval commands
- **@fallintoplace** fixed the long-standing disagreement between runtime aggregate metrics and the persisted `output.jsonl`
- **@jonathanlli** added RULER pretrain evaluation, enabling text-completion scoring for base and midtraining checkpoints
- **@thompsonb** overhauled WMT24++ and FLORES translation evaluation (55 locales, 219 language pairs, chrF/spBLEU scoring); expanded MMLU-ProX to 29 languages
- **@hkumar92** added the PinchBench agentic benchmark
- **@pachmu** added ToolSandbox, IHEval, RoleMRC, and RAGTruth benchmarks

Thank you to all 57 NeMo Gym contributors this cycle, including 22 first-time contributors!

### Command Line Interface

- **`gym eval reverify`** — re-run only the verifier on stored rollouts; `--judge-failed-only` recovers rows that failed due to a flaky judge without re-verifying successful rollouts
- `gym list` and `gym search` extended to cover models, resources-servers, and agents; `gym list <type> <name>` drills into a single artifact
- External plugins discoverable via `--search-dir` and environment variables; `-v/--verbose` now accepted before any subcommand

### Sandboxing

Five new built-in providers: **Docker**, **Daytona**, **ECS Fargate**, **Enroot**, and **OpenShell** join OpenSandbox and Apptainer. Provider choice is a one-line config swap — any agent built on `nemo_gym.sandbox` works with any provider unchanged.

OpenSandbox reliability at scale is significantly improved: keepalive-bounded transport eliminates silent rollout zeroing at concurrency 300–1500; image registry auth supports private container images; sandbox resources are automatically labeled with team, user, and workload identifiers.

See [Available Sandbox Providers](https://docs.nvidia.com/nemo/gym/nemo-gym/nemo_gym/sandbox/providers/) for the full list.

### Configure Agent Harnesses

New harnesses join the existing set (Claude Code, Hermes, mini-SWE-Agent, OpenClaw, Pi, and more):

- **Codex** and **KiloCode** integrate `codex exec` and `kilo run` respectively, routing model calls through Gym for per-rollout capture
- **`anyswe_agent`** runs any Gym harness inside a SWE task container
- **`swe_agents`** adds OpenCode as a supported agent framework alongside OpenHands, with DeepSWE and DeNovoSWE dataset support and message replay for trajectory branching
- **RemoteAgent** drives any external service that implements `POST /v1/responses`, with Gym owning the tool loop and verification

### Configure Models

- vLLM can now drive `/v1/completions` for base and pretrain checkpoint evaluation via opt-in `use_completions_api`
- All Gym model servers now accept `stream: true` on `/v1/chat/completions` via synthesized SSE, unblocking streaming-first clients such as OpenClaw and Codex
- Add `expose_tools_over_mcp: true` to any resources server config to serve its tools over MCP with no handler code changes

### Rollout Observability

- Per-rollout model-call capture records requests, responses, token usage, and latency at the model server boundary
- Claude Code transcripts populate `ng_agent_observations`; agent observations and model-call capture are joined through a standardized `ng_trajectory` schema
- Judge failures are routed to a `_failures.jsonl` sidecar, keeping aggregate metrics over successfully-judged rows only

### New Benchmarks and Environments

21 new environments across six domains:

- **Agentic:** PinchBench (147 real-world tasks), OSWorld (desktop GUI with VM-backed evaluation), Legal Agent Bench (1,749 Harvey LAB tasks), ToolSandbox (Apple multi-turn tool-use), BrowseComp (web research), BioMNIBench DA, Tau3 banking (BM25+grep offline eval path)
- **Knowledge and instruction following:** SECQUE, FinanceBench, Finance SEC Search, IHEval (instruction hierarchy, rule-based), Litmus-Bench v0.1, RoleMRC (role-play MRC), RAGTruth (hallucination detection)
- **Long context:** NIAH (retrieval with overlap penalty)
- **Science and coding:** CVDP Agentic (expanded to support the agentic subset, harness-agnostic)
- **Translation and multilingual:** WMT24++ (expanded from 5 to 55 locales), FLORES (expanded from 30 to 219 language pairs, chrF/spBLEU scoring), MMLU-ProX (expanded to 29 languages); RULER now supports pretrain text-completion evaluation
- **Reasoning:** ReasoningGym environments — six agentic variants: Claude Code, Hermes, and four LangGraph-based variants (orchestrator, reflection, parallel thinking, and ReWOO)

See the [Available Environments](https://github.com/NVIDIA-NeMo/Gym#-available-environments) table for the full list.

### Deprecation Notices

- WMT24++ and FLORES scores from prior versions are not comparable with this version's chrF/spBLEU output
- Python 3.13.14 is now required (previously 3.12); users running Gym in Python 3.12 environments must upgrade

### Bug Fixes

- SciCode realigned to the AA 65-problem test set with per-rollout subtask accuracy reporting
- Fixed silent rollout zeros at high concurrency against OpenSandbox (keepalive-bounded transport)
- Fixed frozen rollouts in long-running benchmarks (TCP keepalive on global aiohttp connector)
- Fixed `gym eval run` failing with `FileNotFoundError` when the output directory did not exist
- Fixed `tool_choice` sent to vLLM without `tools`, causing request rejection
- Fixed Claude Code `max_turns` hardcoded to 30; `max_turns: null` now removes the cap
- Fixed Apptainer sandbox env vars injected into subprocess argv instead of environment
- Fixed MCQA answer parsing for wrapped formats (`$D$`, `(D)`, `\boxed{\text{Answer: G}}`)
- Fixed aggregate metrics including non-persisted rollouts, causing disagreement with `output.jsonl`

### Documentation

- Rewrote the key terminology glossary with a Gym overview, component map, and links to how-to pages
- New page documenting the Anthropic Messages dialect (`POST /v1/messages`) and wiring Claude Code through a Gym model server
- Updated NeMo RL v0.7.0 compatibility guidance
- Migrated all remaining docs examples from legacy `ng_run`/`ng_collect_rollouts` to the unified `gym` CLI
- Documented `gym list` and `gym search` extensions, external plugin discovery, and MCP auto-exposure
- Added `gym eval reverify` and multi-reward verification contract documentation

### Release Assets

[GitHub Release v0.5.0](https://github.com/NVIDIA-NeMo/Gym/releases/tag/v0.5.0)



</Accordion>

<Accordion title="v0.4.0">

### Release Summary

Expand Down
67 changes: 67 additions & 0 deletions fern/versions/v0.5.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
tabs:
docs:
display-name: Documentation
slug: ""
api:
display-name: API Reference
slug: api

navigation:
- tab: docs
layout:
- folder: ./v0.5.0/pages/about
title: "About"
title-source: frontmatter
- folder: ./v0.5.0/pages/get-started
title: "Get Started"
title-source: frontmatter
- folder: ./v0.5.0/pages/data
title: "Prepare Data"
title-source: frontmatter
- folder: ./v0.5.0/pages/agent-server
title: "Configure Agents"
title-source: frontmatter
- folder: ./v0.5.0/pages/model-server
title: "Configure Models"
title-source: frontmatter
- folder: ./v0.5.0/pages/build-verifiers
title: "Build Verifiers"
title-source: frontmatter
- folder: ./v0.5.0/pages/evaluation
title: "Evaluate"
title-source: frontmatter
- section: Tutorials
contents:
- folder: ./v0.5.0/pages/training-tutorials
title: "Training Tutorials"
title-source: frontmatter
- folder: ./v0.5.0/pages/evaluation-tutorials
title: "Evaluation Tutorials"
title-source: frontmatter
- folder: ./v0.5.0/pages/environment-tutorials
title: "Build Environments"
title-source: frontmatter
- folder: ./v0.5.0/pages/model-recipes
title: "Model Recipes"
title-source: frontmatter
- folder: ./v0.5.0/pages/infrastructure
title: "Infrastructure"
title-source: frontmatter
- folder: ./v0.5.0/pages/reference
title: "Reference"
title-source: frontmatter
- folder: ./v0.5.0/pages/troubleshooting
title: "Troubleshooting"
title-source: frontmatter
- folder: ./v0.5.0/pages/contribute
title: "Contribute"
title-source: frontmatter
- tab: api
layout:
- section: API Reference
slug: reference/api-reference
contents:
- page: Overview
path: ./v0.5.0/pages/api-reference/index.mdx
slug: ""
- folder: ../product-docs/nemo-gym/Full-Library-Reference
126 changes: 126 additions & 0 deletions fern/versions/v0.5.0/pages/about/architecture.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: "Architecture"
description: "Understand how NeMo Gym implements environments as composable server components."
position: 2.5
---

<Info>

**Goal**: Understand how NeMo Gym implements environments as composable server components.

**Read first**: [Environments](/about/concepts/environments) — what an environment is and how it decomposes into dataset, agent harness, verifier, and state.

</Info>

## How NeMo Gym Implements Environments

NeMo Gym implements environments as composable FastAPI servers that communicate over async HTTP:

| Concept | NeMo Gym Component Implementation |
|---------|---------------|
| Dataset | JSONL: Responses API input — each row is a task (a single problem or challenge) for the agent to solve |
| Agent Harness | FastAPI Agent Server |
| Verifier + State | FastAPI Resources Server |
| Model | FastAPI Model Server or managed by your own agent harness |

All components are composable. Use different datasets with the same resources server, the same resources server with different models, or the same model with different agent harnesses.

This gives you flexibility to integrate with your existing models and agents:

- **Bring your own agent** — Integrate your existing agent to use it with any Gym environment components.
- **Use a built-in agent** — NeMo Gym includes some native agents, e.g. general-purpose multi-step tool calling, as well as built-in integrations with external harnesses like OpenHands.
- **Train with any model endpoint** — The Model Server standardizes different LLM endpoints behind the Responses API and provides token IDs and log probabilities needed for RL training.

## How an Agent Runs a Task in NeMo Gym Environments

Each task attempt flows through three steps. The resulting trajectory is called a *rollout*:

1. **Initialize** — The agent receives a task row from the dataset and initializes a session on the Resources Server, which sets up isolated state for this task.
2. **Agent Loop** — The agent calls a model for inference, then routes any tool calls to either its own tools or the Resources Server. This repeats until the agent decides the task is complete.
3. **Verify** — The agent asks the Resources Server to score the attempt. The verifier inspects the final state and returns a reward signal.


```
Dataset (JSONL - one row per task)
┌──────────────────────────────────────────┐
│ Agent Server │
│ │
│ run(): │
│ 1. resources.seed_session() ─────────────► Resources Server
│ 2. agent loop: │
│ model.responses() ─────────────► Model Server
│ resources.my_tool() ─────────────► Resources Server
│ 3. resources.verify() ─────────────► Resources Server
└──────────────────────────────────────────┘

┌───────────────────────────┐ ┌────────────────────────────────────┐
│ Model Server │ │ Resources Server │
│ │ │ │
│ responses(): │ │ seed_session(): init env state │
│ → text, tool calls, │ │ my_tool(): execute action │
│ or code │ │ verify(): evaluate → reward │
└───────────────────────────┘ └────────────────────────────────────┘
```


## Server Types

### Agent Server

Hosts agent harnesses that orchestrate rollouts. Use your own harness, or use built-in harnesses such as OpenHands or NeMo Gym's native harnesses such as Simple Agent.

### Model Server

A stateless LLM inference endpoint that standardizes different model providers behind the Responses API. Supports local inference and inference providers.

### Resources Server

Manages environment-specific tools, per-task state isolation, and verification:

- **Environment-Specific Tools** — capabilities the environment provides to any agent (e.g., code execution, database queries, API calls)
- **State Isolation** — each rollout gets its own session, so attempts never interfere with each other. Environments range from lightweight (verify a math answer, no setup needed) to heavyweight (provision a Docker container with a specific repo checkout for SWE-Bench-style tasks).
- **Verification** — scoring logic that evaluates the agent's output and returns a reward

## Where Tools Live

Tools exist on a spectrum — some belong to the agent and can be used with any environment, some belong to the environment and can be used with any agent:

- **Agent-specific tools** are part of the agent harness. They're capabilities the agent brings regardless of which environment it runs in (e.g., OpenHands brings file editing and terminal tools).
- **Environment-specific tools** are part of the Resources Server. They're capabilities the environment provides to any agent that connects (e.g., a `run_tests` endpoint, a database query tool, a sandbox execution API).

An agent can use both simultaneously — its own tools and the environment's tools in the same task. NeMo Gym's server split reflects this: agent-specific logic in the harness, environment-specific logic in the Resources Server.

## Communication

Servers communicate over async HTTP (aiohttp) with:
- **Session cookies** propagated through the call stack for stateful environments
- **Retry logic** with exponential backoff (3 attempts)
- **Connection pooling** via a singleton aiohttp client for high-concurrency workloads

## Next Steps

<Cards>

<Card title="Concepts" href="/about/concepts">
Understand environments, evaluation, and training before diving into implementation.
</Card>

<Card title="Browse Environments" href="https://github.com/NVIDIA-NeMo/Gym#-available-environments">
Browse available environments for evaluation and training.
</Card>

<Card title="Agents" href="/agent-server">
Explore available agent harnesses and learn how to integrate your own agent.
</Card>

<Card title="Training" href="/tutorials/training-tutorials">
Improve your agent or model with RL or fine-tuning.
</Card>

<Card title="Build Custom Environments" href="/environment-tutorials">
Create your own evaluation or training environments.
</Card>

</Cards>
Loading
Loading