From 2d7bce9cd5981db146b18a8a95c5a7e0480687bd Mon Sep 17 00:00:00 2001 From: youkaichao Date: Thu, 2 May 2024 22:13:49 -0700 Subject: [PATCH] [Doc] add env vars to the doc (#4572) --- docs/source/index.rst | 1 + docs/source/serving/env_vars.rst | 9 +++++++++ vllm/envs.py | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 docs/source/serving/env_vars.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index e0269987ec5d8..5cc28a2d70139 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -75,6 +75,7 @@ Documentation serving/deploying_with_docker serving/distributed_serving serving/metrics + serving/env_vars serving/usage_stats serving/integrations diff --git a/docs/source/serving/env_vars.rst b/docs/source/serving/env_vars.rst new file mode 100644 index 0000000000000..0ce1374a3967b --- /dev/null +++ b/docs/source/serving/env_vars.rst @@ -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 diff --git a/vllm/envs.py b/vllm/envs.py index 26ed731caa5ff..2dbb57e6253a7 100644 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -28,6 +28,11 @@ 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 @@ lambda: os.getenv("VLLM_WORKER_MULTIPROC_METHOD", "spawn"), } +# end-env-vars-definition + def __getattr__(name): # lazy evaluation of environment variables