diff --git a/docs/source/index.md b/docs/source/index.md index 70a48ad..d217e13 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -45,6 +45,7 @@ faqs :maxdepth: 1 user_guide/suppoted_features user_guide/supported_models +user_guide/env_vars user_guide/release_notes ::: diff --git a/docs/source/user_guide/env_vars.md b/docs/source/user_guide/env_vars.md new file mode 100644 index 0000000..20304ac --- /dev/null +++ b/docs/source/user_guide/env_vars.md @@ -0,0 +1,9 @@ +# Environment Variables + +vllm-ascend uses the following environment variables to configure the system: + +:::{literalinclude} ../../../vllm_ascend/envs.py +:language: python +:start-after: begin-env-vars-definition +:end-before: end-env-vars-definition +::: diff --git a/vllm_ascend/envs.py b/vllm_ascend/envs.py index eb4f5f9..c5797d9 100644 --- a/vllm_ascend/envs.py +++ b/vllm_ascend/envs.py @@ -1,6 +1,31 @@ +# +# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. +# This file is a part of the vllm-ascend project. +# +# This file is mainly Adapted from vllm-project/vllm/vllm/envs.py +# Copyright 2023 The vLLM team. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import os from typing import Any, Callable, Dict +# The begin-* and end* here are used by the documentation generator +# to extract the used env vars. + +# begin-env-vars-definition + env_variables: Dict[str, Callable[[], Any]] = { # max compile thread num "MAX_JOBS": @@ -31,6 +56,8 @@ env_variables: Dict[str, Callable[[], Any]] = { lambda: os.getenv("LLMDATADIST_SYNC_CACHE_WAIT_TIME", "5000") } +# end-env-vars-definition + def __getattr__(name: str): # lazy evaluation of environment variables