Skip to content

feat(vllm_model): Dynamo frontend dialect and dynamo_worker capture handler - #4817

Merged
pthombre merged 13 commits into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/dynamo-frontend-dialect
Nov 13, 2026
Merged

pthombre merged 13 commits into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/dynamo-frontend-dialect

Conversation

@jthomson04

@jthomson04 jthomson04 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Lets the vLLM model server call NeMo RL's vLLM engines through an ai-dynamo frontend (1.5.1 or later), with and without external token capture. This is the Gym half of NVIDIA-NeMo/RL#4979, which serves NeMo-Gym through Dynamo's frontend and KV-aware router.

How NVIDIA-NeMo/RL#4979 uses it. There the Dynamo frontend runs NeMo RL's own chat engine in place of Dynamo's renderer and parsers. That chat engine reads Gym's fields, resolves and splices the token prefix, and builds the reply. The vLLM engine behind it generates and stages the captured tokens. NeMo RL turns the dialect on for its policy model, so a NeMo RL recipe sets none of this by hand: dynamo_frontend: true, reasoning_field: reasoning_content unless the config sets one, and external_staging_backend: dynamo_worker when token capture is on.

Why a dialect. NeMo RL's vLLM server takes its extra request fields at the top level (ng_capture, required_prefix_token_ids) and returns token data on the message. The Dynamo frontend rejects request fields it does not know and drops response fields it does not know, so neither survives it. The frontend does pass nvext through in both directions, so the dialect carries the same fields there, under the same names.

VLLMModelConfig.dynamo_frontend (default false)

When set:

  • Requests. Every chat request carries one nemo_rl:gym:<JSON object> entry in nvext.annotations. The object holds NeMo RL's request fields (ng_capture, required_prefix_token_ids, ng_measure) and is empty when none applies. NeMo RL's chat engine refuses a chat call without the entry; NeMo RL's own rollouts use /v1/completions.
  • Responses. NeMo RL returns the call result as nvext.nemo_rl. The server moves each field to where NeMo RL's vLLM server puts it: token IDs, log probabilities and routed_experts (router replay) onto the message. With return_token_id_information, a response without the required token fields fails with an error that names what is missing.
  • Echoed turns. Per-message token fields are stripped from requests, because the frontend rejects them. Without capture, the last echoed turn's prompt_token_ids + generation_token_ids go in the annotation as required_prefix_token_ids, which NeMo RL's vLLM server derives from the messages itself.
  • Context measurement. /context/measure measures through a chat call marked ng_measure, because the frontend has no /tokenize. NeMo RL's chat engine answers it with the prompt length, without reaching a vLLM engine.
  • Refused capture calls. Dynamo forwards only an error's status and message. NeMo RL therefore acknowledges a capture call it refused at the end of the message, and the server moves the acknowledgement back onto the x-ng-capture-refused header before the refusal is settled. The harness gets NeMo RL's own message.
  • Top-k capture. A capture call that sets both top_logprobs and logprob_token_ids is refused with HTTP 400, as it is against a vLLM server. The frontend accepts logprob_token_ids but does not hand it to NeMo RL's chat engine, and feat(dynamo): serve NeMo-Gym through the Dynamo frontend RL#4979 rejects it at startup only in its own policy-model overlay.
  • Output budget. refit_output_budget_to_window and refit_output_budget_to_prompt have no call to resend, and the server does not ask the frontend for a /tokenize count, which it does not serve. NeMo RL's chat engine lowers a budget that does not fit to what the context window leaves, and refuses only a prompt that fills the window by itself.
  • Rejected at startup. use_completions_api, is_responses_native, supply_prefix_token_ids, request_prompt_and_generation_token_ids and forward_session_id_as_conversation_id, whose calls or fields the frontend refuses. Also reasoning_field: both on a server that replays reasoning onto assistant messages (reasoning parser on, uses_interleaved_reasoning on, reasoning not kept in content), which the frontend answers with 400 duplicate field 'reasoning'.

token_id_capture.external_staging_backend: dynamo_worker

DynamoWorkerCaptureHandler:

  • sends the capture admission as ng_capture in the annotation, with no top-level ng_capture or required_prefix_token_ids. NeMo RL's chat engine reads the prefix from the staging chain;
  • asks for the sampled tokens' log probabilities (logprobs: true, and top_logprobs: 0 unless the call set it), which the engine stages;
  • sets the x-dynamo-session-id header to the capture key, so Dynamo's router can keep a rollout's calls on one engine, whose KV cache holds the rollout's prefix. NeMo RL enables that with frontend_args.session_affinity_ttl_secs. It takes effect from ai-dynamo 1.7 (feat(dynamo)!: Dynamo 1.8 nightly, high session cap, frontends across nodes RL#5115): 1.5.1 drops the session id of a chat call served by NeMo RL's chat engine;
  • reads the acknowledgement from nvext.nemo_rl.ng_commit_coords.

ExternalCaptureHandler gains request_headers() for that header. source_history parent resolution accepts dynamo_worker as it does vllm_worker. With external staging on, a server that sets dynamo_frontend must use dynamo_worker; other servers under the same capture block, such as judges, are not checked.

The names the model server and NeMo RL share (add_dynamo_gym_extras, pop_dynamo_call_result, split_dynamo_capture_refusal, dynamo_capture_refusal_suffix and the two constants) are exported from nemo_gym.models.

Docs

The vLLM guide gains "Use VLLMModel through a Dynamo frontend", with "Token capture through Dynamo" for the dynamo_worker pairing. The capture guide points to it.

Compatibility

Opt-in only. dynamo_frontend defaults to false, dynamo_worker is a new backend value, and request_headers() returns {} for the vLLM and Megatron handlers. Current configs behave as before.

Dynamo versions. The checks above hold on ai-dynamo 1.5.1, which NVIDIA-NeMo/RL#4979 pins, and on 1.7 (release/1.7.0), which NVIDIA-NeMo/RL#5115 moves to: the same fields are refused or accepted, and neither serves /tokenize. One thing differs, on NeMo RL's side and not in this dialect. 1.5.1 forwards the message of every 4xx error. From 1.7 the frontend forwards it only for an error raised as one of Dynamo's typed errors, and otherwise sends the status's reason phrase. The refusal acknowledgement and the context-length text then do not reach Gym, which fails the call instead of settling it. NVIDIA-NeMo/RL#4979 records it; NeMo RL has to raise those refusals as typed errors.

Issue

None filed. NVIDIA-NeMo/RL#4979 describes the design. Its merge order is NVIDIA-NeMo/RL#5195 (the Gym bump), then this PR, then #4979 re-pinned to this PR's merged commit.

Validation

Run locally. The first three ran on this head (4ad93ce15, which merges main at b4f6a0d44); the last ran on 6dc68d2fa, the commit before that merge:

  • pre-commit run --all-files: clean.
  • responses_api_models/vllm_model/tests: 1,188 passed.
  • tests/unit_tests/models/test_external_capture_handlers.py, tests/unit_tests/test_public_api.py and tests/unit_tests/models/test_token_capture.py: 382 passed.
  • tests/unit_tests -m "not sandbox": 21,159 passed and 221 skipped. 47 failed and 9 errored, none in a file this PR touches. 55 of them fail the same way on this PR's base commit (0aedecf12) in this environment, which lacks optional packages (mlflow, wandb, Pillow, jinja2, cloudpickle). The other one, a process-shutdown timing test (test_cli_server_shutdown.py), passed when rerun with nothing else running on the machine.

Tests this PR adds or extends:

  • test_dynamo_frontend_dialect: the request and response transforms with and without capture, a response without nvext.nemo_rl, and one with fields missing.
  • test_dynamo_frontend_rejects_settings_it_cannot_serve and test_dynamo_worker_backend_pairing: the startup checks, with one case for every rejected setting.
  • test_dynamo_frontend_sends_an_empty_annotation_for_a_plain_call: a call with no capture and no echoed turn still carries the annotation.
  • test_a_refusal_through_dynamo_is_not_counted_with_tokenize: the refit makes no /tokenize call.
  • tests/unit_tests/models/test_external_capture_handlers.py now runs its lifecycle and factory cases for DynamoWorkerCaptureHandler.
  • test_topk_capture_rejects_specific_logprob_ids now runs for the vLLM and the Dynamo capture handler.
  • test_measurement_uses_same_candidate_without_ledger_writes and test_context_refusal_settles_capture_only_with_worker_ack now run for both the vLLM server and the Dynamo frontend.

Rollout evidence

NVIDIA-NeMo/RL#4979 pins 6dc68d2fa, this PR's last commit before main was merged in, and its Validation section records the runs:

  • NeMo RL's unit lanes on that pin (feat(dynamo): serve NeMo-Gym through the Dynamo frontend RL#4979 at 0d95075213): the vLLM lane with Gym installed gave 66 passed, and the Gym lane 1,191 passed and 14 errors. The 14 are code_gen rollout cases that fail at setup since refactor(code-gen): replace legacy Ray execution with sandboxes #4958 requires sandbox_config.image; that check is on main and not part of this PR.
  • Dynamo on against Dynamo off, same configs, on ai-dynamo 1.7.0.dev20261106: workplace_assistant with score centering, forest training with context compaction, a multimodal config and a Nemotron Nano config. Each test's own gates come out the same either way.
  • Functional tests on 2 GPUs, through a real ai-dynamo 1.5.1 frontend: Gym with and without capture, context compaction, capture with router replay, and a VLM config with media capture.
  • The gap above showed up in the first set: 1 to 8 of 2,560 rollouts per run filled the context, and on 1.7 those rows were redispatched instead of kept.

The functional and cluster runs used the dialect commits on an older Gym base (9aac609) and were not repeated after the rebase onto main or after the review fixes. Neither changes a request or response those recipes make. The rebase changed import paths, the client's per-request header parameter (_headers, which main now has) and one renamed test argument. The review fixes change a startup check and a refusal that those recipes do not reach. The later merge of main touches no file this PR changes.

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jthomson04 jthomson04 added feature New capabilities, enhancements, or enablement work area:model Model servers, inference providers, and model adapters labels Oct 21, 2026
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 21, 2026
Temporarily pin the Gym submodule to the Gym#4817 head (5e2fb03), which
adds the Dynamo frontend dialect, the dynamo_worker capture backend and
the non-capture ng_prefix annotation, so the L1 Dynamo Gym runs exercise
them. Re-pin to the merge commit before this lands. The bump picks up
Gym's new `requests` dependency in uv.lock.

Add a test tying the engine host's annotation strings to the constants
Gym's dialect sends.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 23, 2026
Temporarily pin the Gym submodule to the Gym#4817 head (5e2fb03), which
adds the Dynamo frontend dialect, the dynamo_worker capture backend and
the non-capture ng_prefix annotation, so the L1 Dynamo Gym runs exercise
them. Re-pin to the merge commit before this lands. The bump picks up
Gym's new `requests` dependency in uv.lock.

Add a test tying the engine host's annotation strings to the constants
Gym's dialect sends.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>

@jthomson04 jthomson04 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These come from the team review of NeMo-RL #4905, which pins Gym to this PR's head. Each fix lands in this repo, so they are filed here rather than there.

  1. (G1) dynamo_frontend with request_prompt_and_generation_token_ids passes validation, then every call gets a 400 for return_token_ids.
  2. (G2) The default reasoning_field: both passes validation, then every echoed reasoning turn gets 400 duplicate field 'reasoning'.
  3. (G3) Low: NeMo RL's default template kwargs override a Gym YAML's kwargs, the opposite of native vLLM.
  4. (G4) Nit: two comments name Dynamo as the source of the engine_data keys.

Follow-up, no action here: Gym sends x-dynamo-session-id only from the capture handler (external_capture.py#L450-L455), so multi-turn calls without token capture get no session affinity from Dynamo's router, although their echoed prefix is also spliced after routing. Unmeasured.

Generated by Claude Code

Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-frontend-dialect branch from a369e28 to a5f936c Compare October 26, 2026 21:12
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-frontend-dialect branch from a5f936c to 71c17f2 Compare October 29, 2026 16:44
jthomson04 added a commit to jthomson04/RL that referenced this pull request Oct 29, 2026
At review request, NeMo-Gym through the Dynamo frontend moves to a
follow-up PR that waits on NVIDIA-NeMo/Gym#4817, so this PR no longer
needs a Gym bump:

- Gym's submodule is back on main's pin.
- The engine's Gym path (_generate_gym, capture staging, prefix splice),
  the Gym dialect setup, session affinity, client_base_urls and the
  Gym-only startup checks move to the follow-up.
- NeMo-Gym with policy.generation.dynamo=true is refused at startup in
  should_use_nemo_gym, before any cluster starts.
- The Dynamo L1 keeps its SingleController math and reload-refit overlays;
  the swe1 Dynamo + Gym nightly is disabled until the follow-up.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-frontend-dialect branch from 71c17f2 to b0e681c Compare October 29, 2026 17:19

@jthomson04 jthomson04 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two comments from the NVIDIA-NeMo/RL#4979 review: G5 (judge servers and the Dynamo pairing check) and G6 (reply on the G3 thread).

Generated by Claude Code

Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-frontend-dialect branch 2 times, most recently from 1b10ce6 to 3f33ac1 Compare November 6, 2026 18:51
jthomson04 and others added 8 commits November 12, 2026 15:35
…andler

Let the vLLM model server talk straight to an ai-dynamo 1.5.1 frontend,
replacing NeMo RL's Dynamo token wrapper proxy. The frontend rejects
unknown top-level request fields and returns token data only under
nvext.engine_data, when nvext.extra_fields asks for it.

- VLLMModelConfig.dynamo_frontend: strip echoed per-message token fields
  from requests and mark every request with the "nemo_gym:rollout"
  annotation in nvext.annotations, so the engine can tell Gym rollout
  traffic from the training framework's own requests. With
  return_token_id_information, request engine_data and copy
  nvext.engine_data.{prompt_token_ids, completion_token_ids,
  completion_logprobs} onto the message token fields, failing clearly when
  engine data is missing or the log probability count mismatches.
- token_id_capture.external_staging_backend "dynamo_worker": the
  admission rides in nvext.annotations as "ng_capture:<admission JSON>",
  no top-level ng_capture or required_prefix_token_ids and no logprobs are
  sent, and the acknowledgement is lifted from
  nvext.engine_data.ng_commit_coords.
- ExternalCaptureHandler.request_headers(), threaded through
  NeMoGymAsyncOpenAI.create_chat_completion(extra_headers=...) on top of
  default_headers. The Dynamo handler sets x-dynamo-session-id to the
  rollout id, since Dynamo 1.5.1 router affinity is header-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
…pture

vLLM's NeMo RL server splices the last echoed assistant turn's
prompt_token_ids + generation_token_ids into each multi-turn prompt
(required_prefix_token_ids). The Dynamo dialect strips those message
fields because the frontend rejects them, so without capture a turn-2
prompt was a fresh re-render and could diverge from the tokens the model
generated (e.g. Qwen3 dropping the empty think block).

Without an external capture handler, carry that prefix in
nvext.annotations as "ng_prefix:<JSON list>", for the engine to splice.
Capture calls still resolve their prefix from staging.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
… lift R3 routes

From the NeMo RL NVIDIA-NeMo#4905 review:
- dynamo_frontend now rejects request_prompt_and_generation_token_ids: Gym
  sends return_token_ids for it, which the frontend refuses with a 400.
- It also rejects reasoning_field: both when reasoning is echoed: the frontend
  reads `reasoning` as an alias of `reasoning_content` and 400s a message
  that carries both.
- _lift_dynamo_engine_data copies routed_experts onto the message when the
  engine sends it (router replay on), as the native endpoint attaches it.
- Comments name NeMo RL's engine, not Dynamo, as the engine_data producer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
The token-capture block is global, so a judge such as local_vllm_model
sees external_staging_backend=dynamo_worker too and failed at startup.
Only a server that sets dynamo_frontend=true must pair with dynamo_worker;
the error now names it. A judge never gets a capture context, so its
handler stays idle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
…ne object each

With dynamo_frontend on, NeMo RL's request fields and call results now
cross Dynamo's frontend as one JSON object per direction, under the
native vLLM server's field names. The frontend accepts only OpenAI fields
plus nvext, so both objects ride in nvext.

Request: every request carries one `nemo_rl:gym:<JSON object>` entry in
nvext.annotations, holding only the fields that apply: `ng_capture` (the
admission, as the native top-level field), `required_prefix_token_ids`
(no capture, from the last echoed turn's tokens) and `ng_measure`
(context measurement). It replaces the `nemo_gym:rollout`, `ng_capture:`
and `ng_prefix:` annotations and the nvext.extra_fields engine_data
request. The x-dynamo-session-id header is unchanged.

Response: the engine's nvext.nemo_rl result is lifted to where the native
server puts each field. Token fields and routed_experts go onto the
message, and ng_commit_coords goes where the capture handler reads it.
_DYNAMO_ENGINE_DATA_FIELDS and the completion_* renames are gone.

/context/measure: the frontend has no /tokenize, so the dialect measures
with a chat call marked ng_measure and reads prompt_token_count and
ng_context_measured from nvext.nemo_rl, with the same reply validation.
The route exists only under parent_resolution: source_history, which now
accepts external_staging_backend: dynamo_worker as well as vllm_worker.

DYNAMO_GYM_EXTRAS_ANNOTATION_PREFIX replaces
DYNAMO_CAPTURE_ANNOTATION_PREFIX, DYNAMO_GYM_REQUEST_ANNOTATION and
DYNAMO_PREFIX_ANNOTATION_PREFIX.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
…ture call

NeMo RL's engine behind Dynamo now generates what the request asks for, as
its vLLM worker does, so a captured call must ask for the sampled tokens'
log probabilities that the worker stages, as the vLLM and Megatron capture
handlers do. Score centering's top_logprobs is kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
(cherry picked from commit 4c84f17)
Signed-off-by: jthomson04 <[email protected]>
…'s frontend

Natively, the worker acknowledges a token-capture call it refused before
generation (a context-length 400) with the x-ng-capture-refused header, and
only then does source_history settle the call as refused. Dynamo's frontend
forwards only an error's status and message, so behind it the acknowledgement
never arrived and the refused call stayed pending.

NeMo RL's chat engine now ends the message with
dynamo_capture_refusal_suffix(model_call_id). With dynamo_frontend, the dialect
moves it back onto the header before the refusal is settled, so the harness
gets the engine's own message, as natively.

The worker-ack test runs each case through both dialects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
…odels

Code outside nemo_gym/ imports a package's public names from its public
API. The model server and its tests took the dialect's helpers from
token_capture.external_capture directly, so export them from
nemo_gym.models, beside the other external-capture names, and import
them from there.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04
jthomson04 force-pushed the jthomson04/dynamo-frontend-dialect branch from 54bc326 to 234bb55 Compare November 13, 2026 00:54
@ananthsub
ananthsub requested a review from pthombre November 13, 2026 00:55
jthomson04 added a commit to jthomson04/RL that referenced this pull request Nov 13, 2026
NVIDIA-NeMo#5195 moves the Gym submodule to 23557b7c2 (Gym main on 2026-11-12) and
makes the recipe and test changes that bump needs. This branch pinned
the Dynamo dialect (NVIDIA-NeMo/Gym#4817) on the old Gym base, so the
two pins conflict.

The submodule is now 234bb55da, the head of Gym#4817: the dialect
rebased onto Gym main 0aedecf12, which contains 23557b7c2. Gym's
dependencies are the same at both commits, so uv.lock is NVIDIA-NeMo#5195's plus
this branch's own entries.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test bb38b1d

@jthomson04
jthomson04 marked this pull request as ready for review November 13, 2026 05:32
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 13, 2026 05:33
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

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.

SHIP WITH CARE — three RISK findings and one NOTE.

I reviewed all seven changed files and their directly affected capture, conversion, measurement, and error paths. The current source addresses the earlier return_token_ids and judge-server pairing failures. I didn't execute tests or verify the external NeMo RL/Dynamo implementation.

RISK — Output-budget refitting still calls /tokenize through Dynamo

Failure: With dynamo_frontend=true, no external capture, and the default refit_output_budget_to_window=true, send max_tokens=131072 to an 8192-token model. If the engine replies max_tokens=131072 cannot be greater than max_model_len=8192, the refusal names no prompt count. _refit_output_budget consequently calls _count_prompt_tokens, which still requests /tokenize. The new dialect explicitly has no such endpoint and supplies a chat-based measurement path. A 404 therefore prevents refitting, leaving an empty length completion or propagated refusal instead of the configured single resend. This affects uncaptured Dynamo calls whose length error omits the prompt count.

Correction: Make the prompt-count fallback in _refit_output_budget dialect-aware. For Dynamo, copy the fully prepared outbound request, add ng_measure=true to its existing annotation, issue the measurement chat call, and accept only a nonnegative integer prompt_token_count with ng_context_measured=true. Preserve the existing fail-safe refusal when measurement fails. The external engine isn't mounted, so I can't verify whether measurement requires removing generation-only controls; confirm that contract before adopting an implementation. Don't route this through measure_context, which requires external capture.

Preservation: Keep counts stated in the error as the first choice, native vLLM's /tokenize fallback, the one-resend limit, and the existing prohibition on refitting externally staged calls. Measurement must retain the prepared messages, rendering options, and echoed token prefix without generating or staging tokens.

Acceptance — proposed tests, not executed: Extend the existing fallback regression with Dynamo enabled. Stub the initial refusal above, a measurement result of 100 tokens, and a successful generation. Assert no /tokenize call, one measurement, and exactly one generation resend with max_tokens=8076; execution metadata must record requested 131072 and applied 8076. Retain the native test's /tokenize assertion, and verify failed/unacknowledged measurements and externally staged calls do not resend.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
jthomson04 and others added 2 commits November 13, 2026 09:18
Two startup and request checks, from the review of the dialect:

- reasoning_field "both" is rejected with dynamo_frontend only when the
  server replays reasoning onto assistant messages. With
  uses_interleaved_reasoning off no message carries both keys, so that
  config now starts.
- A top-k capture call that also sets logprob_token_ids keeps its HTTP 400
  under Dynamo. The Dynamo capture handler sends the admission in the
  annotation, so the check no longer relies on a top-level ng_capture.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
Adds a section to the vLLM guide for dynamo_frontend: what serves it (an
ai-dynamo frontend running NeMo RL's chat engine), the settings refused at
startup, how a call differs from one to a vLLM server, and the dynamo_worker
capture backend. The capture guide points to it.

Also corrects the comments that describe NeMo RL's side: its chat engine in
the frontend reads the annotation, resolves the capture prefix and measures,
and the session header keeps a rollout on one engine's KV cache.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
Comment thread responses_api_models/vllm_model/app.py Resolved
Comment thread responses_api_models/vllm_model/app.py Resolved
jthomson04 and others added 2 commits November 13, 2026 09:37
…count under Dynamo

Two more cases for the Dynamo dialect, from review:

- forward_session_id_as_conversation_id adds a top-level conversation_params
  to every request, which the Dynamo frontend rejects. The combination is now
  refused at startup, like the other settings whose fields it rejects.
- The output-budget refit no longer asks the frontend for a /tokenize count,
  which it does not serve. NeMo RL's chat engine lowers a budget that does not
  fit and refuses only a prompt that fills the window, so no count would lead
  to a resend.

The vLLM guide's Dynamo section lists the new rejected setting, and words the
error-message and request-field notes for both ai-dynamo 1.5.1 and 1.7.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
…and the Dynamo capture handler

Three gaps in the Dynamo dialect's tests, from review:

- Each setting dynamo_frontend rejects now has its own case, so dropping
  one from the check fails a test.
- A call with no capture and no echoed turn is checked to carry the empty
  nemo_rl:gym: annotation, which NeMo RL's chat engine requires.
- DynamoWorkerCaptureHandler joins the shared capture-handler suite: the
  lifecycle cases and the factory selection.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 13, 2026 17:45
@jthomson04

Copy link
Copy Markdown
Contributor Author

On the review's first finding, that the output-budget refit still calls /tokenize through Dynamo: fixed in 50f67ec by skipping the lookup under the dialect, as suggested in #4817 (comment).

It does not measure through an ng_measure call instead, because nothing would use the count. The dialect is served by NeMo RL's chat engine (NVIDIA-NeMo/RL#4979), which lowers a budget that does not fit to what the window leaves (clamp_max_tokens) and refuses only a prompt that fills the window by itself. The refit has no output token to give there, with or without a count. The new docs section says this under "Output budget".

jthomson04 added a commit to jthomson04/RL that referenced this pull request Nov 13, 2026
Moves the Gym submodule from 234bb55da to 6dc68d2fa, the head of
NVIDIA-NeMo/Gym#4817. The four new Gym commits answer that PR's review:

- reasoning_field "both" is rejected with dynamo_frontend only when the
  server replays reasoning;
- a top-k capture call that also sets logprob_token_ids keeps its HTTP 400
  under Dynamo;
- forward_session_id_as_conversation_id is rejected with dynamo_frontend,
  and the output-budget refit no longer asks the frontend for a /tokenize
  count;
- the vLLM guide documents the dialect, and its tests cover every rejected
  setting, the empty annotation and the Dynamo capture handler.

Gym's dependencies are the same at both commits, so uv.lock is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
Brings the branch up to date with main (33 commits). No file this branch
changes was changed on main, so there are no conflicts. The harness
conformance workflow on this branch was older than the script it runs
after NVIDIA-NeMo#5367, which made every probe report unavailable.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
@pthombre
pthombre enabled auto-merge November 13, 2026 19:10
@pthombre
pthombre added this pull request to the merge queue Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43490338243

Merged via the queue into NVIDIA-NeMo:main with commit 4401042 Nov 13, 2026
77 checks passed
jthomson04 added a commit to jthomson04/RL that referenced this pull request Nov 13, 2026
NVIDIA-NeMo/Gym#4817 merged as 440104210. Move the pin from that PR's
branch (6dc68d2fa) to Gym main at 9e2e5d0ad. Gym's dependencies are the
same at both commits, so uv.lock does not change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: jthomson04 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:model Model servers, inference providers, and model adapters feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants