> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym

## Subpackages

* **[`nemo_gym.cli`](/nemo/gym/nemo-gym/nemo_gym/cli)**
* **[`nemo_gym.comparison`](/nemo/gym/nemo-gym/nemo_gym/comparison)**
* **[`nemo_gym.environment`](/nemo/gym/nemo-gym/nemo_gym/environment)**
* **[`nemo_gym.exporters`](/nemo/gym/nemo-gym/nemo_gym/exporters)**
* **[`nemo_gym.harness_capabilities`](/nemo/gym/nemo-gym/nemo_gym/harness_capabilities)**
* **[`nemo_gym.health`](/nemo/gym/nemo-gym/nemo_gym/health)**
* **[`nemo_gym.orchestration`](/nemo/gym/nemo-gym/nemo_gym/orchestration)**
* **[`nemo_gym.sandbox`](/nemo/gym/nemo-gym/nemo_gym/sandbox)**
* **[`nemo_gym.telemetry`](/nemo/gym/nemo-gym/nemo_gym/telemetry)**
* **[`nemo_gym.testing`](/nemo/gym/nemo-gym/nemo_gym/testing)**
* **[`nemo_gym.token_id_capture`](/nemo/gym/nemo-gym/nemo_gym/token_id_capture)**

## Submodules

* **[`nemo_gym.agent_registry`](/nemo/gym/nemo-gym/nemo_gym/agent_registry)**
* **[`nemo_gym.anthropic_converter`](/nemo/gym/nemo-gym/nemo_gym/anthropic_converter)**
* **[`nemo_gym.anthropic_utils`](/nemo/gym/nemo-gym/nemo_gym/anthropic_utils)**
* **[`nemo_gym.atif_export`](/nemo/gym/nemo-gym/nemo_gym/atif_export)**
* **[`nemo_gym.atif_json`](/nemo/gym/nemo-gym/nemo_gym/atif_json)**
* **[`nemo_gym.atif_reverification`](/nemo/gym/nemo-gym/nemo_gym/atif_reverification)**
* **[`nemo_gym.atif_v1_7`](/nemo/gym/nemo-gym/nemo_gym/atif_v1_7)**
* **[`nemo_gym.base_environment_server`](/nemo/gym/nemo-gym/nemo_gym/base_environment_server)**
* **[`nemo_gym.base_resources_server`](/nemo/gym/nemo-gym/nemo_gym/base_resources_server)**
* **[`nemo_gym.base_responses_api_agent`](/nemo/gym/nemo-gym/nemo_gym/base_responses_api_agent)**
* **[`nemo_gym.base_responses_api_model`](/nemo/gym/nemo-gym/nemo_gym/base_responses_api_model)**
* **[`nemo_gym.batch_status`](/nemo/gym/nemo-gym/nemo_gym/batch_status)**
* **[`nemo_gym.benchmarks`](/nemo/gym/nemo-gym/nemo_gym/benchmarks)**
* **[`nemo_gym.chat_streaming`](/nemo/gym/nemo-gym/nemo_gym/chat_streaming)**
* **[`nemo_gym.cli_setup_command`](/nemo/gym/nemo-gym/nemo_gym/cli_setup_command)**
* **[`nemo_gym.config_types`](/nemo/gym/nemo-gym/nemo_gym/config_types)**
* **[`nemo_gym.dataset_metrics`](/nemo/gym/nemo-gym/nemo_gym/dataset_metrics)**
* **[`nemo_gym.dataset_orchestrator`](/nemo/gym/nemo-gym/nemo_gym/dataset_orchestrator)**
* **[`nemo_gym.decorators`](/nemo/gym/nemo-gym/nemo_gym/decorators)**
* **[`nemo_gym.deliverables`](/nemo/gym/nemo-gym/nemo_gym/deliverables)**
* **[`nemo_gym.discovery`](/nemo/gym/nemo-gym/nemo_gym/discovery)**
* **[`nemo_gym.episode_types`](/nemo/gym/nemo-gym/nemo_gym/episode_types)**
* **[`nemo_gym.failure_kinds`](/nemo/gym/nemo-gym/nemo_gym/failure_kinds)**
* **[`nemo_gym.gitlab_utils`](/nemo/gym/nemo-gym/nemo_gym/gitlab_utils)**
* **[`nemo_gym.global_config`](/nemo/gym/nemo-gym/nemo_gym/global_config)**
* **[`nemo_gym.hf_utils`](/nemo/gym/nemo-gym/nemo_gym/hf_utils)**
* **[`nemo_gym.judge`](/nemo/gym/nemo-gym/nemo_gym/judge)**
* **[`nemo_gym.mcp_auto_exposure`](/nemo/gym/nemo-gym/nemo_gym/mcp_auto_exposure)**
* **[`nemo_gym.metrics_config`](/nemo/gym/nemo-gym/nemo_gym/metrics_config)**
* **[`nemo_gym.model_registry`](/nemo/gym/nemo-gym/nemo_gym/model_registry)**
* **[`nemo_gym.openai_utils`](/nemo/gym/nemo-gym/nemo_gym/openai_utils)**
* **[`nemo_gym.package_info`](/nemo/gym/nemo-gym/nemo_gym/package_info)**
* **[`nemo_gym.path_utils`](/nemo/gym/nemo-gym/nemo_gym/path_utils)**
* **[`nemo_gym.profiling`](/nemo/gym/nemo-gym/nemo_gym/profiling)**
* **[`nemo_gym.prompt`](/nemo/gym/nemo-gym/nemo_gym/prompt)**
* **[`nemo_gym.registry`](/nemo/gym/nemo-gym/nemo_gym/registry)**
* **[`nemo_gym.resources_server_registry`](/nemo/gym/nemo-gym/nemo_gym/resources_server_registry)**
* **[`nemo_gym.responses_converter`](/nemo/gym/nemo-gym/nemo_gym/responses_converter)**
* **[`nemo_gym.responses_streaming`](/nemo/gym/nemo-gym/nemo_gym/responses_streaming)**
* **[`nemo_gym.reward_profile`](/nemo/gym/nemo-gym/nemo_gym/reward_profile)**
* **[`nemo_gym.rollout_collection`](/nemo/gym/nemo-gym/nemo_gym/rollout_collection)**
* **[`nemo_gym.rollout_correlation`](/nemo/gym/nemo-gym/nemo_gym/rollout_correlation)**
* **[`nemo_gym.rollout_health`](/nemo/gym/nemo-gym/nemo_gym/rollout_health)**
* **[`nemo_gym.rollout_observability`](/nemo/gym/nemo-gym/nemo_gym/rollout_observability)**
* **[`nemo_gym.rollout_outcomes`](/nemo/gym/nemo-gym/nemo_gym/rollout_outcomes)**
* **[`nemo_gym.rollout_reverification`](/nemo/gym/nemo-gym/nemo_gym/rollout_reverification)**
* **[`nemo_gym.secret_utils`](/nemo/gym/nemo-gym/nemo_gym/secret_utils)**
* **[`nemo_gym.server_metadata`](/nemo/gym/nemo-gym/nemo_gym/server_metadata)**
* **[`nemo_gym.server_status`](/nemo/gym/nemo-gym/nemo_gym/server_status)**
* **[`nemo_gym.server_utils`](/nemo/gym/nemo-gym/nemo_gym/server_utils)**
* **[`nemo_gym.single_agent_turn_types`](/nemo/gym/nemo-gym/nemo_gym/single_agent_turn_types)**
* **[`nemo_gym.skills`](/nemo/gym/nemo-gym/nemo_gym/skills)**
* **[`nemo_gym.task_data`](/nemo/gym/nemo-gym/nemo_gym/task_data)**
* **[`nemo_gym.task_materialization`](/nemo/gym/nemo-gym/nemo_gym/task_materialization)**
* **[`nemo_gym.tool_access`](/nemo/gym/nemo-gym/nemo_gym/tool_access)**
* **[`nemo_gym.train_data_utils`](/nemo/gym/nemo-gym/nemo_gym/train_data_utils)**
* **[`nemo_gym.verifier_fixture`](/nemo/gym/nemo-gym/nemo_gym/verifier_fixture)**
* **[`nemo_gym.vision_input`](/nemo/gym/nemo-gym/nemo_gym/vision_input)**

## Package Contents

### Functions

| Name                                                                       | Description                                                                                         |
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [`__dir__`](#nemo_gym-__dir__)                                             | -                                                                                                   |
| [`__getattr__`](#nemo_gym-__getattr__)                                     | -                                                                                                   |
| [`_augment_sys_path`](#nemo_gym-_augment_sys_path)                         | Put the artifact roots on `sys.path` so plugin modules (e.g. a benchmark's `prepare.py`) import.    |
| [`_extra_roots`](#nemo_gym-_extra_roots)                                   | -                                                                                                   |
| [`_resolve_under_cwd_or_install`](#nemo_gym-_resolve_under_cwd_or_install) | Resolve a possibly-relative path for *reading* a built-in or user-supplied file against the ordered |
| [`component_search_roots`](#nemo_gym-component_search_roots)               | Ordered, de-duplicated roots to look for a Gym component/artifact under: the `NEMO_GYM_EXTRA_ROOTS` |
| [`print_always_flushes`](#nemo_gym-print_always_flushes)                   | -                                                                                                   |

### Data

[`CACHE_DIR`](#nemo_gym-CACHE_DIR)

[`NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME`](#nemo_gym-NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME)

[`OLD_PRINT`](#nemo_gym-OLD_PRINT)

[`PARENT_DIR`](#nemo_gym-PARENT_DIR)

[`RESULTS_DIR`](#nemo_gym-RESULTS_DIR)

[`ROOT_DIR`](#nemo_gym-ROOT_DIR)

[`WORKING_DIR`](#nemo_gym-WORKING_DIR)

[`_EAGER_PUBLIC`](#nemo_gym-_EAGER_PUBLIC)

[`_LAZY_EXPORTS`](#nemo_gym-_LAZY_EXPORTS)

[`_is_editable_install`](#nemo_gym-_is_editable_install)

### API

```python
nemo_gym.__dir__() -> list[str]
```

```python
nemo_gym.__getattr__(
    name: str
)
```

```python
nemo_gym._augment_sys_path() -> None
```

Put the artifact roots on `sys.path` so plugin modules (e.g. a benchmark's `prepare.py`) import.

Extra roots go to the front and cwd/`PARENT_DIR` (the built-ins) to the end, so import precedence
matches file resolution under `component_search_roots` (a plugin shadows a same-named Gym module).
Idempotent; reads `NEMO_GYM_EXTRA_ROOTS` at call time, so it can be re-run after `--search-dir` folds
roots into the env (see nemo\_gym.cli.main).

```python
nemo_gym._extra_roots() -> typing.List[pathlib.Path]
```

```python
nemo_gym._resolve_under_cwd_or_install(
    rel_path: typing.Union[str, pathlib.Path],
    validator: typing.Optional[typing.Callable[[Path], bool]] = None
) -> pathlib.Path
```

Resolve a possibly-relative path for *reading* a built-in or user-supplied file against the ordered
`component_search_roots`.

Absolute paths are returned unchanged. A relative path is returned rooted at the first root where it
exists (earliest-wins: extra roots > cwd > install root), so a repo-relative path like
`benchmarks/&lt;name&gt;/config.yaml` or `resources_servers/&lt;env&gt;/data/example.jsonl` resolves by name
from any cwd or plugin root. `validator` overrides the default `Path.exists` check — pass it when a
candidate is valid only if specific markers are present (e.g. a server dir must ship
`requirements.txt` or `pyproject.toml`). If nothing matches, the path under the highest-priority
root is returned so error messages point at the user's own location.

Use this for read paths only — never for write targets (e.g. metrics written next to a dataset), which
must stay relative to the user's writable cwd rather than the install root.

```python
nemo_gym.component_search_roots(
    sys_path: typing.List[pathlib.Path] | None = None
) -> typing.List[pathlib.Path]
```

Ordered, de-duplicated roots to look for a Gym component/artifact under: the `NEMO_GYM_EXTRA_ROOTS`
roots first, then cwd and the install root (`PARENT_DIR`, the built-ins) last.

Earlier roots win on a name collision, so user components shadow built-ins. De-duplicated by resolved
path, since cwd/install root coincide in an editable checkout. The single source of truth for where Gym
looks for components — used by path resolution (`_resolve_under_cwd_or_install`), module imports
(`_augment_sys_path`) and the `gym list`/`gym search` discovery functions.

`sys_path` weaves existing `sys.path` entries in for import precedence: they slot in after the extra
roots but before cwd/built-ins. Any entry that is itself cwd or the install root is dropped so those two
always stay last — matching the file-lookup order even in a wheel install, where the install root is
already on `sys.path` as `site-packages`.

```python
nemo_gym.print_always_flushes(
    args = (),
    kwargs = {}
) -> None
```

```python
nemo_gym.CACHE_DIR = WORKING_DIR / 'cache'
```

```python
nemo_gym.NEMO_GYM_EXTRA_ROOTS_ENV_VAR_NAME = 'NEMO_GYM_EXTRA_ROOTS'
```

```python
nemo_gym.OLD_PRINT = print
```

```python
nemo_gym.PARENT_DIR = ROOT_DIR.parent
```

```python
nemo_gym.RESULTS_DIR = WORKING_DIR / 'results'
```

```python
nemo_gym.ROOT_DIR = Path(__file__).absolute().parent
```

```python
nemo_gym.WORKING_DIR = PARENT_DIR if _is_editable_install else Path.cwd()
```

```python
nemo_gym._EAGER_PUBLIC: tuple[str, ...] = ('ROOT_DIR', 'PARENT_DIR', 'WORKING_DIR', 'CACHE_DIR', 'RESULTS_DIR', '__version...
```

```python
nemo_gym._LAZY_EXPORTS: dict[str, str] = {'BaseResourcesServerConfig': 'base_resources_server', 'SimpleResourcesServer': ...
```

```python
nemo_gym._is_editable_install = (PARENT_DIR / 'pyproject.toml').exists()
```