@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 2238a12c13
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 05:00 UTC

[Misc] support collect_env for endpoint /server_info (#33246)

Signed-off-by: yang.xiao <yang.xiao@daocloud.io>

Xiao Yang committed Feb 1, 2026 at 01:42 UTC 2238a12c13b9a1e27f132473a0fff1b4b233b1dc
1 file changed +9
vllm/entrypoints/serve/instrumentator/server_info.py
+9
@@ -2,6 +2,8 @@
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
5 +import asyncio
6 +import functools
7 from typing import Annotated, Literal
8
9 import pydantic
@@ -9,6 +11,7 @@ from fastapi import APIRouter, FastAPI, Query, Request
11 from fastapi.responses import JSONResponse
12
13 import vllm.envs as envs
14 +from vllm.collect_env import get_env_info
15 from vllm.config import VllmConfig
16 from vllm.logger import init_logger
17
@@ -32,6 +35,11 @@ def _get_vllm_env_vars():
35 return vllm_envs
36
37
38 +@functools.lru_cache(maxsize=1)
39 +def _get_system_env_info_cached():
40 + return get_env_info()._asdict()
41 +
42 +
43 @router.get("/server_info")
44 async def show_server_info(
45 raw_request: Request,
@@ -46,6 +54,7 @@ async def show_server_info(
54 ),
55 # fallback=str is needed to handle e.g. torch.dtype
56 "vllm_env": _get_vllm_env_vars(),
57 + "system_env": await asyncio.to_thread(_get_system_env_info_cached),
58 }
59 return JSONResponse(content=server_info)
60