Repository navigation
docs(token-capture): fix external agent harness guide - #4102
Merged
ananthsub merged 1 commit intoOct 6, 2026
Merged
Conversation
Address documentation feedback on the external agent harness training guide: - Tool calling in vLLM needs both automatic tool choice and a parser. Show the vllm serve flags and the NeMo RL chat-serving keys. - Add a Claude Code walkthrough from vllm serve through gym env start, gym eval run, and a jq check of _ng_token_capture and mask_sample. The collector reads capture settings from the gym eval run command, so the walkthrough passes the overlay to both commands. - Explain the /ng-rollout/<id>/training-token-capture URL prefix for custom harnesses and link to the model-call capture page. - Clarify that an unattributed rollout with exactly one chain is still trainable. - Replace the consumer-side fragment with a complete function and add a complete run_conformance example. - Use top-level Gym config keys, with a note for NeMo RL's env.nemo_gym nesting. - Group framework internals under an advanced integration heading. Signed-off-by: Ananth Subramaniam <[email protected]>
Contributor
pthombre
approved these changes
Oct 6, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37525480729 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37525989970 |
ananthsub
added a commit
that referenced
this pull request
Oct 6, 2026
…to `r0.7.0` (#4133) beep boop [🤖]: Hi @ananthsub 👋, we've cherry picked #4102 into `r0.7.0` for you! 🚀 Please review and approve this cherry pick by your convenience! Signed-off-by: Ananth Subramaniam <[email protected]> Signed-off-by: NeMo Bot <[email protected]> Co-authored-by: Ananth Subramaniam <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
The "Training on External Agent Harnesses" page received QA feedback (NVBug 6848266) that it was misleading in places, had snippets that could not run, and lacked a first-run workflow. This PR updates
fern/versions/latest/pages/training-tutorials/external-agent-harnesses.mdxonly.tool_parser: hermes. vLLM also needs automatic tool choice, so following the old text could leave tool calls disabled. The step now shows bothvllm serveflags (--enable-auto-tool-choice --tool-call-parser) and both NeMo RL keys (http_server_serving_chat_kwargs.enable_auto_toolsandtool_parser).source,downstream,rollout_id). It is now a complete asyncdeliver_rollout(result, source, write_durably)function that rebuilds, writes durably, and then retires. A separate complete example shows thatrun_conformanceis async and takes factories.deliveredas the only healthy value ofterminal_attribution.chain. An unattributed rollout with exactly one chain is also kept unmasked. The table and the text after it now explain this, matching the masking logic innemo_gym/token_id_capture/consumer.py.vllm serve, atoken_capture.yamloverlay,gym env start --config,gym eval run --no-serve, and ajqcheck of_ng_token_captureandmask_sample./ng-rollout/<rollout_id>/training-token-captureURL prefix with a concrete URL, says what happens without the training segment, and links to the model-call capture page.The YAML snippets used NeMo RL's
env.nemo_gymnesting, which does not work as agym env start --configoverlay. They now use top-level Gym keys, and one sentence tells NeMo RL users to nest them underenv.nemo_gym.A live run of the walkthrough found two more problems, both fixed here:
--no-serve, the rollout collector reads capture settings from thegym eval runcommand, not from the running servers. If the overlay goes only togym env start, the model server records calls, but the collector writes text-only rollouts that have no_ng_token_capturefield and are not masked. The walkthrough now passes--config token_capture.yamlto both commands, and the page explains why. Making the collector use the servers' settings is a code change and will be a separate PR.vllm servenow sets--max-model-len 65536, which leaves room for that request and fits the model on one 48 GB GPU. Without the flag, vLLM 0.29.0 fails to start on that GPU, because the model's default 262,144-token context needs more KV cache than the GPU has.Related issue
NVBug 6848266 (internal QA tracker). No GitHub issue exists for it.
Validation
pyproject.toml, servingQwen/Qwen3-4B-Thinking-2507. Every rollout came back rebuilt and unmasked, withn_calls: 1,chains: 1, an emptyterminal_attribution.chain, anddelivered_fraction: 1.0. The rebuilt messages carry generation token ids with matching log probabilities. Rewards were 0 because the model's<think>text ended up in the answer the verifier extracted. That is a model and environment pairing issue, not a capture issue. The tasks did not need tools, so tool calling itself was not exercised.deliver_rolloutandrun_conformanceexamples against Gym's built-in file store as a stand-in formy_package.capture. The conformance checks passed, and the delivery example masked an empty capture as expected.gym env resolvecomposes the overlay with the training model config and the Claude Code environment as intended.jqcommand on sample rows.fern checkreported no errors. Its one warning is the redirects check, which is skipped without Fern authentication and also appears onmain.pre-commit run --fileson the changed page.Rollout evidence
The Claude Code walkthrough described under Validation was run against a live vLLM server. No other behavior changed, because this PR edits documentation only.
Compatibility
Documentation only. No API, config, or benchmark-result changes.