nemo_gym.cli

View as Markdown

Module Contents

Classes

NameDescription
PipListConfig-
RunConfigStart NeMo Gym servers for agents, models, and resources.
RunHelper-
TestAllConfigRun tests for all server modules in the project.
TestConfigTest a specific server module by running its pytest suite and optionally validating example data.
VersionConfigDisplay gym version and system information.

Functions

NameDescription
_display_list_of_paths-
_format_pct-
_test_single-
_validate_data_single-
dev_testRun core NeMo Gym tests with coverage reporting (runs pytest with —cov flag).
display_helpDisplay a list of available NeMo Gym CLI commands.
dump_configDisplay the resolved Hydra configuration for debugging purposes.
e2e_rollout_collection-
init_resources_serverInitialize a new resources server with template files and directory structure.
pip_listList packages installed in a server’s virtual environment.
reinstall-
runStart NeMo Gym servers for agents, models, and resources.
status-
test-
test_all-
versionDisplay gym version and system information.

API

class nemo_gym.cli.PipListConfig()

Bases: RunConfig

format
Optional[str]
outdated
bool
class nemo_gym.cli.RunConfig()

Bases: BaseNeMoGymCLIConfig

Start NeMo Gym servers for agents, models, and resources.

Examples:

config_paths="resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml,\
responses_api_models/openai_model/configs/openai_model.yaml"
ng_run "+config_paths=[${config_paths}]"
entrypoint
str
class nemo_gym.cli.RunHelper()
_head_server
Server
_head_server_instance
HeadServer
_head_server_thread
Thread
_processes
Dict[str, Popen]
_server_client
ServerClient
_server_instance_display_configs
List[ServerInstanceDisplayConfig]
nemo_gym.cli.RunHelper.check_http_server_statuses(
successful_servers: typing.List[str]
) -> typing.List[typing.Tuple[str, nemo_gym.server_utils.ServerStatus]]
nemo_gym.cli.RunHelper.display_server_instance_info() -> None
nemo_gym.cli.RunHelper.poll() -> None
nemo_gym.cli.RunHelper.run_forever() -> None
nemo_gym.cli.RunHelper.shutdown() -> None
nemo_gym.cli.RunHelper.start(
global_config_dict_parser_config: nemo_gym.global_config.GlobalConfigDictParserConfig
) -> None
nemo_gym.cli.RunHelper.wait_for_dry_run_spinup() -> None
nemo_gym.cli.RunHelper.wait_for_spinup() -> None
class nemo_gym.cli.TestAllConfig()

Bases: BaseNeMoGymCLIConfig

Run tests for all server modules in the project.

Examples:

ng_test_all
delete_venvs_after_each_test
bool
fail_on_total_and_test_mismatch
bool
class nemo_gym.cli.TestConfig()

Bases: RunConfig

Test a specific server module by running its pytest suite and optionally validating example data.

Examples:

ng_test +entrypoint=resources_servers/example_single_tool_call
_dir_path
Path
dir_path
Path
should_validate_data
bool
nemo_gym.cli.TestConfig.model_post_init(
context
)
class nemo_gym.cli.VersionConfig()

Bases: BaseNeMoGymCLIConfig

Display gym version and system information.

Examples:

# Display version information
ng_version
# Output as JSON
ng_version +json=true
json_format
bool
nemo_gym.cli._display_list_of_paths(
paths: typing.List[pathlib.Path]
) -> str
nemo_gym.cli._format_pct(
count: int,
total: int
) -> str
nemo_gym.cli._test_single(
test_config: nemo_gym.cli.TestConfig,
global_config_dict: omegaconf.DictConfig
) -> subprocess.Popen
nemo_gym.cli._validate_data_single(
test_config: nemo_gym.cli.TestConfig
) -> None
nemo_gym.cli.dev_test()

Run core NeMo Gym tests with coverage reporting (runs pytest with —cov flag).

Examples:

ng_dev_test
nemo_gym.cli.display_help()

Display a list of available NeMo Gym CLI commands.

Examples:

ng_help
nemo_gym.cli.dump_config()

Display the resolved Hydra configuration for debugging purposes.

Examples:

ng_dump_config "+config_paths=[<config1>,<config2>]"
nemo_gym.cli.e2e_rollout_collection()
nemo_gym.cli.init_resources_server()

Initialize a new resources server with template files and directory structure.

Examples:

ng_init_resources_server +entrypoint=resources_servers/my_server
nemo_gym.cli.pip_list()

List packages installed in a server’s virtual environment.

nemo_gym.cli.reinstall()
nemo_gym.cli.run(
global_config_dict_parser_config: typing.Optional[nemo_gym.global_config.GlobalConfigDictParserConfig] = None
)

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.

Examples:

# Start servers with specific configs
config_paths="resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml,\
responses_api_models/openai_model/configs/openai_model.yaml"
ng_run "+config_paths=[${config_paths}]"
nemo_gym.cli.status()
nemo_gym.cli.test()
nemo_gym.cli.test_all()
nemo_gym.cli.version()

Display gym version and system information.