Skip to content

[VLLMModel] Make the reasoning field configurable - #2177

Open
Kh4L wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
Kh4L:spanev/vllm-reasoning-field
Open

[VLLMModel] Make the reasoning field configurable#2177
Kh4L wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
Kh4L:spanev/vllm-reasoning-field

Conversation

@Kh4L

@Kh4L Kh4L commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Gym previously set both reasoning_content and reasoning on every outgoing assistant message. That's correct for vLLM, where each version ignores the key it doesn't know but fatal for servers that treat them as aliases of one field. Kimi-K3's Rust frontend answers 400 duplicate field 'reasoning', which killed every agentic rollout on turn 2. I confirmed the behaviour by probing the live server rather than inferring it: content alone, reasoning_content alone, and reasoning alone are all accepted; only the pair is rejected.

The fix adds reasoning_field: Literal["both","reasoning","reasoning_content"] = "both" to VLLMModelConfig. Default is unchanged, so nothing existing is affected. Five tests: parametrized across all three modes asserting exactly which keys reach the server, one pinning the default, one confirming pydantic rejects a bad value. 110/110 pass, ruff clean, DCO signed-off and SSH-signed.

If it's useful for the PR description, the failure signature reviewers would recognise is:

openai.InternalServerError: Error code: 500 - ... "Failed to deserialize the JSON body
into the target type: messages[2]: duplicate field reasoning"

Signed-off-by: Serge Panev <spanev@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 29, 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.

@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:triage-overdue Review assignment is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant