[VLLMModel] Make the reasoning field configurable - #2177
Open
Kh4L wants to merge 1 commit into
Open
Conversation
Signed-off-by: Serge Panev <spanev@nvidia.com>
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.
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"