[Misc] Add argument to disable FastAPI docs (#8554)
This commit is contained in:
parent
95965d31b6
commit
e351572900
@ -417,7 +417,13 @@ if envs.VLLM_ALLOW_RUNTIME_LORA_UPDATING:
|
|||||||
|
|
||||||
|
|
||||||
def build_app(args: Namespace) -> FastAPI:
|
def build_app(args: Namespace) -> FastAPI:
|
||||||
app = FastAPI(lifespan=lifespan)
|
if args.disable_fastapi_docs:
|
||||||
|
app = FastAPI(openapi_url=None,
|
||||||
|
docs_url=None,
|
||||||
|
redoc_url=None,
|
||||||
|
lifespan=lifespan)
|
||||||
|
else:
|
||||||
|
app = FastAPI(lifespan=lifespan)
|
||||||
app.include_router(router)
|
app.include_router(router)
|
||||||
app.root_path = args.root_path
|
app.root_path = args.root_path
|
||||||
|
|
||||||
|
|||||||
@ -190,6 +190,13 @@ def make_arg_parser(parser: FlexibleArgumentParser) -> FlexibleArgumentParser:
|
|||||||
'ID numbers being printed in log.'
|
'ID numbers being printed in log.'
|
||||||
'\n\nDefault: Unlimited')
|
'\n\nDefault: Unlimited')
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--disable-fastapi-docs",
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help="Disable FastAPI's OpenAPI schema, Swagger UI, and ReDoc endpoint"
|
||||||
|
)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user