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

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

Signed-off-by: reidliu41 <reid201711@gmail.com> Co-authored-by: reidliu41 <reid201711@gmail.com>

Reid committed Mar 28, 2025 at 19:40 UTC fd5fd2690275e90865023a0bcac0047ecb3f3897
1 file changed +2 -1
vllm/entrypoints/openai/api_server.py
+2 -1
@@ -818,7 +818,8 @@ def build_app(args: Namespace) -> FastAPI:
818 return JSONResponse(err.model_dump(),
819 status_code=HTTPStatus.BAD_REQUEST)
820
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:
823
824 @app.middleware("http")
825 async def authentication(request: Request, call_next):