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 14, 05:30 UTC
[gpt-oss] Enable unit test for response API harmony integration (#23533)
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Chen Zhang committed
Aug 26, 2025 at 18:23 UTC
eb1995167e04e01c465e1cf4c39d5fd0b2031724
1 file changed
+28
-17
tests/entrypoints/openai/test_response_api_with_harmony.py
+28
-17
@@ -11,18 +11,25 @@ from openai import BadRequestError, NotFoundError, OpenAI
11
12
from ...utils import RemoteOpenAIServer
13
14
-pytest.skip(allow_module_level=True, reason="gpt-oss can't run on CI yet.")
15
-
14
MODEL_NAME = "openai/gpt-oss-20b"
17
-DTYPE = "bfloat16"
15
16
17
@pytest.fixture(scope="module")
21
-def server():
18
+def monkeypatch_module():
19
+ from _pytest.monkeypatch import MonkeyPatch
20
+ mpatch = MonkeyPatch()
21
+ yield mpatch
22
+ mpatch.undo()
23
+
24
+
25
+@pytest.fixture(scope="module")
26
+def server(monkeypatch_module: pytest.MonkeyPatch):
27
args = ["--enforce-eager", "--tool-server", "demo"]
28
24
- with RemoteOpenAIServer(MODEL_NAME, args) as remote_server:
25
- yield remote_server
29
+ with monkeypatch_module.context() as m:
30
+ m.setenv("VLLM_ENABLE_RESPONSES_API_STORE", "1")
31
+ with RemoteOpenAIServer(MODEL_NAME, args) as remote_server:
32
+ yield remote_server
33
34
35
@pytest_asyncio.fixture
@@ -269,10 +276,11 @@ async def test_stateful_multi_turn(client: OpenAI, model_name: str):
276
@pytest.mark.asyncio
277
@pytest.mark.parametrize("model_name", [MODEL_NAME])
278
async def test_streaming(client: OpenAI, model_name: str):
279
+ # TODO: Add back when web search and code interpreter are available in CI
280
prompts = [
281
"tell me a story about a cat in 20 words",
274
- "What is 13 * 24? Use python to calculate the result.",
275
- "When did Jensen found NVIDIA? Search it and answer the year only.",
282
+ # "What is 13 * 24? Use python to calculate the result.",
283
+ # "When did Jensen found NVIDIA? Search it and answer the year only.",
284
]
285
286
for prompt in prompts:
@@ -281,15 +289,15 @@ async def test_streaming(client: OpenAI, model_name: str):
289
input=prompt,
290
reasoning={"effort": "low"},
291
tools=[
284
- {
285
- "type": "web_search_preview"
286
- },
287
- {
288
- "type": "code_interpreter",
289
- "container": {
290
- "type": "auto"
291
- }
292
- },
292
+ # {
293
+ # "type": "web_search_preview"
294
+ # },
295
+ # {
296
+ # "type": "code_interpreter",
297
+ # "container": {
298
+ # "type": "auto"
299
+ # }
300
+ # },
301
],
302
stream=True,
303
)
@@ -317,6 +325,7 @@ async def test_streaming(client: OpenAI, model_name: str):
325
326
@pytest.mark.asyncio
327
@pytest.mark.parametrize("model_name", [MODEL_NAME])
328
+@pytest.mark.skip(reason="Web search tool is not available in CI yet.")
329
async def test_web_search(client: OpenAI, model_name: str):
330
response = await client.responses.create(
331
model=model_name,
@@ -331,6 +340,7 @@ async def test_web_search(client: OpenAI, model_name: str):
340
341
@pytest.mark.asyncio
342
@pytest.mark.parametrize("model_name", [MODEL_NAME])
343
+@pytest.mark.skip(reason="Code interpreter tool is not available in CI yet.")
344
async def test_code_interpreter(client: OpenAI, model_name: str):
345
response = await client.responses.create(
346
model=model_name,
@@ -436,6 +446,7 @@ async def test_function_calling(client: OpenAI, model_name: str):
446
447
@pytest.mark.asyncio
448
@pytest.mark.parametrize("model_name", [MODEL_NAME])
449
+@pytest.mark.flaky(reruns=5)
450
async def test_function_calling_multi_turn(client: OpenAI, model_name: str):
451
tools = [
452
{