nemo_gym.sandbox) — Docker locally, or Daytona / Apptainer / ECS Fargate /
OpenSandbox — selected by config, no agent changes.
Miles integrates NeMo-Gym as an
agent-function integration: per sample, the agent
function POSTs the task to a NeMo-Gym agent server’s /run endpoint with
policy_base_url set to the session’s OpenAI-compatible URL. NeMo-Gym runs
its agent harness (mini-swe-agent v2 in mini_swe_agent_2) against that URL,
so Miles’ session server records every turn losslessly (token ids, logprobs,
loss masks — see Rollout Endpoints); NeMo-Gym
grades the episode itself and the grade enters training through a custom
reward hook reading sample.metadata["reward"].
The per-request policy_base_url override is proposed upstream in
NVIDIA-NeMo/Gym#2166; until it
merges, run the NeMo-Gym server from that PR’s branch (upstream main plus one
small commit pair).
Try it
The maintained recipe is SWE-bench GRPO with mini-swe-agent inexamples/experimental/nemo-gym.
In short:
- Environment side — on any docker-capable host, clone NeMo-Gym (the
PR branch above until #2166 merges) and start the
mini_swe_agent_2responses-API agent server with the docker sandbox provider config. - Data — convert SWE-bench Verified to Miles prompt data with
download_and_process_data.py; the task instance rides in each sample’smetadata. - Training side — point
NEMO_GYM_URLat the agent server and launchrun.py(requiresMILES_EXPERIMENTAL_ROLLOUT_REFACTOR=1, which the launcher sets), wiring the chain:

