[Doc] add env vars to the doc (#4572)

This commit is contained in:
youkaichao 2024-05-02 22:13:49 -07:00 committed by GitHub
parent ce3f1eedf8
commit 2d7bce9cd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 0 deletions

View File

@ -75,6 +75,7 @@ Documentation
serving/deploying_with_docker
serving/distributed_serving
serving/metrics
serving/env_vars
serving/usage_stats
serving/integrations

View File

@ -0,0 +1,9 @@
Environment Variables
========================
vLLM uses the following environment variables to configure the system:
.. literalinclude:: ../../../vllm/envs.py
:language: python
:start-after: begin-env-vars-definition
:end-before: end-env-vars-definition

View File

@ -28,6 +28,11 @@ if TYPE_CHECKING:
VLLM_USE_RAY_COMPILED_DAG: bool = False
VLLM_WORKER_MULTIPROC_METHOD: str = "spawn"
# The begin-* and end* here are used by the documentation generator
# to extract the used env vars.
# begin-env-vars-definition
environment_variables: Dict[str, Callable[[], Any]] = {
# used in distributed environment to determine the master address
'VLLM_HOST_IP':
@ -148,6 +153,8 @@ environment_variables: Dict[str, Callable[[], Any]] = {
lambda: os.getenv("VLLM_WORKER_MULTIPROC_METHOD", "spawn"),
}
# end-env-vars-definition
def __getattr__(name):
# lazy evaluation of environment variables