[P/D] pd proxy support ipv6 (#4161)
### What this PR does / why we need it? pd proxy support ipv6, mooncake connector check whether the IPv6 address is used and notify the user. - vLLM version: v0.11.0 - vLLM main: https://github.com/vllm-project/vllm/commit/2918c1b49c88c29783c86f78d2c4221cb9622379 --------- Signed-off-by: liziyu <liziyu16@huawei.com>
This commit is contained in:
1 parent
0d04ad8c8f
commit
a30261f779
5 files changed
+32
-8
No files matched your search
@@ -88,6 +88,7 @@ import argparse
|
||||
import asyncio
|
||||
import functools
|
||||
import heapq
|
||||
import ipaddress
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
@@ -115,7 +116,13 @@ class ServerState:
|
||||
def __init__(self, host, port):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv4Address):
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
elif isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
else:
|
||||
raise RuntimeError(f"Invild host IP address {ip}")
|
||||
self.client = httpx.AsyncClient(timeout=None,
|
||||
base_url=self.url,
|
||||
limits=httpx.Limits(
|
||||
@@ -356,6 +363,9 @@ async def send_request_to_service(client: httpx.AsyncClient,
|
||||
req_data = req_data.copy()
|
||||
req_data["stream"] = False
|
||||
req_data["max_tokens"] = 1
|
||||
req_data["min_tokens"] = 1
|
||||
if "max_completion_tokens" in req_data:
|
||||
req_data["max_completion_tokens"] = 1
|
||||
if "stream_options" in req_data:
|
||||
del req_data["stream_options"]
|
||||
headers = {
|
||||
|
||||
@@ -88,6 +88,7 @@ import argparse
|
||||
import asyncio
|
||||
import functools
|
||||
import heapq
|
||||
import ipaddress
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@@ -117,7 +118,13 @@ class ServerState:
|
||||
def __init__(self, host, port):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv4Address):
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
elif isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
else:
|
||||
raise RuntimeError(f"Invild host IP address {ip}")
|
||||
self.client = httpx.AsyncClient(timeout=None,
|
||||
base_url=self.url,
|
||||
limits=httpx.Limits(
|
||||
@@ -366,6 +373,8 @@ async def send_request_to_service(client: httpx.AsyncClient,
|
||||
req_data["stream"] = False
|
||||
req_data["max_tokens"] = 1
|
||||
req_data["min_tokens"] = 1
|
||||
if "max_completion_tokens" in req_data:
|
||||
req_data["max_completion_tokens"] = 1
|
||||
if "stream_options" in req_data:
|
||||
del req_data["stream_options"]
|
||||
headers = {
|
||||
|
||||
Reference in new issue
Block a user