Skip to content

Repository files navigation

NeMo Gym

RequirementsQuick StartAvailable EnvironmentsDocumentation & ResourcesCommunity & SupportCitations

NeMo Gym is a library for building reinforcement learning (RL) training environments for large language models (LLMs). It provides infrastructure to develop environments, scale rollout collection, and integrate seamlessly with your preferred training framework.

🏆 Why NeMo Gym?

  • 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 environments 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 for 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!

🔗 Ecosystem

NeMo Gym is part of NVIDIA NeMo, NVIDIA's GPU-accelerated platform for building and training generative AI models. NeMo Gym integrates with a growing number of RL training frameworks and environment libraries; see the Ecosystem page for full details and tutorials.

Training Frameworks:NeMo RLOpenRLHFUnslothmore →

Environment Libraries:Reasoning GymAviarymore →

📋 Requirements

NeMo Gym is designed to run on standard development machines:

Hardware RequirementsSoftware Requirements
GPU: Not required for NeMo Gym library operation
• GPU may be needed for specific resources servers or model inference (see individual server documentation)
Operating System:
• Linux (Ubuntu 20.04+, or equivalent)
• macOS (11.0+ for x86_64, 12.0+ for Apple Silicon)
• Windows (via WSL2)
CPU: Any modern x86_64 or ARM64 processor (e.g., Intel, AMD, Apple Silicon)Python: 3.12 or higher
RAM: Minimum 8 GB (16 GB+ recommended for larger environments)Git: For cloning the repository
Storage: Minimum 5 GB free disk space for installation and basic usageInternet Connection: Required for downloading dependencies and API access

Additional Requirements

  • API Keys: OpenAI API key with available credits (for the quickstart examples)
    • Other model providers supported (Azure OpenAI, self-hosted models via vLLM)
  • Ray: Automatically installed as a dependency (no separate setup required)

🚀 Quick Start

Install NeMo Gym, start the servers, and collect your first verified rollouts for RL training.

Setup

# Clone the repository
git clone git@github.com:NVIDIA-NeMo/Gym.git
cd Gym
# Install UV (Python package manager)
curl -LsSf https://astral.sh/uv/install.sh | sh
source$HOME/.local/bin/env
# Create virtual environment
uv venv --python 3.12
source .venv/bin/activate
# Install NeMo Gym
uv sync --extra dev --group docs

Configure Your API Key

Create an env.yaml file that contains your OpenAI API key and the policy model you want to use. Replace your-openai-api-key with your actual key. This file helps keep your secrets out of version control while still making them available to NeMo Gym.

echo"policy_base_url: https://api.openai.com/v1policy_api_key: your-openai-api-keypolicy_model_name: gpt-4.1-2025-04-14"> env.yaml

Note

We use GPT-4.1 in this quickstart because it provides low latency (no reasoning step) and works reliably out-of-the-box. NeMo Gym is not limited to OpenAI models—you can use self-hosted models via vLLM or any OpenAI-compatible inference server. See the documentation for details.

Start Servers

Terminal 1 (start servers):

# Start servers (this will keep running)
config_paths="resources_servers/example_single_tool_call/configs/example_single_tool_call.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 agent
python responses_api_agents/simple_agent/client.py

Collect Rollouts

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 rollouts
ng_collect_rollouts \
+agent_name=example_single_tool_call_simple_agent \
+input_jsonl_fpath=weather_query.jsonl \
+output_jsonl_fpath=weather_rollouts.jsonl
# View the result
cat weather_rollouts.jsonl | python -m json.tool

This generates training data with verification scores!

Clean Up Servers

Terminal 1 with the running servers: Ctrl+C to stop the ng_run process.

Next Steps

Now that you can generate rollouts, choose your path:

  • Start training — Train models using NeMo Gym with your preferred RL framework. See the Training Tutorials.

  • Use an existing environment — Browse the Available Environments below to find an environment that matches your goals.

  • Build a custom environment — Implement or integrate existing tools and define task verification logic. Get started with the Creating a Training Environment tutorial.

📦 Available Environments

NeMo Gym includes a curated collection of environments for training and evaluation across multiple domains:

Example Environment Patterns

Purpose: Demonstrate NeMo Gym patterns and concepts.

NameDemonstratesConfigREADME
Multi StepMulti-step tool callingexample_multi_step.yamlREADME
Session State MgmtSession state management (in-memory)example_session_state_mgmt.yamlREADME
Single Tool CallBasic single-step tool callingexample_single_tool_call.yamlREADME

Environments for Training & Evaluation

Purpose: Training-ready environments with curated datasets.

Each resources server includes example data, configuration files, and tests. See each server's README for details.

The Dataset column links to publicly available datasets (e.g., on HuggingFace). A - means the train/validation data has not been publicly released yet, or that it is procedurally generated using a provided script. If no data is released yet, new data can be generated, or the environment can be used as a reference. Each server includes 5 example tasks in data/example.jsonl.

Resources ServerDomainDescriptionValueTrainValidationLicenseConfigDataset
Aalcrother-----aalcr.yaml-
AbstentionrlhfTrain models to abstain when unsure using three-tier reward on HotPotQA with LLM judgeImprove calibration by rewarding abstention over incorrect answersCreative Commons Attribution-ShareAlike 4.0 Internationalabstention.yaml-
Arc AgiknowledgeSolve puzzles designed to test intelligence. See https://arcprize.org/arc-agi.Improve puzzle-solving capabilities.--arc_agi.yaml-
AviaryagentMulti-hop question answering on the HotPotQA dataset with Wikipedia searchImprove knowledge and agentic capabilityApache 2.0hotpotqa_aviary.yaml-
AviarymathGSM8k benchmark with calculator toolTest math and agentic capabilityApache 2.0gsm8k_aviary.yaml-
CalendaragentMulti-turn calendar scheduling dataset. User states events and constraints in natural language; model schedules events to satisfy all constraints.Improve multi-turn instruction following capabilitiesApache 2.0calendar.yamlNemotron-RL-agent-calendar_scheduling
CalendaragentMulti-turn calendar scheduling dataset. User states events and constraints in natural language; model schedules events to satisfy all constraints.Improve multi-turn instruction following capabilitiesCreative Commons Attribution 4.0 Internationalcalendar_v2.yamlNemotron-RL-Instruction-Following-Calendar-v2
Circle ClickotherClick on circles in images----circle_click.yaml-
Code GencodingModel must submit the right code to solve a problemImprove competitive coding capabilitiesApache 2.0code_gen.yamlnemotron-RL-coding-competitive_coding
Equivalence Llm JudgeagentShort bash command generation questions with LLM-as-a-judgeImprove foundational bash and IF capabilitiesGNU General Public License v3.0nl2bash-equivalency.yaml-
Equivalence Llm JudgeknowledgeShort answer questions with LLM-as-a-judgeImprove knowledge-related benchmarks like GPQA / HLE---equivalence_llm_judge.yaml-
Ether0knowledgeether0 chemistry benchmark verifiersEvalutate chemistry knowledge and reasoning with ether0 benchmark--ether0.yaml-
Finance Sec SearchagentSEC EDGAR filing search for financial analysis questionsEnable LLMs to search and analyze SEC filings---finance_sec_search.yaml-
Genrm ComparerlhfGenRM pairwise comparison for RLHF trainingCompare multiple candidate responses using GenRM model---genrm_compare.yaml-
Google SearchagentMulti-choice question answering problems with search tools integratedImprove knowledge-related benchmarks with search tools-Apache 2.0google_search.yamlNemotron-RL-knowledge-web_search-mcqa
Gpqa DiamondknowledgeGPQA Diamond multiple-choice question answering problemsEvaluate graduate-level scientific reasoning via MCQ verification-MITgpqa_diamond.yaml-
Instruction Followinginstruction_followingInstruction following datasets targeting IFEval and IFBench style instruction following capabilitiesImprove IFEval and IFBench-Apache 2.0instruction_following.yamlNemotron-RL-instruction_following
Jailbreak DetectionsafetyJailbreak detection with Nemotron judge + combined reward---jailbreak_detection_nemotron_combined_reward_tp8.yaml-
Math Advanced CalculationsagentAn instruction following math environment with counter-intuitive calculatorsImprove instruction following capabilities in specific math environments-Apache 2.0math_advanced_calculations.yamlNemotron-RL-math-advanced_calculations
Math Formal LeanmathLean4 formal proof verification environmentImprove formal theorem proving capabilities-Apache 2.0nemotron_clean_easy.yaml-
Math Formal LeanmathLean4 formal proof verification environmentImprove formal theorem proving capabilities-Apache 2.0nemotron_first_try_hard.yaml-
Math Formal LeanmathLean4 formal proof verification environmentImprove formal theorem proving capabilities-Apache 2.0nemotron_medium_500.yaml-
Math Formal LeanmathLean4 formal proof verification environmentImprove formal theorem proving capabilities-Apache 2.0nemotron_very_easy.yaml-
Math Formal LeanmathLean4 formal proof verification environmentImprove formal theorem proving capabilities-MITmath_formal_lean.yaml-
Math Formal LeanmathLean4 formal proof verification environment with multi-turn self-correctionImprove formal theorem proving capabilities-MITmath_formal_lean_multi_turn.yaml-
Math With CodemathModel solves competitive math problems using simple calculator toolsImprove math and simple tool use capabilities-Apache 2.0math_with_code.yaml-
Math With JudgemathDAPO17k math dataset with math-verifyImprove math capabilities including AIME 24 / 25Apache 2.0dapo17k.yaml-
Math With JudgemathMathStackOverflow math dataset with math-verifyImprove math capabilities including AIME 24 / 25Creative Commons Attribution-ShareAlike 4.0 Internationalmath_stack_overflow.yamlNemotron-RL-math-stack_overflow
Math With JudgemathOpenMathReasoning math dataset with math-verify and LLM-as-a-judgeImprove math capabilities including AIME 24 / 25Creative Commons Attribution 4.0 Internationalmath_with_judge.yamlNemotron-RL-math-OpenMathReasoning
McqaknowledgeMulti-choice question answering problemsImprove benchmarks like MMLU / GPQA / HLEApache 2.0mcqa.yamlNemotron-RL-knowledge-mcqa
Mini Swe AgentcodingA software development with mini-swe-agent orchestrationImprove software development capabilities, like SWE-benchMITmini_swe_agent.yamlSWE-Gym
MultichallengeknowledgeTargets inference memory, instruction retention, version editing, and self-coherence.Improve complex multi-turn conversational capability-Creative Commons Attribution 4.0 Internationalmultichallenge_nrl.yamlNemotron-RL-Instruction-Following-MultiTurnChat-v1
Newton BenchmathScientific law discovery tasks through agentic experimentation across 12 physics domainsImprove science, reasoning, and tool use capabilities-Apache 2.0newton_bench.yaml-
Ns ToolsagentNeMo Skills tool execution with math verification----ns_tools.yaml-
NvarcknowledgeARC-AGI inductive mode: model outputs Python code with transform()Improve ARC-AGI puzzle-solving by inducing executable transformation programsApache 2.0inductive.yaml-
NvarcknowledgeARC-AGI transductive mode: model outputs grid directlyImprove ARC-AGI puzzle-solving by directly predicting transformed gridsApache 2.0transductive.yaml-
OpenenvagentEcho environment via OpenEnv (MCP). Echoes messages back with length-based rewards.----openenv_echo.yaml-
OpenenvcodingPython code execution environment via OpenEnv. Executes code and returns stdout/stderr.----openenv_coding.yaml-
OpenenvgamesMaze navigation environment via OpenEnv. Agent navigates an 8x8 grid to find the exit.----openenv_maze.yaml-
Over Refusal Detection---TBDover_refusal_detection.yaml-
Proof GenselectmathPairwise proof selection with binary correctness reward----proof_genselect.yaml-
Proof JudgemathTheorem proving with verifier + meta-verifier judge (combined env)----proof_judge.yaml-
Proof VerificationmathProof verification scored against ground truth and meta-verifier agreement----proof_verification.yaml-
Rdkit ChemistryknowledgeMolecular chemistry question answering: calculate properties of SMILES. Includes a mix of tool-use (python + rdkit) and no-tool-use questions.Improve molecular reasoning and SMILES parsing.-TBDrdkit_chemistry.yaml-
Reasoning GymknowledgeLangGraph orchestrator agent compatible with resource servers that do not use tools; enables diverse agent training data and test time scaling vs a simple agent, extensible to use tools or other agent architecturesIterative test time scaling for improved performance in reasoning tasks-Apache 2.0orchestrator_agent.yaml-
Reasoning GymknowledgeLangGraph parallel thinking agent compatible with resource servers that do not use tools; enables diverse agent training data and test time scaling vs a simple agent, extensible to use tools or other agent architecturesIterative test time scaling for improved performance in reasoning tasks-Apache 2.0parallel_thinking_agent.yaml-
Reasoning GymknowledgeLangGraph reflection agent compatible with resource servers that do not use tools; provides iterative reflection for diverse agent training data and test time scaling, extensible to use tools or other agent architecturesIterative test time scaling for improved performance in reasoning tasks-Apache 2.0reflection_agent.yaml-
Reasoning GymknowledgeLangGraph ReWOO agent compatible with resource servers that do not use tools; enables diverse agent training data and test time scaling vs a simple agent, extensible to use tools or other agent architecturesIterative test time scaling for improved performance in reasoning tasks-Apache 2.0rewoo_agent.yaml-
Reasoning GymknowledgeOver 100 tasks including algebra, arithmetic, computation, cognition, geometry, graph theory, logic, and many common games.Improve robustness, generalization, broad knowledge and reasoning-Creative Commons Attribution 4.0 Internationalreasoning_gym.yamlNemotron-RL-ReasoningGym-v1
Rulerother-----ruler.yaml-
Single Step Tool Use With Argument ComparisonagentConversational tool-use RL from expert trajectories; behavior cloning per step across auth, lookup, and servicing domains.-Creative Commons Attribution 4.0 Internationalsingle_step_tool_use_with_argument_comparison.yamlNemotron-RL-Agentic-Conversational-Tool-Use-Pivot-v1
Single Step Tool Use With Argument ComparisonagentGeneral function-calling RL dataset using expert trajectories; behavior cloning to match expert tool calls per step.-Creative Commons Attribution 4.0 Internationaltoolcall_schema_single_step_tool_use_with_argument_comparison.yamlNemotron-RL-Agentic-Function-Calling-Pivot-v1
Single Step Tool Use With Argument ComparisonagentGitHub-issue dataset for software-engineering agents; refactored from SWE-Gym and SWE-Bench-Verified for NeMo Gym.-Creative Commons Attribution 4.0 Internationalswe_pivot_single_step_tool_use_with_argument_comparison.yamlNemotron-RL-Agentic-SWE-Pivot-v1
Single Step Tool Use With Argument ComparisonagentThe model must output the next correct call in a given trajectory involving search tools.Improve agentic search capability.Apache 2.0search_pivot_single_step_tool_use_with_argument_comparison.yaml-
Spider2 LitecodingText-to-SQL with execution-based evaluation on Spider 2.0-Lite (135 SQLite tasks). Binary reward based on result-set equivalence.Improve text-to-SQL capabilities for real-world enterprise queries using execution-based binary reward without an LLM judge.--spider2_lite.yaml-
Structured Outputsinstruction_followingCheck if responses are following structured output requirements in promptsImprove instruction following capabilitiesApache 2.0structured_outputs_json.yamlNemotron-RL-instruction_following-structured_outputs
Structured Outputsinstruction_followingCheck if responses are following structured output requirements in promptsImprove instruction following capabilitiesApache 2.0structured_outputs_json_yaml_xml_v1.yaml-
Swerl GencodingRunning sandboxed evaluation for SWE-style tasks (either patch generation or reproduction test generation)Improve SWE capabilities useful for benchmarks like SWE-benchApache 2.0swerl_gen.yaml-
Swerl Llm JudgecodingSWE-style multiple-choice LLM-judge tasks scored via ... choice.Improve SWE capabilities useful for benchmarks like SWE-benchMITswerl_llm_judge.yaml-
Tavily SearchagentModel uses search tools to satisfy a user query.Measure agentic search capabilityApache 2.0tavily_search_judge_vllm_model.yaml-
Terminus Judgeagentsingle-step terminal based task (rubrics v4 judge prompt)Improve on terminal-style tasksApache 2.0terminus_judge.yaml-
Terminus Judgeagentsingle-step terminal based task (simple judge prompt)Improve on terminal-style tasksApache 2.0terminus_judge_simple.yaml-
Terminus Judgeagentsingle-step terminal based task (string similarity only)Improve on terminal-style tasksApache 2.0terminus_judge_string_only.yaml-
Text To SqlcodingText-to-SQL generation with LLM-as-a-judge equivalence checkingImprove text-to-SQL capabilities across multiple dialects---text_to_sql.yaml-
Vlm Eval Kitother-Measure VLM capabilities--MMBench_DEV_EN_V11.yaml-
Vlm Eval Kitother-Measure VLM capabilities--OCRBench.yaml-
Vlm Eval KitotherRun all supported VLMEvalKit benchmarks.Measure VLM capabilities--vlm_eval_kit.yaml-
Workplace AssistantagentWorkplace assistant multi-step tool-using environmentImprove multi-step tool use capabilityApache 2.0workplace_assistant.yamlNemotron-RL-agent-workplace_assistant
Xlam FcagentSalesforce xlam-function-calling-60k tool calling tasksImprove tool-calling capabilitiesApache 2.0xlam_fc.yaml-
XstestsafetyXSTest safety benchmark - exaggerated safety (over-refusal) evaluationEvaluate model safety calibration between helpfulness and harmlessness---xstest.yaml-
XstestsafetyXSTest safety benchmark - exaggerated safety (over-refusal) evaluationEvaluate model safety calibration between helpfulness and harmlessness---xstest_string_match.yaml-

📖 Documentation & Resources

🤝 Community & Support

We'd love your contributions! Here's how to get involved:

📚 Citations

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 Library for Scaling Reinforcement Learning Environments for LLM},
howpublished = {\url{https://github.com/NVIDIA-NeMo/Gym}},
author={NVIDIA},
year = {2025},
note = {GitHub repository},
}

About

Build RL environments for LLM training

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages