[Refactor] [4/N] Move VLLM_SERVER_DEV endpoints into the serve directory (#30749)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-12-17 18:27:30 +08:00
committed by GitHub
parent f284d7bd0c
commit 9ad5b21710
19 changed files with 259 additions and 151 deletions

View File

@@ -4,8 +4,19 @@
from fastapi import FastAPI
import vllm.envs as envs
from vllm.logger import init_logger
logger = init_logger(__name__)
def register_vllm_serve_api_routers(app: FastAPI):
if envs.VLLM_SERVER_DEV_MODE:
logger.warning(
"SECURITY WARNING: Development endpoints are enabled! "
"This should NOT be used in production!"
)
from vllm.entrypoints.serve.lora.api_router import (
attach_router as attach_lora_router,
)
@@ -29,6 +40,18 @@ def register_vllm_serve_api_routers(app: FastAPI):
attach_sleep_router(app)
from vllm.entrypoints.serve.rpc.api_router import (
attach_router as attach_rpc_router,
)
attach_rpc_router(app)
from vllm.entrypoints.serve.cache.api_router import (
attach_router as attach_cache_router,
)
attach_cache_router(app)
from vllm.entrypoints.serve.tokenize.api_router import (
attach_router as attach_tokenize_router,
)
@@ -58,3 +81,9 @@ def register_vllm_serve_api_routers(app: FastAPI):
)
attach_health_router(app)
from vllm.entrypoints.serve.instrumentator.server_info import (
attach_router as attach_server_info_router,
)
attach_server_info_router(app)