-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[BugFix] Fix lazy imports involving outlines_core #27158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix] Fix lazy imports involving outlines_core #27158
Conversation
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
There was a problem hiding this 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 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.
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Signed-off-by: Alberto Perdomo <aperdomo@redhat.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
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.