Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
2238a12c
Unverified
Commit
2238a12c
authored
Feb 01, 2026
by
Xiao Yang
Committed by
GitHub
Feb 01, 2026
Browse files
[Misc] support collect_env for endpoint /server_info (#33246)
Signed-off-by:
yang.xiao
<
yang.xiao@daocloud.io
>
parent
ce0afe24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
vllm/entrypoints/serve/instrumentator/server_info.py
vllm/entrypoints/serve/instrumentator/server_info.py
+9
-0
No files found.
vllm/entrypoints/serve/instrumentator/server_info.py
View file @
2238a12c
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
asyncio
import
functools
from
typing
import
Annotated
,
Literal
from
typing
import
Annotated
,
Literal
import
pydantic
import
pydantic
...
@@ -9,6 +11,7 @@ from fastapi import APIRouter, FastAPI, Query, Request
...
@@ -9,6 +11,7 @@ from fastapi import APIRouter, FastAPI, Query, Request
from
fastapi.responses
import
JSONResponse
from
fastapi.responses
import
JSONResponse
import
vllm.envs
as
envs
import
vllm.envs
as
envs
from
vllm.collect_env
import
get_env_info
from
vllm.config
import
VllmConfig
from
vllm.config
import
VllmConfig
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
...
@@ -32,6 +35,11 @@ def _get_vllm_env_vars():
...
@@ -32,6 +35,11 @@ def _get_vllm_env_vars():
return
vllm_envs
return
vllm_envs
@
functools
.
lru_cache
(
maxsize
=
1
)
def
_get_system_env_info_cached
():
return
get_env_info
().
_asdict
()
@
router
.
get
(
"/server_info"
)
@
router
.
get
(
"/server_info"
)
async
def
show_server_info
(
async
def
show_server_info
(
raw_request
:
Request
,
raw_request
:
Request
,
...
@@ -46,6 +54,7 @@ async def show_server_info(
...
@@ -46,6 +54,7 @@ async def show_server_info(
),
),
# fallback=str is needed to handle e.g. torch.dtype
# fallback=str is needed to handle e.g. torch.dtype
"vllm_env"
:
_get_vllm_env_vars
(),
"vllm_env"
:
_get_vllm_env_vars
(),
"system_env"
:
await
asyncio
.
to_thread
(
_get_system_env_info_cached
),
}
}
return
JSONResponse
(
content
=
server_info
)
return
JSONResponse
(
content
=
server_info
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment