nemo_gym.md
attributes
| source_path | references/nemo_gym.md |
|---|---|
| source_sha256 | 48e2b011ad13454e38245dcb791a98a6496c1ea53cc909895e2350d50a303e74 |
| source_url | https://github.com/adithya-s-k/FineEnvs/blob/fee6f71a70d0df315c2e2712859eb15689968b3a/.claude/skills/rl-env-from-description/references/nemo_gym.md |
| supporting_skill_id | 40344 |
| upstream_revision | fee6f71a70d0df315c2e2712859eb15689968b3a |
NeMo Gym quick reference (for the umbrella skill)
For implementation, defer to generate-nemo-gym-env. Planner-level summary here.
What NeMo Gym is
NVIDIA's RL gym layer for LLM agents. Built on Ray. Python package nemo_gym (install via pip install git+https://github.com/NVIDIA-NeMo/Gym). Targets the NeMo training stack but works fine with TRL/GRPO.
Core types
| Symbol | Source | What it is |
|---|---|---|
SimpleResourcesServer |
nemo_gym.base_resources_server |
Subclass for the env. Holds sessions dict, registers tool endpoints in setup_webserver(). |
BaseSeedSessionRequest, BaseSeedSessionResponse |
same | Body/response for /seed_session. |
BaseVerifyRequest, BaseVerifyResponse |
same | Body/response for /verify (the post-episode grader). |
BaseResourcesServerConfig |
same | Config base; subclass even if empty. |
SESSION_ID_KEY |
nemo_gym.server_utils |
Key into request.session for the SID. |
Reward model
Post-episode via /verify. The trainer sends the full trajectory (body.response.output) plus body.ground_truth; you return BaseVerifyResponse(**body.model_dump(), reward=...). No per-step rewards.
When NeMo Gym beats OpenEnv / ORS / Verifiers
- You want post-hoc grading from a Ray-orchestrated job (e.g. unit-test execution, LLM-as-judge).
- You're already in NVIDIA's NeMo stack.
- You need cookie-based sessions for tool isolation across concurrent rollouts.
- Aggregate metrics across episodes (
/verifyis the natural seam).
When NeMo Gym loses
- The user wants per-tool-call reward → ORS.
- The user is on a shared SLURM / HF cluster node where Ray init can't bind → OpenEnv or ORS.
- The user wants tool-discovery via
list_tools()— NeMo Gym has none; tool schemas are hardcoded in the rollout.
Common confusions
- Ray init fails on shared cluster nodes (
gcs_servercan't bind). Localpython server.pydoesn't work in those environments — only deployed Space does. - No client SDK. The rollout speaks raw
requestswith arequests.Session()for cookie persistence. - Tool schemas are hardcoded in the rollout. When the server's Pydantic body changes, manually update the rollout's tool definition list.
- Dataset format requires
responses_create_params(JSON-stringified) andground_truth(list of dicts). Theground_truth[0]shape is your call — typically{"expected_output": "..."}.
Children
No children yet.
Like how this is organised?
Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.