> 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.registry

Registry of co-located environments under `environments/&lt;name&gt;/`.

An *environment* is a directory `environments/&lt;name&gt;/` whose `config.yaml` wires together a
resources server, an agent, and datasets (and references a model server). This module maps an
environment's short `&lt;name&gt;` to its config so it can be enumerated by name — the foundation for
`gym list environments`. Resolving a name to a config path for *running* is handled by the CLI's
generic `--environment` asset selector, so this module is intentionally discovery-only.

Discovery only reads config files; it never resolves interpolations or starts servers, so it is
safe to call even when secrets/API keys referenced by a config are not set in the environment.

## Module Contents

### Classes

| Name                                                      | Description                                                                   |
| --------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [`EnvironmentEntry`](#nemo_gym-registry-EnvironmentEntry) | A discovered environment: its name, where it lives, and lightweight metadata. |

### Functions

| Name                                                                | Description                                                                             |
| ------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [`_read_metadata`](#nemo_gym-registry-_read_metadata)               | Best-effort `(description, domain)` from the config's resources\_servers entry.         |
| [`discover_environments`](#nemo_gym-registry-discover_environments) | Map environment name -> :class:`EnvironmentEntry` for every `&lt;name&gt;/config.yaml`. |

### Data

[`ENVIRONMENTS_DIR`](#nemo_gym-registry-ENVIRONMENTS_DIR)

[`ENVIRONMENT_CONFIG_FILENAME`](#nemo_gym-registry-ENVIRONMENT_CONFIG_FILENAME)

### API

```python
class nemo_gym.registry.EnvironmentEntry(
    name: str,
    config_path: pathlib.Path,
    path: pathlib.Path,
    description: typing.Optional[str] = None,
    domain: typing.Optional[str] = None
)
```

Dataclass

A discovered environment: its name, where it lives, and lightweight metadata.

```python
nemo_gym.registry._read_metadata(
    config_path: pathlib.Path
) -> typing.Tuple[typing.Optional[str], typing.Optional[str]]
```

Best-effort `(description, domain)` from the config's resources\_servers entry.

Reads without resolving interpolations or missing values so a config that references an unset
key (e.g. an API key) still yields metadata instead of raising.

```python
nemo_gym.registry.discover_environments(
    environments_dir: pathlib.Path = ENVIRONMENTS_DIR
) -> typing.Dict[str, nemo_gym.registry.EnvironmentEntry]
```

Map environment name -> :class:`EnvironmentEntry` for every `&lt;name&gt;/config.yaml`.

The name is the directory name. Returns an empty dict if the directory is missing.

```python
nemo_gym.registry.ENVIRONMENTS_DIR = PARENT_DIR / 'environments'
```

```python
nemo_gym.registry.ENVIRONMENT_CONFIG_FILENAME = 'config.yaml'
```