CLI Commands
This page documents all available NeMo Gym CLI commands.
Each command has both a short form (such as ng_run) and a full form (such as nemo_gym_run). They are functionally identical.
Quick Reference
Server Management
Commands for running, testing, and managing NeMo Gym servers.
ng_run / nemo_gym_run
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
Example
ng_test / nemo_gym_test
Test a specific server module by running its pytest suite and optionally validating example data.
Parameters
Example
ng_test_all / nemo_gym_test_all
Run tests for all server modules in the project.
Parameters
Example
ng_dev_test / nemo_gym_dev_test
Run core NeMo Gym tests with coverage reporting. Runs pytest with the --cov flag.
Example
ng_init_resources_server / nemo_gym_init_resources_server
Initialize a new resources server with template files and directory structure.
Example
Data Collection
Commands for collecting verified rollouts for RL training.
ng_collect_rollouts / nemo_gym_collect_rollouts
Perform a batch of rollout collection.
Parameters
Example
Generation Parameters
Sampling parameters such as temperature, max_output_tokens, and top_p are not standalone CLI flags — they are passed as overrides inside responses_create_params using Hydra’s nested dot syntax. Overrides are merged into each input row’s existing responses_create_params with a shallow merge (top-level keys only):
The same syntax works for ng_e2e_collect_rollouts. Top-level fields such as temperature and max_output_tokens are straightforward. For nested objects (for example, ++responses_create_params.reasoning.effort=low), the entire nested dict replaces the row’s existing value at that key — other fields under the same nested object are not preserved.
Resume Interrupted Runs
Setting +resume_from_cache=true lets you restart the same command after a crash or interruption and pick up only the rows that have not finished yet. It works for both ng_collect_rollouts and ng_e2e_collect_rollouts, across any environment.
How it works:
- Materialized inputs. On the first run, the fully expanded input rows (after
num_repeats,limit,prompt_config, and any overrides) are written to a sidecar file next to your output. The path is derived fromoutput_jsonl_fpathby appending_materialized_inputsto the stem — sorollouts.jsonlproducesrollouts_materialized_inputs.jsonl. - Incremental output. Results are flushed to
output_jsonl_fpathafter each completed rollout, so partial output survives a crash. - Matching. On resume, completed work is matched by
(task_index, rollout_index)against the materialized inputs, and already-completed rows are skipped. The run prints a summary such as the number of original input rows, rows already done, and rows that still need to be run. - Fallback. If either the materialized inputs or the output file is missing, resume is skipped and the run starts fresh. With the default
resume_from_cache=False, existing output is cleared before the run.
If you change the config, schema, or data between runs, the materialized inputs become stale and resume will diff against the old expansion. Delete the *_materialized_inputs.jsonl file (and the output file) to start fresh.
ng_e2e_collect_rollouts / nemo_gym_e2e_collect_rollouts
Spin up all necessary servers and perform a batch of rollout collection using each dataset inside the provided configs.
Parameters
Examples
Example using GPT-OSS 120B remote vLLM endpoint
ng_reward_profile / nemo_gym_reward_profile
Computes statistics on rewards and task difficulty for rollouts collected with ng_collect_rollouts with num_repeats >1. This outputs a new “reward profiled” dataset, where each task in the dataset has metrics like the average reward, standard deviation, min/max, and pass rate. This is useful in filtering tasks before training for difficulty, variance, or creating a curriculum.
Parameters
Output Fields
Each output row contains all original task fields plus:
avg_reward: Average reward across all rolloutsstd_reward: Standard deviation of rewardsmin_reward: Minimum reward observedmax_reward: Maximum reward observedtotal_samples: Number of rollout samplespass_rate,pass_rate_total,pass_rate_passed,pass_threshold: (Only ifpass_thresholdis specified)
Example
Data Management
Commands for preparing and viewing training data.
ng_prepare_data / nemo_gym_prepare_data
Prepare and validate training data, generating metrics and statistics for datasets.
Parameters
Example
ng_materialize_prompts / nemo_gym_materialize_prompts
Apply a prompt template to raw JSONL data, producing materialized JSONL with populated responses_create_params.input for RL training.
Each input row must not already have a populated responses_create_params.input; the command applies the prompt template from prompt_config to each row, fills in the input, and preserves the row’s other fields.
Parameters
Example
Which data-preparation command should I use?
ng_materialize_prompts— a focused, standalone step that applies a prompt template to raw rows to populateresponses_create_params.input. No servers are started. Use it when you have raw data and just need to turn it into prompt-ready rows.ng_prepare_data— the full preparation pipeline for training: it can download missing datasets, validate data, and compute dataset metrics, writing train/validation splits and metrics artifacts. Use it to prepare and validate datasets for training or PR submission.
Dataset Registry - GitLab
Commands for uploading, downloading, and managing datasets in GitLab Model Registry.
ng_upload_dataset_to_gitlab / nemo_gym_upload_dataset_to_gitlab
Upload a local JSONL dataset artifact to GitLab.
Parameters
Example
ng_download_dataset_from_gitlab / nemo_gym_download_dataset_from_gitlab
Download a JSONL dataset from GitLab Model Registry.
Parameters
Example
ng_delete_dataset_from_gitlab / nemo_gym_delete_dataset_from_gitlab
Delete a dataset from GitLab Model Registry. Prompts for confirmation.
Parameters
Example
Dataset Registry - HuggingFace
Commands for uploading and downloading datasets to/from HuggingFace Hub.
ng_upload_dataset_to_hf / nemo_gym_upload_dataset_to_hf
Upload a JSONL dataset to HuggingFace Hub with optional GitLab deletion after successful upload.
Parameters
Example
ng_download_dataset_from_hf / nemo_gym_download_dataset_from_hf
Download a JSONL dataset from HuggingFace Hub to local filesystem.
Parameters
Example
ng_gitlab_to_hf_dataset / nemo_gym_gitlab_to_hf_dataset
Upload a JSONL dataset to HuggingFace Hub and automatically delete from GitLab after successful upload.
This command always deletes the dataset from GitLab after uploading to HuggingFace. Use ng_upload_dataset_to_hf if you want optional deletion control.
Parameters
Same as ng_upload_dataset_to_hf but delete_from_gitlab is not available. This command always deletes.
Example
Configuration & Help
Commands for debugging configuration and getting help.
ng_dump_config / nemo_gym_dump_config
Display the resolved Hydra configuration for debugging purposes.
Example
ng_help / nemo_gym_help
Display a list of available NeMo Gym CLI commands.
Example
ng_version / nemo_gym_version
Display NeMo Gym version and system information.
Parameters
Example
ng_pip_list / nemo_gym_pip_list
Each server has its own isolated virtual environment. To inspect the packages:
Parameters
Examples
ng_status / nemo_gym_status
View all currently running NeMo Gym servers and their health status.
Example
Getting Help
For detailed help on any command, run it with +help=true or +h=true:
This will display all available configuration parameters and their descriptions.
Re-install Gym and dependencies
This will re-install Gym and its dependencies into the currently activated Python virtual environment.