Repository navigation
Description
Use cases, pain points, and background
Users with their own agents (LangChain apps, custom Python scripts, services in their own infrastructure) currently cannot use ng_collect_rollouts without packaging their agent as a responses_api_agents/ server inside the Gym repo. Today, ng_collect_rollouts resolves +agent_name through the head server's config to find a co-managed Gym agent server, then POSTs /run to it. There is no way to point it at an external HTTP endpoint.
This requires user writing custom agents external to NeMo Gym to either rewrite their agent as a Gym server class or skip the CLI entirely and write their own rollout collection loop. The resources server HTTP API already supports direct external access (/seed_session, /{tool}, /verify), but the rollout collection tooling does not.
Description
Add support for +agent_url=http://host:port as an alternative to +agent_name=... in ng_collect_rollouts. When agent_url is provided, the rollout collector POSTs /run directly to that URL instead of resolving a server name through the head server config.
The external agent's /run endpoint receives the same JSONL row payload (with responses_create_params, verifier_metadata, etc.) and returns a verify-response-shaped result (with reward, response, etc.) — the same contract that Gym agent servers fulfill today.
Design
Preliminary thoughts:
nemo_gym/rollout_collection.py: addagent_urlas an optional config field. When set, skipServerClientname resolution and POST directly to{agent_url}/runvia aiohttp.- The
/aggregate_metricscall after rollout collection should be optional when usingagent_url— skip it if the external agent doesn't implement it, or fall back to calling/aggregate_metricson the resources server directly. - Config validation:
agent_urlandagent_nameshould be mutually exclusive. - No changes needed to the resources server or agent server code — this is purely a client-side (rollout collector) change.
Out of scope
- Changes to the resources server HTTP API
- Building a Gym SDK/client library for external agents (the contract is just
POST /runwith JSON) - Modifying
ng_runto manage external agent processes
Acceptance Criteria
-
ng_collect_rollouts +agent_url=http://localhost:9000 +input_jsonl_fpath=... +output_jsonl_fpath=...dispatches to the external URL - Works with existing JSONL data and produces the same output format as
+agent_name -
+agent_urland+agent_nameare mutually exclusive with a clear error message -
/aggregate_metricsis skipped gracefully when the external agent does not implement it - Documentation updated to show the external agent URL workflow
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity