Overview

Build your own custom environment
View as Markdown

Learn how to build custom environments for training or evaluation using NeMo Gym.

Looking to use an existing environment rather than build your own? See the Available Environments in the README.

Before diving in, review these foundational pages:


Tutorials

Start with the single-step tutorial, then progress through increasingly complex patterns:

The single-step tutorial is a hands-on walkthrough. The multi-step, stateful, and real-world tutorials are pattern-oriented deep dives — each explains a key concept through annotated source excerpts and rollout transcripts from existing example servers.


Environment Properties

Training environments can be broadly characterized along five dimensions:

  1. Rollout structure: The interaction pattern between the model, environment, and user.
  2. Core capabilities: The behaviors or skills that a model needs in order to succeed in a given use case.
  3. Knowledge domain: What subject area, area of expertise, or field of study is involved.
  4. Task type: The high-level use case that is represented in the training environment.
  5. Verification method: How the environment computes rewards from model responses.

Below are a subset of rollout structures and core capabilities found across NeMo Gym environments. We plan to add these as structured metadata to environments in the future. If you have ideas for additional properties, please let us know by opening an issue.

Rollout Structure

Rollout structureDescription
Multi-stepInterleaved assistant and tool messages
Multi-turnInterleaved user and assistant messages
Multi-modalInterleaved text, image, video, and/or audio messages
Long contextMessage content is very large or the number of messages is very large

Core Capabilities

Core capabilityDeveloper/User needRollout Structures Required
Information dependencyThe model receives environment responses that may require changes to subsequent actions.Multi-step
Proactive askingDevelopers put the model in a situation where user context is missing. The model needs to recognize user context is missing and ask the user for the missing context.Multi-turn
Schema adherenceUsers need more than one piece of information delivered by the model at one time in a specified delivery format.
Meta data instruction followingUser constrains the meta-properties of the model response e.g. “respond in 5 words”.
Counterintuitive instruction followingUser provides instructions that are against conventional wisdom, typically making sense in the specific context in which the model is being used
Information relevanceGiven a large volume of inputs, the model needs to ignore content irrelevant to the task at hand.Long context
Multiple intent synthesisUsers provide multiple tasks for the model to accomplish.Multi-step, Multi-turn