[BugFix] Fix lazy imports involving outlines_core#27158
Merged
Isotr0py merged 1 commit intovllm-project:mainfrom Oct 19, 2025
Merged
[BugFix] Fix lazy imports involving outlines_core#27158Isotr0py merged 1 commit intovllm-project:mainfrom
Isotr0py merged 1 commit intovllm-project:mainfrom
Conversation
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses a bug where lazy imports for outlines_core would fail if the package was not installed. The root cause was the evaluation of type annotations at import time, which triggered the lazy loader. The fix correctly introduces from __future__ import annotations in the affected files (vllm/v1/structured_output/backend_outlines.py and vllm/v1/structured_output/utils.py) to defer the evaluation of type hints. This change is idiomatic, well-targeted, and effectively resolves the ModuleNotFoundError. The implementation is clean and I have no further suggestions.
houseroad
approved these changes
Oct 19, 2025
Isotr0py
approved these changes
Oct 19, 2025
lywa1998
pushed a commit
to lywa1998/vllm
that referenced
this pull request
Oct 20, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
adabeyta
pushed a commit
to adabeyta/vllm
that referenced
this pull request
Oct 20, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
0xrushi
pushed a commit
to 0xrushi/vllm
that referenced
this pull request
Oct 26, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
0xrushi
pushed a commit
to 0xrushi/vllm
that referenced
this pull request
Oct 26, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
ilmarkov
pushed a commit
to neuralmagic/vllm
that referenced
this pull request
Nov 7, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
rtourgeman
pushed a commit
to rtourgeman/vllm
that referenced
this pull request
Nov 10, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
devpatelio
pushed a commit
to SumanthRH/vllm
that referenced
this pull request
Nov 29, 2025
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.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.
Purpose
Fix outlines_core lazy imports broken by #26633
Annotations are executed at import time by default. To reproduce the issue, run the following
uv pip uninstall outlines_core python -c "from vllm.v1.engine.llm_engine import LLMEngine"Error stack trace
Test Plan
uv pip uninstall outlines_core python -c "from vllm.v1.engine.llm_engine import LLMEngine"Test Result
Passed
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.