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

This commit is contained in:
Jiaxin Shan
2024-09-18 02:51:59 -07:00
committed by GitHub
parent 95965d31b6
commit e351572900
2 changed files with 14 additions and 1 deletions

View File

@@ -417,7 +417,13 @@ if envs.VLLM_ALLOW_RUNTIME_LORA_UPDATING:
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.root_path = args.root_path