Skip to content

Commit fece4fe

Browse files
authored
docs: source: union, clean config errors, and new discovery/validate CLI commands (#1754)
Documents the config/CLI features merged for epic #1205 that were not yet reflected in the docs. Requested follow-up: a single doc PR covering the recently merged config/CLI work. ## What's documented | Area | Change | Merged in | |---|---|---| | `reference/cli-commands.mdx` | New `gym list environments`, `gym list agents`, and `gym env validate` sections (+ Quick-Reference entries) | #1635, #1671, #1599 | | `troubleshooting/configuration.mdx` | Three `config_paths` startup errors (Config Path Not Found, Malformed `config_paths`, No Server Instances) + a `gym env validate` pre-flight tip; corrected the stale `ServerRefNotFound` message | #1609, #1599 | | `data/index.mdx` | Unified dataset `source:` block + dedicated "Dataset `source`" subsection + legacy-deprecation note | #1637 | | `data/download-huggingface.mdx` | Auto-download example migrated to `source: { type: huggingface }` | #1637 | | `reference/faq.mdx` | Dataset example and field bullets rewritten around `source:` | #1637 | | `environment-tutorials/single-step-environment.mdx` | Scaffold comment updated to reference `source:` | #1637 | --------- Signed-off-by: Wojciech Prazuch <wprazuch@nvidia.com>
1 parent 610a08a commit fece4fe

7 files changed

Lines changed: 156 additions & 32 deletions

File tree

fern/versions/latest/pages/data/download-huggingface.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,15 @@ gym dataset download \
229229

230230
<Accordion title="Automatic Downloads During Data Preparation">
231231

232-
NeMo Gym can automatically download missing datasets during data preparation. Configure `huggingface_identifier` in your resources server config:
232+
NeMo Gym can automatically download missing datasets during data preparation. Declare a `source:` block (`type: huggingface`) in your resources server config:
233233

234234
```yaml
235235
datasets:
236236
- name: train
237237
type: train
238238
jsonl_fpath: resources_servers/code_gen/data/train.jsonl
239-
huggingface_identifier:
239+
source:
240+
type: huggingface
240241
repo_id: nvidia/nemotron-RL-coding-competitive_coding
241242
artifact_fpath: opencodereasoning_filtered_25k_train.jsonl
242243
license: Apache 2.0
@@ -253,7 +254,7 @@ gym dataset collate \
253254
+data_source=huggingface
254255
```
255256

256-
If `jsonl_fpath` doesn't exist locally, NeMo Gym downloads from `huggingface_identifier` before processing.
257+
If `jsonl_fpath` doesn't exist locally, NeMo Gym downloads from the dataset's `source:` (here, the Hugging Face `repo_id`) before processing. The legacy `huggingface_identifier:` block still works but is deprecated in favor of `source:`.
257258
</Accordion>
258259

259260
<Accordion title="Caching Behavior">

fern/versions/latest/pages/data/index.mdx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ datasets:
101101
- name: train
102102
type: train
103103
jsonl_fpath: resources_servers/workplace_assistant/data/train.jsonl
104-
huggingface_identifier:
104+
# Unified dataset source. `type` selects the backend; the other fields are backend-specific.
105+
source:
106+
type: huggingface
105107
repo_id: nvidia/Nemotron-RL-agent-workplace_assistant
106108
artifact_fpath: train.jsonl
107109
license: Apache 2.0
@@ -113,9 +115,33 @@ datasets:
113115
| `type` | Yes | `example`, `train`, or `validation` |
114116
| `jsonl_fpath` | Yes | Path to data file |
115117
| `license` | Train/validation | See valid values below |
116-
| `huggingface_identifier` | No | Remote download location |
118+
| `source` | No | Where to fetch the data from when it's missing locally (see below) |
117119
| `num_repeats` | No | Repeat count (default: `1`) |
118120

121+
### Dataset `source`
122+
123+
`source` is the unified way to declare where a dataset is fetched from. `type` selects the backend; the remaining fields are backend-specific:
124+
125+
```yaml
126+
# Hugging Face Hub
127+
source:
128+
type: huggingface
129+
repo_id: nvidia/Nemotron-RL-agent-workplace_assistant
130+
artifact_fpath: train.jsonl
131+
132+
# GitLab dataset registry
133+
source:
134+
type: gitlab
135+
dataset_name: example_multi_step
136+
version: 0.0.1
137+
artifact_fpath: train.jsonl
138+
```
139+
140+
<Note>
141+
The legacy `huggingface_identifier:` / `gitlab_identifier:` blocks still work (a deprecation warning is emitted), so existing configs keep running — but new configs should use `source:`.
142+
143+
</Note>
144+
119145
### Valid Licenses
120146

121147
`Apache 2.0` · `MIT` · `GNU General Public License v3.0` · `Creative Commons Attribution 4.0 International` · `Creative Commons Attribution-ShareAlike 4.0 International` · `TBD` · `NVIDIA Internal Use Only, Do Not Distribute`

fern/versions/latest/pages/environment-tutorials/single-step-environment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ my_weather_tool_simple_agent:
294294
type: example
295295
jsonl_fpath: resources_servers/my_weather_tool/data/example.jsonl
296296
# The scaffold also generates train/validation dataset entries
297-
# with gitlab_identifier blocks. Those are omitted here since
298-
# we only have example data at this stage.
297+
# (which can declare a `source:` block — the unified dataset source).
298+
# Those are omitted here since we only have example data at this stage.
299299
```
300300

301301
The `domain` field categorizes your resource server and is **required**. Common values: `math`, `coding`, `agent`, `knowledge`, `instruction_following`, `long_context`, `safety`, `games`, `e2e`, `other`.

fern/versions/latest/pages/reference/cli-commands.mdx

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ gym --help # list all command groups
1919
gym --version [--json] # print version and system info
2020
ng ... # 'ng' is an alias for 'gym'
2121

22-
# Discover benchmarks
23-
gym list benchmarks [--json] # list available benchmarks
24-
gym search <query> [--json] # filter the benchmark list by name
22+
# Discover
23+
gym list benchmarks [--json] # list available benchmarks
24+
gym list environments [--json] # list available environments by name
25+
gym list agents [--json] # list agent harnesses and how each composes
26+
gym search <query> [--json] # filter the benchmark list by name
2527

2628
# Datasets
2729
gym dataset upload # upload a prepared dataset to HF (default) or GitLab
@@ -34,9 +36,10 @@ gym dataset collate # validate and collate a dataset
3436
# Environments
3537
gym env init # scaffold a new resources server
3638
gym env resolve # resolve and print the final merged config
39+
gym env validate # validate a config (no Ray, no servers) — fast pre-flight check
3740
gym env packages # list packages in a server's virtual environment
3841
gym env test # test resources server(s); all of them if none is given
39-
gym env start # start the servers
42+
gym env start # start the servers
4043
gym env status # show running servers
4144

4245
# Evaluation
@@ -143,6 +146,32 @@ gym list benchmarks
143146
gym list benchmarks --json | jq '.[].name'
144147
```
145148

149+
### `gym list environments`
150+
151+
List the environments available under `environments/`, by short name (with their domain and description). The names map to `environments/<name>/config.yaml` and can be passed to `--environment` on commands like `gym env start` / `gym eval run`.
152+
153+
| Option | Description |
154+
| --- | --- |
155+
| `--json` | Output the environment list as JSON. |
156+
157+
```bash
158+
gym list environments
159+
gym list environments --json | jq '.[].name'
160+
```
161+
162+
### `gym list agents`
163+
164+
List the agent harnesses under `responses_api_agents/`, with each one's composition pattern — **composable** (Pattern A: references a separate resources server, so it can be wired into a matching environment) vs **self-contained** (Pattern B: ships its own framework/environment) — plus its config variants.
165+
166+
| Option | Description |
167+
| --- | --- |
168+
| `--json` | Output the agent list as JSON (includes the `self_contained` flag). |
169+
170+
```bash
171+
gym list agents
172+
gym list agents --json | jq '.[] | {name, self_contained}'
173+
```
174+
146175
### `gym search`
147176

148177
List benchmarks whose name, agent, resources server, dataset, or domain matches a query.
@@ -323,6 +352,26 @@ gym env resolve \
323352
++responses_create_params.temperature=0.6
324353
```
325354

355+
### `gym env validate`
356+
357+
Validate a config without starting Ray or any server subprocess — a fast pre-flight check that catches config mistakes (missing/malformed `config_paths`, unknown server cross-references, unset mandatory `???` values, schema errors) in well under a second instead of after a Ray bootstrap. Exits `0` when valid, or `1` with a clean message (no traceback) when not. A model config is **not** required — model interpolations resolve against a dummy model; pass one (or `--model-type`) if you want it validated too.
358+
359+
| Option | Description |
360+
| --- | --- |
361+
| `--config PATH` | Config file to load. Repeatable. |
362+
| `--environment NAME` / `--benchmark NAME` | Validate a named environment / benchmark config. |
363+
| `--resources-server NAME` | Validate a named resources server config. |
364+
| `--model-type NAME` | Also load a named model config (otherwise a dummy `policy_model` is used). |
365+
| `--model` / `--model-url` / `--model-api-key` | Override model name, base URL, and API key. |
366+
367+
```bash
368+
gym env validate --environment workplace_assistant
369+
gym env validate --benchmark gsm8k
370+
371+
# or explicit config path(s)
372+
gym env validate --config resources_servers/example_single_tool_call/configs/example_single_tool_call.yaml
373+
```
374+
326375
### `gym env packages`
327376

328377
Each server has its own isolated virtual environment. List the packages installed in a server's environment.

fern/versions/latest/pages/reference/configuration.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ my_resource: # Server ID (your choice — agent
5757
value: "What this improves" # Training value provided
5858
```
5959

60-
**Domain values:** `math`, `coding`, `agent`, `knowledge`, `instruction_following`, `long_context`, `safety`, `games`, `e2e`, `other` (see `Domain`)
60+
**Domain values:** `math`, `coding`, `agent`, `knowledge`, `instruction_following`, `long_context`, `safety`, `games`, `translation`, `e2e`, `rlhf`, `other` (see `Domain`)
6161

6262
### Agent Server Fields
6363

@@ -100,6 +100,7 @@ datasets:
100100
| `type` | Yes | `example`, `train`, or `validation` |
101101
| `jsonl_fpath` | Yes | Path to data file |
102102
| `license` | For train/validation | License identifier (see values below) |
103+
| `source` | No | Where to fetch the data from when it's missing locally. A `source:` block with `type: gitlab` (`dataset_name`, `version`, `artifact_fpath`) or `type: huggingface` (`repo_id`, optional `artifact_fpath`). Replaces the deprecated `gitlab_identifier:` / `huggingface_identifier:` blocks. |
103104
| `num_repeats` | No | Repeat dataset n times (default: `1`) |
104105

105106
**Dataset types:**

fern/versions/latest/pages/reference/faq.mdx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,27 +168,20 @@ example_multi_step_simple_agent:
168168
license: Apache 2.0
169169
jsonl_fpath: resources_servers/example_multi_step/data/train.jsonl
170170
num_repeats: 1
171-
gitlab_identifier:
171+
source:
172+
type: gitlab
172173
dataset_name: example_multi_step
173174
version: 0.0.1
174175
artifact_fpath: example_multi_step/train.jsonl
175-
huggingface_identifier:
176-
repo_id: nvidia/Nemotron-RL-instruction_following
177-
artifact_fpath: instruction_following.jsonl
178-
license: Apache 2.0
179176
- name: validation
180177
type: validation
181178
license: Apache 2.0
182179
jsonl_fpath: resources_servers/example_multi_step/data/validation.jsonl
183180
num_repeats: 1
184-
gitlab_identifier:
185-
dataset_name: example_multi_step
186-
version: 0.0.1
187-
artifact_fpath: example_multi_step/validation.jsonl
188-
huggingface_identifier:
181+
source:
182+
type: huggingface
189183
repo_id: nvidia/Nemotron-RL-instruction_following
190184
artifact_fpath: if_validation.jsonl
191-
license: Apache 2.0
192185
- name: example
193186
type: example
194187
jsonl_fpath: resources_servers/example_multi_step/data/example.jsonl
@@ -200,21 +193,22 @@ A dataset object consists of:
200193
- Type: train, validation, or example. Train and validation are as used in NeMo RL or other train frameworks. More information about the example type is in the next section.
201194
- Jsonl fpath: the local file path to your jsonl file for this dataset.
202195
- Num repeats: optionally repeat each row when preparing or collating data. Defaults to 1 if unspecified.
203-
- GitLab identifier: The remote path to the dataset as held in the GitLab dataset registry. This field is required for train and validation datasets. Not required for example datasets since those are required to be committed to Git.
204-
- Hugging Face identifier: The remote path to the dataset on Hugging Face. Contains `repo_id` (required) and optionally `artifact_fpath` for raw file repos. If `artifact_fpath` is omitted, the datasets library will infer the `split` from the dataset `type`.
196+
- Source: the unified `source:` block declaring where the dataset is fetched from when it's missing locally. `type` selects the backend:
197+
- `gitlab` — the GitLab dataset registry: `dataset_name`, `version`, `artifact_fpath`.
198+
- `huggingface` — the Hugging Face Hub: `repo_id` (required) and optionally `artifact_fpath` for raw-file repos (if omitted, the split is inferred from the dataset `type`).
199+
200+
Required for train and validation datasets; not for example datasets (those are committed to Git). The legacy `gitlab_identifier:` / `huggingface_identifier:` fields still work (with a deprecation warning) and may be set together as a gitlab-primary / huggingface-fallback pair, but `source:` is preferred for new configs.
205201
- License: The license of that dataset. Required for train and validation datasets; not required for example datasets.
206202
- Start idx, end idx: used for slicing your dataset.
207203
```yaml
208204
- name: train
209205
type: train
210206
jsonl_fpath: resources_servers/example_multi_step/data/train.jsonl
211-
gitlab_identifier:
207+
source:
208+
type: gitlab
212209
dataset_name: example_multi_step
213210
version: 0.0.1
214-
artifact_fpath: example_multi_step/validation.jsonl
215-
huggingface_identifier:
216-
repo_id: nvidia/example_multi_step
217-
artifact_fpath: example_validation.jsonl
211+
artifact_fpath: example_multi_step/train.jsonl
218212
license: Apache 2.0
219213
```
220214

fern/versions/latest/pages/troubleshooting/configuration.mdx

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ Did you mean: 'weather'?
5252
```
5353

5454
**When**: A server config references another server that doesn't exist or isn't loaded. The error
55-
names the referencing instance/field and, when a similarly named server exists, suggests it.
55+
names the referencing instance/field and then either suggests a similarly named server
56+
(`Did you mean: …`) or, when nothing is close, lists the available servers of that type
57+
(`Available resources_servers: …`).
5658

5759
**Common causes**:
5860
- Typo in the server name
@@ -70,6 +72,57 @@ gym env start \
7072
--config agent.yaml
7173
```
7274

75+
### Config Path Not Found
76+
77+
```
78+
nemo_gym.config_types.ConfigPathNotFoundError: config_paths entry 'resources_servers/weather/config.yaml' was not found. Looked in:
79+
- /path/to/cwd/resources_servers/weather/config.yaml
80+
- /path/to/gym/resources_servers/weather/config.yaml
81+
Check the path is spelled correctly and is relative to your working directory or the Gym install root.
82+
```
83+
84+
**When**: A `config_paths` entry (in a config file or a `--config` flag) points at a file that doesn't
85+
exist under any search root. The error lists every location that was searched.
86+
87+
**Fix**: Correct the path. A relative entry is resolved against your working directory and then the
88+
Gym install root, so running from the repository root usually fixes it; an absolute path also works.
89+
90+
### Malformed `config_paths`
91+
92+
```
93+
nemo_gym.config_types.MalformedConfigPathsError: 'config_paths' must be a list of paths. Got: 'resources_servers/weather/config.yaml'.
94+
Pass each config with --config (it builds the list for you), e.g.:
95+
gym env start --config resources_servers/<env>/configs/<env>.yaml
96+
```
97+
98+
**When**: `config_paths` is set to a scalar or mapping instead of a list of path strings.
99+
100+
**Fix**: Make it a YAML list, or pass each config with `--config`:
101+
102+
```yaml
103+
config_paths:
104+
- resources_servers/weather/config.yaml
105+
```
106+
107+
### No Server Instances Configured
108+
109+
```
110+
nemo_gym.config_types.NoServerInstancesError: No server instances are configured, so there is nothing to run. Pass one or more configs, e.g.:
111+
gym env start --config resources_servers/<env>/configs/<env>.yaml --config responses_api_models/<model>/configs/<model>.yaml
112+
```
113+
114+
**When**: The merged config defines no server instances — usually a wrong/empty `--config` or a
115+
`config_paths` list that resolved to nothing.
116+
117+
**Fix**: Pass the configs that define your servers, or check the `config_paths` entries actually load.
118+
119+
<Tip>
120+
Catch all of the above before launch with [`gym env validate`](/reference/cli-commands#gym-env-validate) — it
121+
merges and validates the same config `gym env start` uses, then exits with a clean message (no traceback)
122+
and a non-zero status on failure, so it fits in CI pre-flight checks.
123+
124+
</Tip>
125+
73126
---
74127

75128
## Validation Errors
@@ -86,7 +139,7 @@ Configuration Warnings: Almost-Servers Detected
86139

87140
- ResourcesServerInstanceConfig -> resources_servers -> example_server -> domain:
88141
Input should be 'math', 'coding', 'agent', 'knowledge', 'instruction_following',
89-
'long_context', 'safety', 'games', 'e2e' or 'other'
142+
'long_context', 'safety', 'games', 'translation', 'e2e', 'rlhf' or 'other'
90143
```
91144
92145
**When**: Config has the right structure (server type, entrypoint) but contains invalid field values.

0 commit comments

Comments
 (0)