Unverified Commit fd5fd269 authored by Reid's avatar Reid Committed by GitHub
Browse files

[Frontend] update priority for --api-key and VLLM_API_KEY (#15588)


Signed-off-by: default avatarreidliu41 <reid201711@gmail.com>
Co-authored-by: default avatarreidliu41 <reid201711@gmail.com>
parent 3bbaacbe
...@@ -818,7 +818,8 @@ def build_app(args: Namespace) -> FastAPI: ...@@ -818,7 +818,8 @@ def build_app(args: Namespace) -> FastAPI:
return JSONResponse(err.model_dump(), return JSONResponse(err.model_dump(),
status_code=HTTPStatus.BAD_REQUEST) status_code=HTTPStatus.BAD_REQUEST)
if token := envs.VLLM_API_KEY or args.api_key: # Ensure --api-key option from CLI takes precedence over VLLM_API_KEY
if token := args.api_key or envs.VLLM_API_KEY:
@app.middleware("http") @app.middleware("http")
async def authentication(request: Request, call_next): async def authentication(request: Request, call_next):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment