Skip to content

[Misc] Use VLLMValidationError in batch, pooling, and tokenize protocol validators#36256

Merged
DarkLight1337 merged 1 commit intovllm-project:mainfrom
umut-polat:fix/remaining-validation-errors
Mar 17, 2026
Merged

[Misc] Use VLLMValidationError in batch, pooling, and tokenize protocol validators#36256
DarkLight1337 merged 1 commit intovllm-project:mainfrom
umut-polat:fix/remaining-validation-errors

Conversation

@umut-polat
Copy link
Copy Markdown
Contributor

Replaces ValueError with VLLMValidationError in the remaining protocol model validators across three files:

  • run_batch.py: validate_no_file in BatchTranscriptionRequest and BatchTranslationRequest → parameter: file
  • pooling/base/protocol.py: check_generation_prompt → parameter: continue_final_message
  • tokenize/protocol.py: check_generation_prompt → parameter: continue_final_message

This completes the VLLMValidationError migration across all protocol-level model validators in the OpenAI-compatible endpoints.

Previous PRs in this series: #35456, #35510, #35664, #35666, #36254.

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 6, 2026

Hi @umut-polat, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Copy link
Copy Markdown
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 continues the effort to standardize error handling by replacing ValueError with the custom VLLMValidationError in several protocol validators. The changes are generally good, but I've identified a potential improvement in how validation errors for conflicting parameters are reported. In pooling/base/protocol.py and serve/tokenize/protocol.py, the error points to a single parameter when two are in conflict, which could be misleading. I've suggested removing the specific parameter from the error to make it more accurate, albeit less specific.

Comment on lines +134 to 138
raise VLLMValidationError(
"Cannot set both `continue_final_message` and "
"`add_generation_prompt` to True."
"`add_generation_prompt` to True.",
parameter="continue_final_message",
)
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.

high

The validation error is raised when both continue_final_message and add_generation_prompt are True. However, the parameter argument for VLLMValidationError is set only to "continue_final_message". This can be misleading for API clients that use this field to highlight the source of the error, as the issue stems from the combination of two parameters. To avoid ambiguity, consider omitting the parameter argument for this validation check. This makes the structured error less specific but more accurate.

            raise VLLMValidationError(
                "Cannot set both `continue_final_message` and "
                "`add_generation_prompt` to True."
            )

@umut-polat umut-polat force-pushed the fix/remaining-validation-errors branch from d3acfdf to 593576c Compare March 6, 2026 14:55
@mergify
Copy link
Copy Markdown

mergify bot commented Mar 9, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @umut-polat.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Mar 9, 2026
@umut-polat umut-polat force-pushed the fix/remaining-validation-errors branch from 593576c to eb4730c Compare March 9, 2026 08:57
@mergify mergify bot removed the needs-rebase label Mar 9, 2026
@umut-polat umut-polat force-pushed the fix/remaining-validation-errors branch 2 times, most recently from fd8ce19 to 8a0ff16 Compare March 12, 2026 12:48
@mergify
Copy link
Copy Markdown

mergify bot commented Mar 12, 2026

Hi @umut-polat, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy failing?
mypy is run differently in CI. If the failure is related to this check, please use the following command to run it locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10

…ol validators

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
@umut-polat umut-polat force-pushed the fix/remaining-validation-errors branch from 8a0ff16 to cc1ace9 Compare March 17, 2026 10:09
@DarkLight1337
Copy link
Copy Markdown
Member

Sorry for the delay!

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) March 17, 2026 10:29
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 17, 2026
@DarkLight1337 DarkLight1337 merged commit 56cb1ba into vllm-project:main Mar 17, 2026
48 checks passed
Lucaskabela pushed a commit to Lucaskabela/vllm that referenced this pull request Mar 17, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
andylolu2 pushed a commit to andylolu2/vllm that referenced this pull request Mar 18, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
wendyliu235 pushed a commit to wendyliu235/vllm-public that referenced this pull request Mar 18, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
fxdawnn pushed a commit to fxdawnn/vllm that referenced this pull request Mar 19, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm that referenced this pull request Mar 27, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
Monishver11 pushed a commit to Monishver11/vllm that referenced this pull request Mar 27, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
Signed-off-by: Monishver Chandrasekaran <monishverchandrasekaran@gmail.com>
JiantaoXu pushed a commit to JiantaoXu/vllm that referenced this pull request Mar 28, 2026
…ol validators (vllm-project#36256)

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
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