> 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.

# Gym Configuration

Before running GRPO training, you need to configure how NeMo RL connects to NeMo Gym. The training config file contains Gym-specific parameters that control data loading, environment interaction, and validation.

**Goal**: Understand the Gym configuration parameters for RL training.

**Time**: \~10 minutes (read)

**In this section, you will learn**:

1. How to configure data paths for training and validation
2. How to enable and configure NeMo Gym in NeMo RL

## Prerequisites

* Read [About Workplace Assistant](/tutorials/training-tutorials/nemo-rl-grpo/about-workplace-assistant) to understand the training environment

---

## Configuration File Location

The full training configuration file lives in the [NeMo RL repository](https://github.com/NVIDIA-NeMo/RL), not in NeMo Gym:

[`examples/nemo_gym/grpo_workplace_assistant_nemotron_nano_v2_9b.yaml`](https://github.com/NVIDIA-NeMo/RL/blob/main/examples/nemo_gym/grpo_workplace_assistant_nemotron_nano_v2_9b.yaml)

Paths in that file are relative to the NeMo RL repo root. After [Setup](/tutorials/training-tutorials/nemo-rl-grpo/setup), NeMo Gym is checked out inside that repo at `3rdparty/Gym-workspace/Gym/`, which is why the data paths below point there.

---

## Gym Configuration Sections

There are two Gym-specific sections in the NeMo RL training config: `data` and `env`.

### Data Section

```yaml
data:
  train:
    data_path: 3rdparty/Gym-workspace/Gym/data/workplace_assistant/train.jsonl
  validation:
    data_path: 3rdparty/Gym-workspace/Gym/data/workplace_assistant/validation.jsonl
  default:
    dataset_name: NemoGymDataset
    env_name: "nemo_gym"
    processor: "nemo_gym_data_processor"
```

| Parameter              | Description                                                                                           |
| ---------------------- | ----------------------------------------------------------------------------------------------------- |
| `train.data_path`      | Path to training dataset (created later in [Setup](/tutorials/training-tutorials/nemo-rl-grpo/setup)) |
| `validation.data_path` | Path to validation dataset                                                                            |
| `default.dataset_name` | Must be `NemoGymDataset` so NeMo RL reads Gym-format JSONL                                            |
| `default.env_name`     | Must be `nemo_gym` so batches are routed to the Gym environment                                       |
| `default.processor`    | Must be `nemo_gym_data_processor`                                                                     |

### Environment Section

```yaml
env:
  should_use_nemo_gym: true
  should_log_nemo_gym_responses: true
  should_mask_flagged_samples: true
  nemo_gym:  # This is passed into NeMo Gym as the initial_global_config_dict
    port_range_low: 5000
    port_range_high: 5999
    is_trajectory_collection: false
    config_paths:
    - responses_api_models/vllm_model/configs/vllm_model_for_training.yaml
    - resources_servers/workplace_assistant/configs/workplace_assistant.yaml
```

| Parameter                                     | Description                                                                                                      |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `should_use_nemo_gym`                         | Set to `true` to enable Gym                                                                                      |
| `should_log_nemo_gym_responses`               | `true` skips writing the large per-step `train_data_step*.jsonl` files; prefer `true` if disk is tight           |
| `should_mask_flagged_samples`                 | `false` ignores environment `mask_sample` flags so the loss trains on every sample                               |
| `nemo_gym`                                    | Everything under this key is passed to Gym as its global config                                                  |
| `nemo_gym.port_range_low` / `port_range_high` | Port range for Gym HTTP servers, kept clear of NeMo RL (3000-4999) and vLLM (7000-8999)                          |
| `nemo_gym.is_trajectory_collection`           | Set to `true` to collect trajectories without training                                                           |
| `nemo_gym.config_paths`                       | Gym config files, relative to the Gym checkout: vLLM model config and Workplace Assistant agent/resources config |

The `vllm_model_for_training.yaml` config is required for NeMo RL training integration.

Agent behavior such as `max_steps` is **not** set in the NeMo RL config. It comes from the Gym-side config listed in `config_paths` — for this tutorial, `max_steps: 6` under `workplace_assistant_simple_agent.responses_api_agents.simple_agent` in `resources_servers/workplace_assistant/configs/workplace_assistant.yaml`.

To override a Gym config value from NeMo RL, nest it under `env.nemo_gym` using the same key path as the Gym config. The upstream example does this for the policy model:

```yaml
env:
  nemo_gym:
    policy_model:
      responses_api_models:
        vllm_model:
          uses_reasoning_parser: false
          extra_body:
            chat_template_kwargs:
              enable_thinking: false
```

---

## Next Steps

With the Gym configuration understood, learn about the GRPO training parameters: