Skip to content

feat: running ng_run outside of the gym repository #625

Description

@xavier-owkin

I'd like to use Gym as a dependency in a project and I've therefore installed NeMo-RL (containing Gym) as a submodule of my project. Then in my project I have created a gym folder containing my custom resources servers and responses api agents.

Basically here is what my gym folder looks like

OwkinZero/agentic/gym
├── README.md
├── create_symlinks.sh
├── resources_servers
│   └── llm_judge_reward
│       ├── README.md
│       ├── app.py
│       ├── configs
│       └── requirements.txt
├── responses_api_agents
│   └── idea_generator_agent
│       ├── README.md
│       ├── __init__.py
│       ├── app.py
│       ├── client.py
│       ├── configs
│       ├── data
│       ├── outputs
│       └── requirements.txt
└── scripts
    └── submit_training.sh

I tried to run the ng_run command from my working directory (called OwkinZero/agentic). First, in order to have access to the command I installed nemo_gym in editable mode. Then I encountered a first issue: the env variables defined in my env.yaml file (located at the root of OwkinZero/agentic) were not loaded. I had to add the file to the config_paths list.

So here is the commands I run

config_paths="/fsx/xav/code/OwkinZero/agentic/env.yaml,/fsx/xav/code/OwkinZero/agentic/gym/responses_api_agents/idea_generator_agent/configs/idea_generator_agent.yaml,/fsx/xav/code/OwkinZero/agentic/gym/resources_servers/llm_judge_reward/configs/llm_judge_reward.yaml,/fsx/xav/code/OwkinZero/agentic/gym/responses_api_agents/idea_generator_agent/configs/gpt_5_nano.yaml"

ng_run "+config_paths=[${config_paths}]"

And here is the error that I get

Starting Ray cluster...
2026-01-22 16:36:42,971	INFO worker.py:1942 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
Started Ray cluster at 10.1.25.93:56390
Traceback (most recent call last):
  File "/fsx/xav/code/OwkinZero/agentic/.venv/bin/ng_run", line 10, in <module>
    sys.exit(run())
             ^^^^^
  File "/fsx/xav/code/OwkinZero/agentic/.venv/lib/python3.12/site-packages/nemo_gym/cli.py", line 396, in run
    rh.start(global_config_dict_parser_config)
  File "/fsx/xav/code/OwkinZero/agentic/.venv/lib/python3.12/site-packages/nemo_gym/cli.py", line 212, in start
    command = f"""{_setup_env_command(dir_path, global_config_dict)} \\
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/fsx/xav/code/OwkinZero/agentic/.venv/lib/python3.12/site-packages/nemo_gym/cli.py", line 78, in _setup_env_command
    raise RuntimeError(f"Missing pyproject.toml or requirements.txt for uv venv setup in server dir: {dir_path}")
RuntimeError: Missing pyproject.toml or requirements.txt for uv venv setup in server dir: /fsx/xav/code/OwkinZero/agentic/.venv/lib/python3.12/site-packages/responses_api_agents/idea_generator_agent
INFO:     Started server process [1900511]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:11000 (Press CTRL+C to quit)

Note the /fsx/xav/code/OwkinZero/agentic/.venv/lib/python3.12/site-packages/responses_api_agents/idea_generator_agent actually does not exist.

The only workaround that I found was to create symbolic links from my custom resource servers and resource api agents to the corresponding folder in the Gym repo and to run ng_run from Gym but that's not very convenient.

Is there a way to run ng_run from my project root or am I forced to put new resource servers in the Gym directory?

Activity

  1. cmunley1 commented on Jan 29, 2026

    @cmunley1
    Contributor

    My suggestion is to build your new agents and resources servers in Gym for now and don't use symlinks. Can you double check you installed in editable mode? I dont think it would look for requirements for servers in site-packages in editable mode.

    I don't think symlink is a great idea currently because we often do this in resources servers: https://github.com/NVIDIA-NeMo/Gym/blob/main/resources_servers/reasoning_gym/requirements.txt#L1

    We plan to make this easier e.g. with pypi.

  2. self-assigned this
    on Jan 29, 2026
  3. cmunley1 commented on Jan 29, 2026

    @cmunley1
    Contributor

    I also think you can run ng_run outside of Gym once installed right

  4. xavier-owkin commented on Feb 2, 2026

    @xavier-owkin
    Author

    Indeed, my bad, I installed it from source but without editable mode. I can run the ng_run command outside of Gym but if the ressources are defined outside of the Gym folder, I hit the issue pasted above.
    If I understand correctly, the current correct way to proceed is to define all resources servers or api agents inside the Gym directory. Having the possibility to define them elsewhere would be great, to keep all the logic in the main repository instead of putting part of it in the Gym submodule.

  5. dburkhardt commented on Feb 2, 2026

    @dburkhardt
    Contributor

    @xavier-owkin can you please confirm that this is now working and you're not blocked? If this is a feature request, happy to make sure that gets to the team.

  6. cmunley1 commented on Feb 2, 2026

    @cmunley1
    Contributor

    Hi @xavier-owkin yes for the time being we need to include all new environment components (resources server, agents) in the local installation directory. If you want, I have a branch here that may enable you to create these outside of the installation directory. I have only tested it a bit: https://github.com/NVIDIA-NeMo/Gym/tree/cmunley1/pypi

    You could try cherry picking this commit 18ce244 and using full paths to the servers in ng_run, and it may work correctly

  7. xavier-owkin commented on Feb 3, 2026

    @xavier-owkin
    Author

    @dburkhardt yes currently it's working fine with everything in the Gym local directory. And now it's clearer that it's currently required to work like that. @cmunley1 I am indeed very interested in the pypi integration and I will make sure to test it soon

  8. changed the title [-]Running `ng_run` outside of the Gym repository[/-] [+]feat: running `ng_run` outside of the gym repository[/+] on Apr 2, 2026
  9. added
    community-request
    on Apr 2, 2026
  10. cmunley1 commented on Apr 17, 2026

    @cmunley1
    Contributor

    Hey @xavier-owkin can you give nemo gym version 0.2.1 a try through pypi? We just released a patch which should resolve this. See: https://github.com/NVIDIA-NeMo/Gym/blob/main/docs/get-started/pypi-install.md

    Thanks for bringing this up!

  11. added
    waiting-on-customer
    waiting-on-maintainers
    and removed
    waiting-on-customer
    on Jun 3, 2026
  12. 14 remaining items

  13. added
    waiting-on-maintainers
    and removed
    waiting-on-customer
    on Jul 3, 2026
  14. added
    waiting-on-customer
    waiting-on-maintainers
    and removed
    waiting-on-maintainers
    waiting-on-customer
    on Jul 10, 2026
  15. added
    waiting-on-maintainers
    waiting-on-customer
    and removed
    waiting-on-customer
    waiting-on-maintainers
    on Aug 5, 2026
  16. added
    waiting-on-maintainers
    and removed
    waiting-on-customer
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CLIPlatformcommunity-requestwaiting-on-maintainers

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions