Skip to content

Commit bcbc04f

Browse files
[Doc] Add environment variables doc (#519)
### What this PR does / why we need it? Add environment variables doc. --------- Signed-off-by: shen-shanshan <467638484@qq.com>
1 parent 44a8301 commit bcbc04f

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

docs/source/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ faqs
4545
:maxdepth: 1
4646
user_guide/suppoted_features
4747
user_guide/supported_models
48+
user_guide/env_vars
4849
user_guide/release_notes
4950
:::
5051

docs/source/user_guide/env_vars.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Environment Variables
2+
3+
vllm-ascend uses the following environment variables to configure the system:
4+
5+
:::{literalinclude} ../../../vllm_ascend/envs.py
6+
:language: python
7+
:start-after: begin-env-vars-definition
8+
:end-before: end-env-vars-definition
9+
:::

vllm_ascend/envs.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1+
#
2+
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
3+
# This file is a part of the vllm-ascend project.
4+
#
5+
# This file is mainly Adapted from vllm-project/vllm/vllm/envs.py
6+
# Copyright 2023 The vLLM team.
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
#
20+
121
import os
222
from typing import Any, Callable, Dict
323

24+
# The begin-* and end* here are used by the documentation generator
25+
# to extract the used env vars.
26+
27+
# begin-env-vars-definition
28+
429
env_variables: Dict[str, Callable[[], Any]] = {
530
# max compile thread num
631
"MAX_JOBS":
@@ -31,6 +56,8 @@
3156
lambda: os.getenv("LLMDATADIST_SYNC_CACHE_WAIT_TIME", "5000")
3257
}
3358

59+
# end-env-vars-definition
60+
3461

3562
def __getattr__(name: str):
3663
# lazy evaluation of environment variables

0 commit comments

Comments
 (0)