> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.config_types

## Module Contents

### Classes

| Name                                                                                                                      | Description                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [`AgentServerRef`](#nemo_gym-config_types-AgentServerRef)                                                                 | -                                                                                                       |
| [`AggregateMetrics`](#nemo_gym-config_types-AggregateMetrics)                                                             | Response from /aggregate\_metrics.                                                                      |
| [`AggregateMetricsRequest`](#nemo_gym-config_types-AggregateMetricsRequest)                                               | POST body for /aggregate\_metrics.                                                                      |
| [`AlmostServerError`](#nemo_gym-config_types-AlmostServerError)                                                           | One or more server blocks are almost-servers (right shape, failed validation) and                       |
| [`BaseNeMoGymCLIConfig`](#nemo_gym-config_types-BaseNeMoGymCLIConfig)                                                     | -                                                                                                       |
| [`BaseRunServerConfig`](#nemo_gym-config_types-BaseRunServerConfig)                                                       | -                                                                                                       |
| [`BaseRunServerInstanceConfig`](#nemo_gym-config_types-BaseRunServerInstanceConfig)                                       | -                                                                                                       |
| [`BaseRunServerTypeConfig`](#nemo_gym-config_types-BaseRunServerTypeConfig)                                               | -                                                                                                       |
| [`BaseServerConfig`](#nemo_gym-config_types-BaseServerConfig)                                                             | -                                                                                                       |
| [`BaseServerInstanceConfig`](#nemo_gym-config_types-BaseServerInstanceConfig)                                             | -                                                                                                       |
| [`BaseServerTypeConfig`](#nemo_gym-config_types-BaseServerTypeConfig)                                                     | -                                                                                                       |
| [`BaseUploadJsonlDatasetHuggingFaceConfig`](#nemo_gym-config_types-BaseUploadJsonlDatasetHuggingFaceConfig)               | Upload a JSONL dataset to HuggingFace Hub with automatic naming based on domain and resources server.   |
| [`BenchmarkDatasetConfig`](#nemo_gym-config_types-BenchmarkDatasetConfig)                                                 | -                                                                                                       |
| [`ConfigError`](#nemo_gym-config_types-ConfigError)                                                                       | Base for user-facing configuration errors.                                                              |
| [`ConfigMissingValuesError`](#nemo_gym-config_types-ConfigMissingValuesError)                                             | One or more required config values are still unset (OmegaConf '???') after merging.                     |
| [`ConfigPathNotFoundError`](#nemo_gym-config_types-ConfigPathNotFoundError)                                               | A `config_paths` entry could not be found in the cwd or the Gym install location.                       |
| [`DatasetConfig`](#nemo_gym-config_types-DatasetConfig)                                                                   | -                                                                                                       |
| [`DeleteJsonlDatasetGitlabConfig`](#nemo_gym-config_types-DeleteJsonlDatasetGitlabConfig)                                 | Delete a dataset from GitLab Model Registry (prompts for confirmation).                                 |
| [`Domain`](#nemo_gym-config_types-Domain)                                                                                 | The capability a resources server primarily evaluates or trains.                                        |
| [`DownloadJsonlDatasetGitlabConfig`](#nemo_gym-config_types-DownloadJsonlDatasetGitlabConfig)                             | Download a JSONL dataset from GitLab Model Registry.                                                    |
| [`DownloadJsonlDatasetHuggingFaceConfig`](#nemo_gym-config_types-DownloadJsonlDatasetHuggingFaceConfig)                   | Download a JSONL dataset from HuggingFace Hub to local filesystem.                                      |
| [`GitlabDatasetSource`](#nemo_gym-config_types-GitlabDatasetSource)                                                       | Unified `source:` for a dataset fetched from the GitLab model registry.                                 |
| [`HuggingFaceDatasetSource`](#nemo_gym-config_types-HuggingFaceDatasetSource)                                             | Unified `source:` for a dataset fetched from the HuggingFace Hub.                                       |
| [`InheritPathNotFoundError`](#nemo_gym-config_types-InheritPathNotFoundError)                                             | An `_inherit_from` / swap / copy directive references a config path that does not exist.                |
| [`JsonlDatasetGitlabIdentifer`](#nemo_gym-config_types-JsonlDatasetGitlabIdentifer)                                       | -                                                                                                       |
| [`JsonlDatasetHuggingFaceIdentifer`](#nemo_gym-config_types-JsonlDatasetHuggingFaceIdentifer)                             | -                                                                                                       |
| [`MalformedConfigPathsError`](#nemo_gym-config_types-MalformedConfigPathsError)                                           | `config_paths` was not a list of paths (e.g. a scalar string was passed).                               |
| [`ModelServerRef`](#nemo_gym-config_types-ModelServerRef)                                                                 | -                                                                                                       |
| [`NoServerInstancesError`](#nemo_gym-config_types-NoServerInstancesError)                                                 | A run was requested but the merged config defines no server instances to start.                         |
| [`ResourcesServerInstanceConfig`](#nemo_gym-config_types-ResourcesServerInstanceConfig)                                   | -                                                                                                       |
| [`ResourcesServerRef`](#nemo_gym-config_types-ResourcesServerRef)                                                         | -                                                                                                       |
| [`ResourcesServerTypeConfig`](#nemo_gym-config_types-ResourcesServerTypeConfig)                                           | -                                                                                                       |
| [`ResponsesAPIAgentServerInstanceConfig`](#nemo_gym-config_types-ResponsesAPIAgentServerInstanceConfig)                   | -                                                                                                       |
| [`ResponsesAPIAgentServerTypeConfig`](#nemo_gym-config_types-ResponsesAPIAgentServerTypeConfig)                           | -                                                                                                       |
| [`ResponsesAPIModelServerInstanceConfig`](#nemo_gym-config_types-ResponsesAPIModelServerInstanceConfig)                   | -                                                                                                       |
| [`ResponsesAPIModelServerTypeConfig`](#nemo_gym-config_types-ResponsesAPIModelServerTypeConfig)                           | -                                                                                                       |
| [`ServerRefNotFoundError`](#nemo_gym-config_types-ServerRefNotFoundError)                                                 | A server cross-reference points to an instance that is not defined in the merged config.                |
| [`UploadJsonlDatasetGitlabConfig`](#nemo_gym-config_types-UploadJsonlDatasetGitlabConfig)                                 | Upload a local jsonl dataset artifact to Gitlab.                                                        |
| [`UploadJsonlDatasetHuggingFaceConfig`](#nemo_gym-config_types-UploadJsonlDatasetHuggingFaceConfig)                       | Upload a JSONL dataset to HuggingFace Hub and automatically delete from GitLab after successful upload. |
| [`UploadJsonlDatasetHuggingFaceMaybeDeleteConfig`](#nemo_gym-config_types-UploadJsonlDatasetHuggingFaceMaybeDeleteConfig) | Upload a JSONL dataset to HuggingFace Hub with optional GitLab deletion after successful upload.        |
| [`WANDBConfig`](#nemo_gym-config_types-WANDBConfig)                                                                       | -                                                                                                       |

### Functions

| Name                                                                                          | Description                                                                       |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| [`is_almost_server`](#nemo_gym-config_types-is_almost_server)                                 | Detects if a config looks like a server but might fail validation.                |
| [`is_server_ref`](#nemo_gym-config_types-is_server_ref)                                       | -                                                                                 |
| [`maybe_get_server_instance_config`](#nemo_gym-config_types-maybe_get_server_instance_config) | Returns ServerInstanceConfig if a valid server, otherwise None with error details |

### Data

[`AGENT_REF_KEY`](#nemo_gym-config_types-AGENT_REF_KEY)

[`DatasetSource`](#nemo_gym-config_types-DatasetSource)

[`DatasetType`](#nemo_gym-config_types-DatasetType)

[`ServerInstanceConfig`](#nemo_gym-config_types-ServerInstanceConfig)

[`ServerInstanceConfigTypeAdapter`](#nemo_gym-config_types-ServerInstanceConfigTypeAdapter)

[`ServerRef`](#nemo_gym-config_types-ServerRef)

[`ServerRefTypeAdapter`](#nemo_gym-config_types-ServerRefTypeAdapter)

[`ServerTypeConfig`](#nemo_gym-config_types-ServerTypeConfig)

### API

```python
class nemo_gym.config_types.AgentServerRef()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.AggregateMetrics()
```

**Bases:** `BaseModel`

Response from /aggregate\_metrics.

Flat string keys for direct logging to W\&B/MLflow.

```python
class nemo_gym.config_types.AggregateMetricsRequest()
```

**Bases:** `BaseModel`

POST body for /aggregate\_metrics.

Each item is a stripped verify response dict containing at minimum:

* TASK\_INDEX\_KEY\_NAME: int
* "reward": float

```python
class nemo_gym.config_types.AlmostServerError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

One or more server blocks are almost-servers (right shape, failed validation) and
`error_on_almost_servers` is set, so the run is aborted.

```python
class nemo_gym.config_types.BaseNeMoGymCLIConfig()
```

**Bases:** `BaseModel`

```python
nemo_gym.config_types.BaseNeMoGymCLIConfig.pre_process(
    data
)
```

classmethod

```python
class nemo_gym.config_types.BaseRunServerConfig()
```

**Bases:** [BaseServerConfig](#nemo_gym-config_types-BaseServerConfig)

```python
class nemo_gym.config_types.BaseRunServerInstanceConfig()
```

**Bases:** [BaseRunServerConfig](#nemo_gym-config_types-BaseRunServerConfig)

```python
class nemo_gym.config_types.BaseRunServerTypeConfig()
```

**Bases:** [BaseRunServerConfig](#nemo_gym-config_types-BaseRunServerConfig)

```python
class nemo_gym.config_types.BaseServerConfig()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.BaseServerInstanceConfig()
```

**Bases:** [BaseServerTypeConfig](#nemo_gym-config_types-BaseServerTypeConfig)

```python
nemo_gym.config_types.BaseServerInstanceConfig.get_inner_run_server_config() -> nemo_gym.config_types.BaseRunServerTypeConfig
```

```python
nemo_gym.config_types.BaseServerInstanceConfig.get_inner_run_server_config_dict() -> omegaconf.DictConfig
```

```python
nemo_gym.config_types.BaseServerInstanceConfig.get_server_ref() -> nemo_gym.config_types.ServerRef
```

```python
nemo_gym.config_types.BaseServerInstanceConfig.validate_domain_for_resources_server() -> nemo_gym.config_types.BaseServerInstanceConfig
```

```python
class nemo_gym.config_types.BaseServerTypeConfig()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.BaseUploadJsonlDatasetHuggingFaceConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Upload a JSONL dataset to HuggingFace Hub with automatic naming based on domain and resources server.

Examples:

```python
resource_config_path="resources_servers/example_multi_step/configs/example_multi_step.yaml"
gym dataset upload         +dataset_name=my_dataset         +input_jsonl_fpath=data/train.jsonl         +resource_config_path=${resource_config_path}
```

```python
class nemo_gym.config_types.BenchmarkDatasetConfig()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.ConfigError()
```

Exception

**Bases:** `Exception`

Base for user-facing configuration errors.

These represent actionable user mistakes (typos, missing files, malformed input) rather than
internal bugs. The CLI catches `ConfigError` and prints just the message — no traceback —
while still leaving them as ordinary exceptions so callers like `validate` can catch and
format them.

```python
class nemo_gym.config_types.ConfigMissingValuesError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

One or more required config values are still unset (OmegaConf '???') after merging.

```python
class nemo_gym.config_types.ConfigPathNotFoundError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `FileNotFoundError`

A `config_paths` entry could not be found in the cwd or the Gym install location.

```python
class nemo_gym.config_types.DatasetConfig()
```

**Bases:** `BaseModel`

```python
nemo_gym.config_types.DatasetConfig.check_train_validation_sets() -> nemo_gym.config_types.DatasetConfig
```

```python
nemo_gym.config_types.DatasetConfig.normalize_dataset_source() -> nemo_gym.config_types.DatasetConfig
```

Reconcile the unified `source:` with the legacy `*_identifier` fields.

The unified `source:` block is mutually exclusive with the legacy identifiers. The two
legacy identifiers may still be set together (a gitlab-primary / huggingface-fallback pair
selected at download time by `config.data_source`) for backward compatibility. A legacy
identifier emits a deprecation warning and, when a single backend is given, is mirrored into
`source`; conversely a `source:` is mirrored back into the matching legacy field so existing
consumers that read `gitlab_identifier`/`huggingface_identifier` keep working.

```python
class nemo_gym.config_types.DeleteJsonlDatasetGitlabConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Delete a dataset from GitLab Model Registry (prompts for confirmation).

Examples:

```python
gym dataset rm +dataset_name=old_dataset
```

```python
class nemo_gym.config_types.Domain
```

**Bases:** `enum.Enum`

The capability a resources server primarily evaluates or trains.

Pick the single domain that best fits the task. If several seem to apply, choose the most
specific one (e.g. prefer `math` or `coding` over `agent`); use `other` only when none
of the specific values fit. The values:

* `math`                  — mathematical problem solving (e.g. AIME, MATH, GSM8K).
* `coding`                — code generation, repair, or execution (e.g. SWE-bench, LiveCodeBench).
* `agent`                 — multi-step, tool-using / environment-interacting tasks (e.g. tau2,
  workplace\_assistant). Prefer a more specific value when the task is really math/coding/etc.
* `knowledge`             — factual or domain-knowledge question answering (e.g. GPQA, MMLU).
* `instruction_following` — adherence to explicit formatting/constraints (e.g. IFEval).
* `long_context`          — reasoning over long inputs (e.g. RULER, long-document QA).
* `safety`                — refusing harmful content / resisting jailbreaks & prompt injection.
* `games`                 — interactive game environments (e.g. blackjack, tetris).
* `translation`           — machine translation quality (e.g. WMT).
* `e2e`                   — end-to-end pipelines spanning multiple capabilities at once.
* `rlhf`                  — preference / reward-model / LLM-as-judge evaluations.
* `other`                 — catch-all when no specific domain above applies.

```python
class nemo_gym.config_types.DownloadJsonlDatasetGitlabConfig()
```

**Bases:** [JsonlDatasetGitlabIdentifer](#nemo_gym-config_types-JsonlDatasetGitlabIdentifer), [BaseNeMoGymCLIConfig](#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Download a JSONL dataset from GitLab Model Registry.

Examples:

```python
gym dataset download --storage gitlab         +dataset_name=example_multi_step         +version=0.0.1         +artifact_fpath=train.jsonl         +output_fpath=data/train.jsonl
```

```python
class nemo_gym.config_types.DownloadJsonlDatasetHuggingFaceConfig()
```

**Bases:** [JsonlDatasetHuggingFaceIdentifer](#nemo_gym-config_types-JsonlDatasetHuggingFaceIdentifer), [BaseNeMoGymCLIConfig](#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Download a JSONL dataset from HuggingFace Hub to local filesystem.

Examples:

```python
gym dataset download         +repo_id=NVIDIA/NeMo-Gym-Math-example_multi_step-v1         +artifact_fpath=train.jsonl         +output_fpath=data/train.jsonl
```

```python
nemo_gym.config_types.DownloadJsonlDatasetHuggingFaceConfig.check_output_path() -> nemo_gym.config_types.DownloadJsonlDatasetHuggingFaceConfig
```

```python
class nemo_gym.config_types.GitlabDatasetSource()
```

**Bases:** `BaseModel`

Unified `source:` for a dataset fetched from the GitLab model registry.

```python
class nemo_gym.config_types.HuggingFaceDatasetSource()
```

**Bases:** `BaseModel`

Unified `source:` for a dataset fetched from the HuggingFace Hub.

```python
class nemo_gym.config_types.InheritPathNotFoundError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

An `_inherit_from` / swap / copy directive references a config path that does not exist.

```python
class nemo_gym.config_types.JsonlDatasetGitlabIdentifer()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.JsonlDatasetHuggingFaceIdentifer()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.MalformedConfigPathsError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

`config_paths` was not a list of paths (e.g. a scalar string was passed).

```python
class nemo_gym.config_types.ModelServerRef()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.NoServerInstancesError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

A run was requested but the merged config defines no server instances to start.

```python
class nemo_gym.config_types.ResourcesServerInstanceConfig()
```

**Bases:** [ResourcesServerTypeConfig](#nemo_gym-config_types-ResourcesServerTypeConfig), [BaseServerInstanceConfig](#nemo_gym-config_types-BaseServerInstanceConfig)

```python
class nemo_gym.config_types.ResourcesServerRef()
```

**Bases:** `BaseModel`

```python
class nemo_gym.config_types.ResourcesServerTypeConfig()
```

**Bases:** [BaseServerTypeConfig](#nemo_gym-config_types-BaseServerTypeConfig)

```python
class nemo_gym.config_types.ResponsesAPIAgentServerInstanceConfig()
```

**Bases:** [ResponsesAPIAgentServerTypeConfig](#nemo_gym-config_types-ResponsesAPIAgentServerTypeConfig), [BaseServerInstanceConfig](#nemo_gym-config_types-BaseServerInstanceConfig)

```python
class nemo_gym.config_types.ResponsesAPIAgentServerTypeConfig()
```

**Bases:** [BaseServerTypeConfig](#nemo_gym-config_types-BaseServerTypeConfig)

```python
class nemo_gym.config_types.ResponsesAPIModelServerInstanceConfig()
```

**Bases:** [ResponsesAPIModelServerTypeConfig](#nemo_gym-config_types-ResponsesAPIModelServerTypeConfig), [BaseServerInstanceConfig](#nemo_gym-config_types-BaseServerInstanceConfig)

```python
class nemo_gym.config_types.ResponsesAPIModelServerTypeConfig()
```

**Bases:** [BaseServerTypeConfig](#nemo_gym-config_types-BaseServerTypeConfig)

```python
class nemo_gym.config_types.ServerRefNotFoundError()
```

**Bases:** [ConfigError](#nemo_gym-config_types-ConfigError), `ValueError`

A server cross-reference points to an instance that is not defined in the merged config.

```python
class nemo_gym.config_types.UploadJsonlDatasetGitlabConfig()
```

**Bases:** [BaseNeMoGymCLIConfig](#nemo_gym-config_types-BaseNeMoGymCLIConfig)

Upload a local jsonl dataset artifact to Gitlab.

Examples:

```python
gym dataset upload --storage gitlab         +dataset_name=example_multi_step         +version=0.0.1         +input_jsonl_fpath=data/train.jsonl
```

```python
class nemo_gym.config_types.UploadJsonlDatasetHuggingFaceConfig()
```

**Bases:** [BaseUploadJsonlDatasetHuggingFaceConfig](#nemo_gym-config_types-BaseUploadJsonlDatasetHuggingFaceConfig)

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 `gym dataset upload` if you want optional deletion control.

Examples:

```python
resource_config_path="resources_servers/example_multi_step/configs/example_multi_step.yaml"
gym dataset migrate         +dataset_name=my_dataset         +input_jsonl_fpath=data/train.jsonl         +resource_config_path=${resource_config_path}
```

```python
nemo_gym.config_types.UploadJsonlDatasetHuggingFaceConfig.check_forbidden_fields(
    data
)
```

```python
class nemo_gym.config_types.UploadJsonlDatasetHuggingFaceMaybeDeleteConfig()
```

**Bases:** [BaseUploadJsonlDatasetHuggingFaceConfig](#nemo_gym-config_types-BaseUploadJsonlDatasetHuggingFaceConfig)

Upload a JSONL dataset to HuggingFace Hub with optional GitLab deletion after successful upload.

Examples:

```python
resource_config_path="resources_servers/example_multi_step/configs/example_multi_step.yaml"
gym dataset upload         +dataset_name=my_dataset         +input_jsonl_fpath=data/train.jsonl         +resource_config_path=${resource_config_path}         +delete_from_gitlab=true
```

```python
class nemo_gym.config_types.WANDBConfig()
```

**Bases:** `BaseModel`

```python
nemo_gym.config_types.is_almost_server(
    server_type_config_dict: typing.Any
) -> bool
```

Detects if a config looks like a server but might fail validation.

```python
nemo_gym.config_types.is_server_ref(
    config_dict: omegaconf.DictConfig
) -> typing.Optional[nemo_gym.config_types.ServerRef]
```

```python
nemo_gym.config_types.maybe_get_server_instance_config(
    name: str,
    server_type_config_dict: typing.Any
) -> typing.Tuple[typing.Optional[nemo_gym.config_types.ServerInstanceConfig], typing.Optional[pydantic.ValidationError]]
```

Returns ServerInstanceConfig if a valid server, otherwise None with error details

```python
nemo_gym.config_types.AGENT_REF_KEY = 'agent_ref'
```

```python
nemo_gym.config_types.DatasetSource = Annotated[Union[GitlabDatasetSource, HuggingFaceDatasetSource], Field(discrimina...
```

```python
nemo_gym.config_types.DatasetType = Union[Literal['train'], Literal['validation'], Literal['example']]
```

```python
nemo_gym.config_types.ServerInstanceConfig = Union[ResponsesAPIModelServerInstanceConfig, ResourcesServerInstanceConfig, Resp...
```

```python
nemo_gym.config_types.ServerInstanceConfigTypeAdapter = TypeAdapter(ServerInstanceConfig)
```

```python
nemo_gym.config_types.ServerRef = Union[ModelServerRef, ResourcesServerRef, AgentServerRef]
```

```python
nemo_gym.config_types.ServerRefTypeAdapter = TypeAdapter(ServerRef)
```

```python
nemo_gym.config_types.ServerTypeConfig = Union[ResponsesAPIModelServerTypeConfig, ResourcesServerTypeConfig, ResponsesAPI...
```