Skip to content

Commit 381ce32

Browse files
committed
fix: SSL error when daemon request vllm
1 parent 2033aab commit 381ce32

File tree

3 files changed

+89
-4
lines changed

3 files changed

+89
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies = [
88
"httpx>=0.28.1",
99
"pyte>=0.8.2",
1010
"pytest>=9.0.2",
11+
"requests>=2.32.5",
1112
]
1213

1314
[project.optional-dependencies]

src/vllm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import httpx
1+
import requests
22
import re
3+
import urllib3
34

45
"""
56
Client that sends requests directly to vLLM servers.
@@ -10,6 +11,7 @@
1011
"""
1112

1213
proxy_host = "http://100.68.65.78:8887"
14+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
1315

1416
def build_body(prompt: str):
1517
prompt = prompt.lstrip("$ ")
@@ -37,9 +39,8 @@ def completions(prompt: str, host: str):
3739
url = host.rstrip("/") + "/" + path.lstrip("/")
3840

3941
try:
40-
with httpx.Client(timeout=120.0) as client:
41-
resp = client.post(url, json=body, headers={"Content-Type": "application/json"})
42-
except httpx.RequestError as e:
42+
resp = requests.post(url, json=body, headers={"Content-Type": "application/json"}, timeout=120.0, verify=False)
43+
except requests.RequestException as e:
4344
print("Request error:", e)
4445
return
4546

0 commit comments

Comments
 (0)