Skip to content

Simplify verifiers_agent to use upstream NeMoRLChatCompletionsClient - #1076

Merged
cmunley1 merged 4 commits into
NVIDIA-NeMo:mainfrom
mferrato:simplify-verifiers-agent
Apr 23, 2026
Merged

cmunley1 merged 4 commits into
NVIDIA-NeMo:mainfrom
mferrato:simplify-verifiers-agent

Conversation

@mferrato

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the custom VLLMOpenAIClient and parse_response_messages runtime patch
    with verifiers' NeMoRLChatCompletionsClient, which handles token ID relocation natively
  • Removes the verifiers==0.1.9.post3 version pin
  • Reduces the agent from ~340 to ~250 lines

Dependency

Draft: This PR depends on PrimeIntellect-ai/verifiers#1141
which adds NeMoRLChatCompletionsClient to the verifiers library. This PR
should not be merged until that PR is merged and released.

What changed

  • Deleted: VLLMOpenAIClient (70-line custom HTTP client) — replaced by NeMoRLChatCompletionsClient
  • Deleted: _patched_parse_response_messages runtime patch (22 lines) — token IDs now flow through the standard parse_tokens() path
  • Deleted: max_concurrent_generation / max_concurrent_scoring config — new verifiers API handles concurrency internally
  • Changed: run_group() call updated to new API signature (sampling_args instead of gen_sampling_args + semaphores)
  • Changed: _convert_trajectory_to_output() handles single-turn environments and Pydantic message objects
  • Added: state_columns=["trajectory"] to run_group() to ensure token IDs are included in output

Test plan

  • Integration: validated on A10 GPU with Qwen3-4B + acereason-math environment
  • Token ID validation: prompt_token_ids, generation_token_ids, generation_log_probs all populated
  • Pending: multi-turn tool-calling environment validation
  • Pending: NeMo RL training loop validation

Replace the custom VLLMOpenAIClient and parse_response_messages runtime
patch with verifiers' NeMoRLChatCompletionsClient, which handles token
ID relocation from the message dict to the response/choice level natively.

This removes the verifiers version pin and reduces the agent from ~340
to ~250 lines. Token IDs flow through the standard parse_tokens() path.

Signed-off-by: Matthew Ferrato <[email protected]>
Signed-off-by: Mauricio Ferrato <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Apr 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

The api_key="EMPTY" placeholder for internal NeMo Gym model server
communication was flagged by the secrets detector. Added pragma comment.

Signed-off-by: Matthew Ferrato <[email protected]>
Signed-off-by: Mauricio Ferrato <[email protected]>
The `# pragma: allowlist secret` was on the AsyncOpenAI( line, but
detect-secrets flags the api_key="EMPTY" line directly.

Signed-off-by: Mauricio Ferrato <[email protected]>
@mferrato
mferrato marked this pull request as ready for review April 23, 2026 19:42
@@ -1,4 +1,4 @@
-e nemo-gym[dev] @ ../../
verifiers==0.1.9.post3
verifiers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we pin this to latest still so things dont break on verifiers main?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to wait for next verifiers dev release and pin that in follow up probably.

@cmunley1
cmunley1 merged commit 4234fbe into NVIDIA-NeMo:main Apr 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants