@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e351572900
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 16, 15:45 UTC

[Misc] Add argument to disable FastAPI docs (#8554)

Jiaxin Shan committed Sep 18, 2024 at 02:51 UTC e351572900f7d87e14fe203ea3a49c1c7ddae0d6
2 files changed +14 -1
vllm/entrypoints/openai/api_server.py
+7 -1
@@ -417,7 +417,13 @@ if envs.VLLM_ALLOW_RUNTIME_LORA_UPDATING:
417
418
419 def build_app(args: Namespace) -> FastAPI:
420 - app = FastAPI(lifespan=lifespan)
420 + if args.disable_fastapi_docs:
421 + app = FastAPI(openapi_url=None,
422 + docs_url=None,
423 + redoc_url=None,
424 + lifespan=lifespan)
425 + else:
426 + app = FastAPI(lifespan=lifespan)
427 app.include_router(router)
428 app.root_path = args.root_path
429
vllm/entrypoints/openai/cli_args.py
+7
@@ -190,6 +190,13 @@ def make_arg_parser(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
190 'ID numbers being printed in log.'
191 '\n\nDefault: Unlimited')
192
193 + parser.add_argument(
194 + "--disable-fastapi-docs",
195 + action='store_true',
196 + default=False,
197 + help="Disable FastAPI's OpenAPI schema, Swagger UI, and ReDoc endpoint"
198 + )
199 +
200 return parser
201
202