nemo_gym.cli.env
nemo_gym.cli.env
Module Contents
Classes
Functions
Data
API
Bases: BaseNeMoGymCLIConfig
Bases: BaseNeMoGymCLIConfig
Start NeMo Gym servers for agents, models, and resources.
Examples:
Bases: NamedTuple
A server block value that its server’s config class rejects, or a block that could not be checked.
The name of the config class that rejected the value; None when the block could not be checked.
The config class’s message, or why the block’s config class could not be loaded.
Dotted path in the merged config: the rejected field, else the block (or the unknown server type).
The rejected input, as the config class received it.
Bases: BaseNeMoGymCLIConfig
Run tests for all server modules in the project.
Examples:
Bases: RunConfig
Test a specific server module by running its pytest suite and optionally validating example data.
Examples:
Absolute server dir resolved against the cwd, then the Gym install root.
Use this for filesystem access (reading data, running the suite); use dir_path (the
relative entrypoint) for display and example commands shown to the user.
Validate each Environment Server block against its server’s config class without starting it.
gym env start applies that class only when the server launches, after the other servers are up. Environment
Servers ship with Gym and need few packages of their own, so this process imports their entrypoints. A server
whose entrypoint does not import here is left to its launch: the returned warnings name each one.
Raises EnvironmentServerConfigError listing every invalid field, by its path in the merged config.
Parse the already-translated local command flags without resolving Gym runtime config.
Compose the config as gym eval run does from the same run args; the job adds the policy model itself.
Why the config did not compose, and the key whose value did not resolve when the error names one.
A failing resolver (for example oc.decode given an int) is reported at its key with the resolver’s own
message. Gym’s own explanation, such as the override that supplies a missing key, is kept as it reads.
The resources server and agent an entry runs with, as the catalog views show them.
The manifest says when there is one. Otherwise the config’s runtime routes select the servers. A
config that needs values only a run supplies, such as a judge model server, or that is malformed does not
resolve; then the names written in the config file are used, each only when the file names exactly one, since a
file naming several does not say which one runs. details is the config’s read_environment_details
result when the caller has it.
The config class of the server an entrypoint runs, the one its launch validates its block against.
oc.env that reads an unset variable without a default as a job-time value.
Render one entry from the unified environment catalog.
Deterministically select this shard’s subset of modules.
Round-robin (stride) over a sorted list spreads heavy modules across shards more evenly than contiguous chunks, which balances wall-time when the suite is parallelized across CI runners.
Install every selected server’s venv the way the suite would, then exit non-zero if any failed.
The container build runs this to seed its uv cache, so scripts/ci/server_tests.sh can create the same
per-server venvs offline. Every server is attempted before failing, so one run reports every gap.
Install one server’s venv exactly as _test_single does, without running its tests.
gym env validate --server-types: print one finding per line; return 0, 1, 2, or 3 for a crash.
Display the resolved Hydra configuration for debugging purposes.
Examples:
Create a manifest-backed environment or benchmark skeleton.
Initialize a new resources server with template files and directory structure.
Examples:
List or inspect the manifest and legacy environment/benchmark catalog.
List packages installed in a server’s virtual environment.
Pre-warm per-server venvs without starting any servers.
Accepts the same config format as ‘gym env start’. For each server in the config, creates its isolated venv and installs dependencies serially — similar to how RL’s prefetch_venvs.py installs actor venvs at container build time.
No Ray is initialised and no server processes are started. Intended for use in Dockerfile builds so venvs are ready at runtime with no network access needed.
Configuration Parameter:
config_paths (List[str]): Paths to YAML configuration files. Specify via Hydra: +config_paths="[file1.yaml,file2.yaml]"
Examples:
Run local publication checks and confirm a workload is cataloged.
Start NeMo Gym servers for agents, models, and resources.
This command reads configuration from YAML files specified via +config_paths and starts all configured servers.
The configuration files should define server instances with their entrypoints and settings.
Configuration Parameter:
config_paths (List[str]): Paths to YAML configuration files. Specify via Hydra: +config_paths="[file1.yaml,file2.yaml]"
Examples:
Print the selected server’s TaskData schema (see nemo_gym/data/task_data.py).
Exercise a manifest-backed workload’s verifier fixture without starting services.
Validate a manifest-backed workload or a legacy Gym config without starting services.
Validate each server block of the given server types against its own server’s config class, starting nothing.
Each block is checked against the class its server validates it with at launch. This process imports the
entrypoint to find that class. A block whose entrypoint does not import here, for example because the server’s
own venv has packages this one lacks, is one problem with config_class None, and its fields stay unchecked.
A server type that Gym does not define is such a problem too, at the type’s name, so a caller written for
another Gym version still gets an answer. An empty list means every checked block is valid.