Skip to content

[Doc] Add environment variables configuration reference - #6217

Merged
hsliuustc0106 merged 7 commits into
mainfrom
codex-env-var-reference
Aug 25, 2026
Merged

hsliuustc0106 merged 7 commits into
mainfrom
codex-env-var-reference

Conversation

@hsliuustc0106

@hsliuustc0106 hsliuustc0106 commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add a central Environment Variables page under User Guide → Configuration and cross-link it from the top-level CLI reference
  • classify 148 effective environment names by ownership, including explicit migration dispositions for all 57 model-specific switches
  • document the 22 reviewed public Omni settings with defaults, precedence, read time, invalid-value behavior, lifecycle, and per-stage env scoping
  • distinguish the classification-only inventory from an executable vllm.envs-style resolver and require the VLLM_OMNI_ prefix for future public names
  • extend collect_env.py with the safe public Omni allowlist and keep diagnostics usable when Omni import fails
  • add bidirectional CI drift checks for direct environment reads regardless of key casing and stale model/benchmark inventory rows, plus public-reference coverage, classification counts, collector redaction, and future prefix exceptions
  • track family-sized model migration packages and their ownership gate in [Tracking]: Migrate model-specific environment switches to typed configuration #6232

Why

vLLM-Omni currently reads environment variables across process startup, configuration, workers, model integrations, and benchmarks. Treating every discovered name as public would accidentally turn model-specific debug and compatibility switches into supported API.

This PR establishes a reviewed public boundary, records ownership for the remaining names, and gives model owners explicit migration targets without changing existing runtime behavior.

Upstream alignment

The page follows vLLM's placement under User Guide → Configuration, reuses the reviewed inventory in environment collection, and links inherited behavior to the aligned vLLM 0.26 reference.

This PR intentionally stops at audit and governance metadata: ENVIRONMENT_VARIABLE_INVENTORY classifies names but does not resolve values. Existing consumers continue to own parsing, defaults, precedence, and evaluation time. Converging the 22 public Omni settings on a typed/lazy resolver is follow-up work rather than expanding this audit across all 148 variables.

Existing public names with older prefixes are grandfathered for compatibility. A regression test requires every future public Omni-owned name to use VLLM_OMNI_.

Model-specific boundary

The existing model-only environment switches are classified as migration inputs, not promoted into public API:

  • Promote: 33
  • Request scope: 6
  • External: 0
  • Internalize: 11
  • Deprecate/remove: 7

The exact decisions live in vllm_omni/config/environment_variable_inventory.py. Implementation is tracked in #6232 as family-sized packages that require a named assignee and model-owner review.

Validation

  • uvx pre-commit run --files ...
  • 190 focused environment/configuration tests passed
  • mkdocs build --strict (exit 0)

Fixes #6211

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Comment thread collect_env.py Outdated
def get_env_vars():
try:
from vllm_omni.config.environment_variables import ENVIRONMENT_VARIABLES
except ImportError:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The failure modes that motivate this fallback aren't all ImportErrors. Importing vllm_omni.config.environment_variables executes vllm_omni/__init__.py, which imports vllm_omni.patch — a bare import torch (patch.py:7) raises OSError on a broken CUDA install, and the patch logic can also raise AssertionError (patch.py:73) or RuntimeError (patch.py:249); see the note in vllm_omni/__init__.py that patch may throw on vLLM version mismatch. None of those are ImportError subclasses, so get_env_vars() crashes on exactly the broken installs collect_env.py exists to diagnose — a regression vs. main, which never imported vllm_omni here. Since the allowlist is optional, suggest except Exception here (the (ImportError, NameError, AttributeError, OSError) tuple used for torch at line 26 would still miss the patch RuntimeError/AssertionError).

_REFERENCE_PAGE = _REPO_ROOT / "docs" / "configuration" / "environment_variables.md"


def _literal_environment_accesses(path: Path) -> set[str]:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This gate only sees os.getenv("LITERAL")-shaped accesses, but the package already reads ~24 sites through shapes it cannot see: module-constant indirection (os.environ.get(AUDIO_SAMPLE_RATE_ENV) at vllm_omni/metrics/definitions.py:367), wrapper helpers (_choice_env/is_set in entrypoints/openai/video_stream_envs.py — both public video variables are read only this way), the pydantic-settings VLLM_OMNI_SERVER_* family (no os. call at all), and import os as _os (modeling_moss_tts_local_depth.py:221). A new variable added in any of these styles lands with no CI signal — the exact silent drift this inventory exists to prevent. Could the scan additionally resolve module-level all-caps string constants passed as the first argument, and match "X" in os.environ membership literals? If that is more machinery than wanted, the literal-only scope should at least be stated in the policy sentence at the end of the reference page so readers don't assume full coverage.

@hsliuustc0106 hsliuustc0106 added the documentation Improvements or additions to documentation label Aug 15, 2026
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
assert {name for name in public_names if not name.startswith("VLLM_OMNI_")} == legacy_public_names


def test_statically_resolvable_environment_accesses_are_classified():

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This direction (code → inventory) is now solid, but the reverse has no guard: when a model is deleted or refactored away from its env switches, its MODEL_SPECIFIC/BENCHMARK_TRANSITIONAL rows linger with no CI signal, and the pinned counts in test_inventory_matches_reviewed_snapshot_counts actively discourage cleaning them up. Since several of those names are read through indirect sites, the robust form is a substring liveness check rather than the scanner: assert each name in those two categories still appears textually somewhere under vllm_omni/. That makes model removal update the inventory automatically.

not listed as public usage options here because doing so would turn implementation
escape hatches into an accidental compatibility contract.

Every audited model-specific name has a migration disposition in the

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The dispositions are unenforced promises as it stands — nothing forces a promote to ever execute, so the 54 can only shrink if each batch has an owner. Worth opening the per-family tracking issue(s) alongside this PR so they don't live only in this tuple: the 11 internalize rows need no work, the 5 deprecate_remove rows are trivial deletions, and the 38 promote/request-scope rows collapse into ~8 family-sized batches (DYNIN 7, INTERNVLA_A1 4, GEPARD 6, COSYVOICE3/MIMO/MINICPMO 3 each, COSMOS3 2, plus singles).

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copilot AI left a comment

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.

Pull request overview

This PR introduces a reviewed, non-executable inventory of environment-variable names used in vLLM-Omni, adds centralized documentation for the public Omni-owned subset, and wires CI drift checks plus safer environment collection behavior to prevent accidental expansion of the supported env-var contract.

Changes:

  • Add ENVIRONMENT_VARIABLE_INVENTORY with ownership/category metadata, model-switch migration dispositions, and redaction flags.
  • Add CI tests that (a) enforce reviewed inventory counts, (b) detect new direct env reads that aren’t classified, and (c) require public Omni variables to appear in the new docs page.
  • Update collect_env.py to report only safe/public Omni values, preserve usefulness when Omni import fails, and avoid printing redacted/secret-like keys.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vllm_omni/config/environment_variable_inventory.py New reviewed inventory of env-var names with categories/dispositions and redaction metadata.
tests/config/test_environment_variables.py New drift/coverage tests that gate inventory growth, enforce doc coverage, and validate collector redaction behavior.
docs/configuration/README.md Link configuration docs to the new Environment Variables reference page.
docs/configuration/environment_variables.md New centralized environment-variable reference documenting the reviewed public Omni contract and governance boundary.
docs/cli/README.md Cross-link CLI docs to the new Environment Variables page for precedence/evaluation-time guidance.
collect_env.py Extend environment collection to include safe public Omni allowlist, redact sensitive keys, and remain functional on Omni import failures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +105 to +111
def _resolve_environment_name(expression: ast.expr, constants: dict[str, str]) -> str | None:
value: str | None = None
if isinstance(expression, ast.Constant) and isinstance(expression.value, str):
value = expression.value
elif isinstance(expression, ast.Name):
value = constants.get(expression.id)
return value if value is not None and value.isupper() else None
@vllm-omni-review-bot

Copy link
Copy Markdown

This PR appears to belong to: docs/design/module/vllm_omni_config.md.

Module owners: @lishunyang12 @alex-jw-brooks

@hsliuustc0106, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer.

Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment.

@hsliuustc0106

Copy link
Copy Markdown
Collaborator Author

I think we also need to update the related skills if the users want to add a new env var, where they should follow our general rule

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
@hsliuustc0106 hsliuustc0106 added the high priority high priority issue, needs to be done asap label Aug 18, 2026
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
@hsliuustc0106
hsliuustc0106 merged commit 780e8d4 into main Aug 25, 2026
6 checks passed
hsliuustc0106 added a commit that referenced this pull request Aug 25, 2026
Signed-off-by: hsliuustc0106 <liuhongsheng4@huawei.com>
AndyZhou952 pushed a commit to AndyZhou952/vllm-omni that referenced this pull request Aug 26, 2026
…#6217)

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Signed-off-by: AndyZhou952 <jzhoubc@connect.ust.hk>
AndyZhou952 pushed a commit to AndyZhou952/vllm-omni that referenced this pull request Aug 26, 2026
… drift (vllm-project#6631)

Signed-off-by: hsliuustc0106 <liuhongsheng4@huawei.com>
Signed-off-by: AndyZhou952 <jzhoubc@connect.ust.hk>
@hsliuustc0106
hsliuustc0106 deleted the codex-env-var-reference branch August 28, 2026 01:36
JoseCarlosGarcia95 pushed a commit to valendra-tech/vllm-omni that referenced this pull request Sep 5, 2026
…#6217)

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
JoseCarlosGarcia95 pushed a commit to valendra-tech/vllm-omni that referenced this pull request Sep 5, 2026
… drift (vllm-project#6631)

Signed-off-by: hsliuustc0106 <liuhongsheng4@huawei.com>
y-null added a commit to y-null/vllm-omni that referenced this pull request Sep 21, 2026
这两个 env 由上游 PR vllm-project#5638(f201b717,2026-08-04)引入、并收录于上游 env 文档(vllm-project#6217),
不属于本线新增 —— 上一条提交把它们当成本线的 env 兜底删掉了,判断错误,现按上游原样恢复。
本线真正新增并转换的只有 VLLM_OMNI_C2W_SINGLE_ROW(c51109d4,up/main 无此变量),
该项的 yaml 化(code2wav_single_row_batch)保持不变。
khairulkabir1661 pushed a commit to khairulkabir1661/vllm-omni that referenced this pull request Sep 25, 2026
…#6217)

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm-omni that referenced this pull request Sep 25, 2026
… drift (vllm-project#6631)

Signed-off-by: hsliuustc0106 <liuhongsheng4@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation high priority high priority issue, needs to be done asap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc]: Add an environment variables configuration reference

3 participants