- Notifications
You must be signed in to change notification settings - Fork3
Build RL environments for LLM training
License
NVIDIA-NeMo/Gym
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
NeMo Gym is a framework for building reinforcement learning environments to train large language models.
NeMo Gym is a component of theNVIDIA NeMo Framework, NVIDIA’s GPU-accelerated platform for building and training generative AI models.
- Scaffolding and patterns to accelerate environment development: multi-step, multi-turn, and user modeling scenarios
- Contribute environments without expert knowledge of the entire RL training loop
- Test environment and throughput end-to-end independent of the RL training loop
- Interoperable with existing environments, systems and RL training frameworks
- Growing collection of training environments and datasets to enable Reinforcement Learning from Verifiable Reward (RLVR)
Important
NeMo Gym is currently in early development. You should expect evolving APIs, incomplete documentation, and occasional bugs. We welcome contributions and feedback - for any changes, please open an issue first to kick off discussion!
git clone git@github.com:NVIDIA-NeMo/Gym.gitcd Gym# Install dependenciescurl -LsSf https://astral.sh/uv/install.sh| shsource$HOME/.local/bin/envuv venv --python 3.12&&source .venv/bin/activateuv sync --extra dev --group docs# Configure your model API accessecho"policy_base_url: https://api.openai.com/v1policy_api_key: your-openai-api-keypolicy_model_name: gpt-4.1-2025-04-14"> env.yaml
Terminal 1 (start servers):
# Start servers (this will keep running)config_paths="resources_servers/example_simple_weather/configs/simple_weather.yaml,\responses_api_models/openai_model/configs/openai_model.yaml"ng_run"+config_paths=[${config_paths}]"
Terminal 2 (interact with agent):
# In a NEW terminal, activate environmentsource .venv/bin/activate# Interact with your agentpython responses_api_agents/simple_agent/client.py
Terminal 2 (keep servers running in Terminal 1):
# Create a simple dataset with one queryecho'{"responses_create_params":{"input":[{"role":"developer","content":"You are a helpful assistant."},{"role":"user","content":"What is the weather in Seattle?"}]}}'> weather_query.jsonl# Collect verified rolloutsng_collect_rollouts \ +agent_name=simple_weather_simple_agent \ +input_jsonl_fpath=weather_query.jsonl \ +output_jsonl_fpath=weather_rollouts.jsonl# View the resultcat weather_rollouts.jsonl| python -m json.tool
This generates training data with verification scores!
Terminal 1 with the running servers: Ctrl+C to stop the ng_run process.
- Documentation - Technical reference docs
- Tutorials - Hands-on tutorials and practical examples
We'd love your contributions! Here's how to get involved:
- Report Issues - Bug reports and feature requests
- Contributing Guide - How to contribute code, docs, or new environments
If you use NeMo Gym in your research, please cite it using the following BibTeX entry:
@misc{nemo-gym,title ={NeMo Gym: An Open Source Framework for Scaling Reinforcement Learning Environments for LLM},howpublished ={\url{https://github.com/NVIDIA-NeMo/Gym}},year ={2025},note ={GitHub repository},}
NeMo Gym includes a curated collection of resource servers for training and evaluation across multiple domains:
Purpose: Demonstrate NeMo Gym patterns and concepts.
| Name | Demonstrates | Config | README |
|---|---|---|---|
| Multi Step | Instruction_Following example | example_multi_step.yaml | README |
| Simple Weather | Basic single-step tool calling | simple_weather.yaml | README |
| Stateful Counter | Session state management (in-memory) | stateful_counter.yaml | README |
Purpose: Training-ready environments with curated datasets.
Tip
Each resource server includes example data, configuration files, and tests. See each server's README for details.
| Resource Server | Domain | Dataset | Description | Value | Config | Train | Validation | License |
|---|---|---|---|---|---|---|---|---|
| Google Search | agent | Nemotron-RL-knowledge-web_search-mcqa | Multi-choice question answering problems with search tools integrated | Improve knowledge-related benchmarks with search tools | config | ✓ | - | Apache 2.0 |
| Math Advanced Calculations | agent | Nemotron-RL-math-advanced_calculations | An instruction following math environment with counter-intuitive calculators | Improve instruction following capabilities in specific math environments | config | ✓ | - | Apache 2.0 |
| Workplace Assistant | agent | Nemotron-RL-agent-workplace_assistant | Workplace assistant multi-step tool-using environment | Improve multi-step tool use capability | config | ✓ | ✓ | Apache 2.0 |
| Mini Swe Agent | coding | SWE-bench_Verified | A software development with mini-swe-agent orchestration | Improve software development capabilities, like SWE-bench | config | ✓ | ✓ | MIT |
| Instruction Following | instruction_following | Nemotron-RL-instruction_following | Instruction following datasets targeting IFEval and IFBench style instruction following capabilities | Improve IFEval and IFBench | config | ✓ | - | Apache 2.0 |
| Structured Outputs | instruction_following | Nemotron-RL-instruction_following-structured_outputs | Check if responses are following structured output requirements in prompts | Improve instruction following capabilities | config | ✓ | ✓ | Apache 2.0 |
| Equivalence Llm Judge | knowledge | Nemotron-RL-knowledge-openQA | Short answer questions with LLM-as-a-judge | Improve knowledge-related benchmarks like GPQA / HLE | config | ✓ | - | Apache 2.0 |
| Mcqa | knowledge | Nemotron-RL-knowledge-mcqa | Multi-choice question answering problems | Improve benchmarks like MMLU / GPQA / HLE | config | ✓ | - | Apache 2.0 |
| Math With Judge | math | Nemotron-RL-math-OpenMathReasoning | Math dataset with math-verify and LLM-as-a-judge | Improve math capabilities including AIME 24 / 25 | config | ✓ | ✓ | Creative Commons Attribution 4.0 International |
About
Build RL environments for LLM training
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.