From fd09e7fa187a080204d4a325b6a64ad725c4ae3e Mon Sep 17 00:00:00 2001 From: Nick Hill Date: Mon, 5 Aug 2024 08:01:55 -0700 Subject: [PATCH] [BugFix] Use IP4 localhost form for zmq bind --- vllm/entrypoints/openai/rpc/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/entrypoints/openai/rpc/server.py b/vllm/entrypoints/openai/rpc/server.py index 7a72a6f732c99..60bb23b9bde05 100644 --- a/vllm/entrypoints/openai/rpc/server.py +++ b/vllm/entrypoints/openai/rpc/server.py @@ -30,7 +30,9 @@ def __init__(self, async_engine_args: AsyncEngineArgs, # Init socket for readiness state. self.socket = self.context.socket(zmq.constants.ROUTER) - self.socket.bind(f"tcp://localhost:{port}") + # Note numeric form of localhost should be used for zmq bind(), + # see https://stackoverflow.com/a/8958414 + self.socket.bind(f"tcp://127.0.0.1:{port}") def cleanup(self): """Cleanup all resources."""