nemo_gym.registry

View as Markdown

Registry of co-located environments under environments/<name>/.

An environment is a directory environments/<name>/ whose config.yaml wires together a resources server, an agent, and datasets (and references a model server). This module maps an environment’s short <name> 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

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

Functions

NameDescription
_read_metadataBest-effort (description, domain) from the config’s resources_servers entry.
discover_environmentsMap environment name -> :class:EnvironmentEntry for every <name>/config.yaml.

Data

ENVIRONMENTS_DIR

ENVIRONMENT_CONFIG_FILENAME

API

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.

config_path
Path
description
Optional[str] = None
domain
Optional[str] = None
name
str
path
Path
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.

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 <name>/config.yaml.

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

nemo_gym.registry.ENVIRONMENTS_DIR = PARENT_DIR / 'environments'
nemo_gym.registry.ENVIRONMENT_CONFIG_FILENAME = 'config.yaml'