diff --git a/vllm/utils.py b/vllm/utils.py index 4899b9074060e..83d94f2800448 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -205,7 +205,9 @@ def get_ip() -> str: def get_distributed_init_method(ip: str, port: int) -> str: - return f"tcp://[{ip}]:{port}" + # Brackets are not permitted in ipv4 addresses, + # see https://github.com/python/cpython/issues/103848 + return f"tcp://[{ip}]:{port}" if ":" in ip else f"tcp://{ip}:{port}" def get_open_port() -> int: