Skip to content

Conversation

@inc-jeong
Copy link
Contributor

@inc-jeong inc-jeong commented Oct 4, 2025

Purpose

This PR fixes the issue where the reasoning_parser parameter was not being properly handled in run_batch.py, causing reasoning parser functionality to not work correctly during batch processing.
related issue : #26224

Test Plan

python3 -m vllm.entrypoints.openai.run_batch \
  -i data/input.txt \
  -o data/qwen3_output.txt \
  --model ./model/qwen3-8b \
  --trust_remote_code \
  --reasoning-parser qwen3

Test Result

As-is

{
  "id": "vllm-66cc876c8bde44aea116c5a785caa38d",
  "custom_id": "_2e61202f13bcfee31903706fe5fa92b8",
  "response": {
    "status_code": 200,
    "request_id": "vllm-batch-1531509d67354d59a9c2d2ac4758c5e9",
    "body": {
      "id": "chatcmpl-da3824d262604e729d7926235dfb44fc",
      "object": "chat.completion",
      "created": 1759564798,
      "model": "vllm",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "<think>\nOkay, let's tackle this. ... </think>\n\nmain_content: ...",
            "refusal": null,
            "annotations": null,
            "audio": null,
            "function_call": null,
            "tool_calls": [],
            "reasoning_content": null
          },
          "logprobs": null,
          "finish_reason": "stop",
          "stop_reason": null,
          "token_ids": null
        }
      ],
      "service_tier": null,
      "system_fingerprint": null,
      "usage": {
        "prompt_tokens": 8264,
        "total_tokens": 8835,
        "completion_tokens": 571,
        "prompt_tokens_details": null
      },
      "prompt_logprobs": null,
      "prompt_token_ids": null,
      "kv_transfer_params": null
    }
  },
  "error": null
}

To-be

{
  "id": "vllm-9696dc47ef3b42f1a09411f759be19c3",
  "custom_id": "_2e61202f13bcfee31903706fe5fa92b8",
  "response": {
    "status_code": 200,
    "request_id": "vllm-batch-9690b9a5318940aa9a70260bb1143ed0",
    "body": {
      "id": "chatcmpl-48c82ff10f10495eb6560f720efbdc1c",
      "object": "chat.completion",
      "created": 1759564955,
      "model": "vllm",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "\n\nmain_content: ...",
            "refusal": null,
            "annotations": null,
            "audio": null,
            "function_call": null,
            "tool_calls": [],
            "reasoning_content": "\nOkay, let's tackle this. ..."
          },
          "logprobs": null,
          "finish_reason": "stop",
          "stop_reason": null,
          "token_ids": null
        }
      ],
      "service_tier": null,
      "system_fingerprint": null,
      "usage": {
        "prompt_tokens": 8264,
        "total_tokens": 8835,
        "completion_tokens": 571,
        "prompt_tokens_details": null
      },
      "prompt_logprobs": null,
      "prompt_token_ids": null,
      "kv_transfer_params": null
    }
  },
  "error": null
}

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
Copy link

github-actions bot commented Oct 4, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors.

You ask your reviewers to trigger select CI tests on top of fastcheck CI.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify mergify bot added the frontend label Oct 4, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix an issue with reasoning_parser handling in run_batch.py. The intention is correct, adding validation and passing the parameter to OpenAIServingChat. However, the implementation incorrectly assumes a nested structure for the parsed command-line arguments, which will lead to an AttributeError. The args object is a flat namespace, and the reasoning_parser value should be accessed directly from it for validation. For initializing OpenAIServingChat, it's best to use the vllm_config object, which holds the definitive engine configuration. I've provided suggestions to correct these paths.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@inc-jeong
Copy link
Contributor Author

Hello @aarnphm, @chaunceyjiang, could you please take a look when you have a moment?

@chaunceyjiang chaunceyjiang self-assigned this Oct 13, 2025
Copy link
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

LGTM. Could you write an e2e for this?

@inc-jeong
Copy link
Contributor Author

@chaunceyjiang , thank you for review.

Could you write an e2e for this?

Do you mean to write the test code in the https://github.com/vllm-project/vllm/tree/main/tests/entrypoints/openai directory?

@chaunceyjiang
Copy link
Collaborator

Do you mean to write the test code in the https://github.com/vllm-project/vllm/tree/main/tests/entrypoints/openai directory?

Yes.

@inc-jeong
Copy link
Contributor Author

@chaunceyjiang ,
add test code in test_run_batch.py

Copy link
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Thanks~

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 14, 2025
@inc-jeong
Copy link
Contributor Author

@chaunceyjiang , It seems the failure is occurring during the CI stage — could you help me look into it?

@chaunceyjiang
Copy link
Collaborator

@chaunceyjiang , It seems the failure is occurring during the CI stage — could you help me look into it?

I retried it once — let’s see if it still fails.

@chaunceyjiang chaunceyjiang merged commit 0ecc553 into vllm-project:main Oct 16, 2025
48 checks passed
mandy-li pushed a commit to mandy-li/vllm that referenced this pull request Oct 16, 2025
albertoperdomo2 pushed a commit to albertoperdomo2/vllm that referenced this pull request Oct 16, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: Alberto Perdomo <[email protected]>
albertoperdomo2 pushed a commit to albertoperdomo2/vllm that referenced this pull request Oct 16, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: Alberto Perdomo <[email protected]>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
…oject#26225)

Signed-off-by: inc-jeong <[email protected]>
Signed-off-by: InChang Jeong <[email protected]>
Co-authored-by: USER <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
Zhathw pushed a commit to Zhathw/vllm that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants