[Core][Easy] Use envs.__getattr__ for all Unify to environment variable access#26810
Merged
mgoin merged 1 commit intovllm-project:mainfrom Oct 15, 2025
Merged
[Core][Easy] Use envs.__getattr__ for all Unify to environment variable access#26810mgoin merged 1 commit intovllm-project:mainfrom
mgoin merged 1 commit intovllm-project:mainfrom
Conversation
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the way environment variables from vllm.envs are accessed throughout the codebase. The changes replace direct imports of environment variables (e.g., from vllm.envs import FOO_BAR) with module-level imports (import vllm.envs as envs) and qualified access (envs.FOO_BAR). This is a good practice as it ensures that environment variable values are fetched dynamically via __getattr__, allowing for updates to be reflected during service startup. The changes are applied consistently and correctly across the modified files. The code is clean and the refactoring improves maintainability.
Collaborator
Author
Collaborator
Author
|
Resolve #26854 |
5 tasks
bbartels
pushed a commit
to bbartels/vllm
that referenced
this pull request
Oct 16, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com> Signed-off-by: bbartels <benjamin@bartels.dev>
lywa1998
pushed a commit
to lywa1998/vllm
that referenced
this pull request
Oct 20, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
alhridoy
pushed a commit
to alhridoy/vllm
that referenced
this pull request
Oct 24, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
0xrushi
pushed a commit
to 0xrushi/vllm
that referenced
this pull request
Oct 26, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.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
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
rtourgeman
pushed a commit
to rtourgeman/vllm
that referenced
this pull request
Nov 10, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
devpatelio
pushed a commit
to SumanthRH/vllm
that referenced
this pull request
Nov 29, 2025
…le access (vllm-project#26810) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.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
Avoid directly using TYPE_CHECKING environment variables in the code (by updating all code with
from vllm.envs import FOO_BAR). And use envs.FOO_BAR instead, which go through theenvs.__getattr__which has 2 benefits:__getattr__ensured we adopted environment variable updates during service startup time.This should be landed after #26146
Test Plan
N/A
Test Result
N/A
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.