nemo_gym.global_config
nemo_gym.global_config
Module Contents
Classes
Functions
Data
NEMO_GYM_CONFIG_DICT_ENV_VAR_NAME
NEMO_GYM_CONFIG_PATH_ENV_VAR_NAME
NEMO_GYM_RESERVED_TOP_LEVEL_KEYS
RAY_HEAD_NODE_ADDRESS_KEY_NAME
RESPONSES_CREATE_PARAMS_KEY_NAME
API
Bases: BaseModel
Return the dotted paths of every unset (OmegaConf ’???’) leaf, without raising.
We convert to a plain container with resolve=False, throw_on_missing=False so that
neither MISSING values nor unresolved interpolations (${...}) cause an exception — then
walk the plain structure. Iterating or indexing the live DictConfig would raise.
Returns the new total config_paths and the extra configs
Fail fast with one actionable error listing every unset ’???’ value.
Without this, the first unset value surfaces deep in the run pipeline as an opaque omegaconf MissingMandatoryValue, one field at a time and with no override guidance.
Fail fast if a run has no server instances to start.
Without this, gym env start with an empty/omitted config_paths starts the head server and Ray
and then hangs with nothing to run. We catch it before Ray initialises with an actionable
message instead.
Bases: BaseModel
Set logging to DEBUG when verbose is in the config. Runs in the CLI process and, because the
config dict is forwarded to every spun-up server, in each server process too.
Format user-friendly warning. Union literal errors are consolidated.
Union discriminator noise is filtered out. Explanation:
Pydantic validation is quirky- it will report all failures in the union if any union member fails. Example:
If an agent server contains an invalid license, it will not only show the error for the invalid license in ResponsesAPIAgentServerInstanceConfig, but also missing values for ResponsesAPIModelServerInstanceConfig responses_api_models and ResourcesServerInstanceConfig resources_servers.
This function provides a handle to the global configuration dict global_config_dict. We try to have one source of truth for everything in NeMo gym.
This config is resolved once and only once, immediately on a run command.
On first initialization, the global config dict will be loaded from the following sources in order of priority (later items are higher priority):
- Configuration yamls specified in
config_pathsparameter. - Configuration (usually sensitive values like API keys, etc) from a local
.env.yamlfile. - Command line argument configuration.
Validation is performed on the passed in configs:
- If a host or port is not provided for a server, defaults will be provided. Ports are resolved by the OS.
- If there are server reference configs, the respective server names and types will be validated against the remainder of the config.
Then, the global config dict will be cached and reused.
If this function is run by a child server of the main proc, that child will have been spun up with an environment variable with key NEMO_GYM_CONFIG_DICT_ENV_VAR_NAME. The config dict will be read directly off this variable, cached, and returned with no additional validation.