Skip to content

Commit fd5fd26

Browse files
authored
[Frontend] update priority for --api-key and VLLM_API_KEY (vllm-project#15588)
Signed-off-by: reidliu41 <reid201711@gmail.com> Co-authored-by: reidliu41 <reid201711@gmail.com>
1 parent 3bbaacb commit fd5fd26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/entrypoints/openai/api_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,8 @@ async def validation_exception_handler(_, exc):
818818
return JSONResponse(err.model_dump(),
819819
status_code=HTTPStatus.BAD_REQUEST)
820820

821-
if token := envs.VLLM_API_KEY or args.api_key:
821+
# Ensure --api-key option from CLI takes precedence over VLLM_API_KEY
822+
if token := args.api_key or envs.VLLM_API_KEY:
822823

823824
@app.middleware("http")
824825
async def authentication(request: Request, call_next):

0 commit comments

Comments
 (0)