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 17, 03:00 UTC
[Frontend][Bugfix] allow using the default middleware with a root path (#3788)
Co-authored-by: A-Mahla <>
A-Mahla committed
Apr 2, 2024 at 10:20 UTC
0739b1947f4081b0edafc7951134a928e39302e7
1 file changed
+2
-1
vllm/entrypoints/openai/api_server.py
+2
-1
@@ -127,7 +127,8 @@ if __name__ == "__main__":
127
128
@app.middleware("http")
129
async def authentication(request: Request, call_next):
130
- if not request.url.path.startswith("/v1"):
130
+ root_path = "" if args.root_path is None else args.root_path
131
+ if not request.url.path.startswith(f"{root_path}/v1"):
132
return await call_next(request)
133
if request.headers.get("Authorization") != "Bearer " + token:
134
return JSONResponse(content={"error": "Unauthorized"},