@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c2e88a281c
Fork 0

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 4, 15:00 UTC

[Bugfix] Fix broken example opeanai client (#41088)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Apr 28, 2026 at 12:43 UTC c2e88a281c53059d023a2aee43217a7379509a4a
3 files changed +6 -9
examples/generate/multimodal/openai_chat_completion_client_for_multimodal.py
+1 -2
@@ -25,7 +25,6 @@ import os
25 import pybase64 as base64
26 import requests
27 from openai import OpenAI
28 -from utils import get_first_model
28
29 from vllm.utils.argparse_utils import FlexibleArgumentParser
30
@@ -407,7 +406,7 @@ def parse_args():
406
407 def main(args) -> None:
408 chat_type = args.chat_type
410 - model = get_first_model(client)
409 + model = client.models.list().data[0].id
410 example_function_map[chat_type](model, args.max_completion_tokens)
411
412
examples/tool_calling/openai_responses_client_with_mcp_tools.py
+4 -5
@@ -19,7 +19,6 @@ Environment variables:
19 """
20
21 from openai import OpenAI
22 -from utils import get_first_model
22
23
24 def example_no_filter():
@@ -30,7 +29,7 @@ def example_no_filter():
29
30 base_url = "http://0.0.0.0:8000/v1"
31 client = OpenAI(base_url=base_url, api_key="empty")
33 - model = get_first_model(client)
32 + model = client.models.list().data[0].id
33
34 response = client.responses.create(
35 model=model,
@@ -59,7 +58,7 @@ def example_wildcard():
58
59 base_url = "http://0.0.0.0:8000/v1"
60 client = OpenAI(base_url=base_url, api_key="empty")
62 - model = get_first_model(client)
61 + model = client.models.list().data[0].id
62
63 response = client.responses.create(
64 model=model,
@@ -95,7 +94,7 @@ def example_specific_tools():
94
95 base_url = "http://0.0.0.0:8000/v1"
96 client = OpenAI(base_url=base_url, api_key="empty")
98 - model = get_first_model(client)
97 + model = client.models.list().data[0].id
98
99 response = client.responses.create(
100 model=model,
@@ -126,7 +125,7 @@ def example_object_format():
125
126 base_url = "http://0.0.0.0:8000/v1"
127 client = OpenAI(base_url=base_url, api_key="empty")
129 - model = get_first_model(client)
128 + model = client.models.list().data[0].id
129
130 response = client.responses.create(
131 model=model,
examples/tool_calling/openai_responses_client_with_tools.py
+1 -2
@@ -14,7 +14,6 @@ vllm serve Qwen/Qwen3-1.7B --reasoning-parser qwen3 \
14 import json
15
16 from openai import OpenAI
17 -from utils import get_first_model
17
18
19 def get_weather(latitude: float, longitude: float) -> str:
@@ -51,7 +50,7 @@ input_messages = [
50 def main():
51 base_url = "http://0.0.0.0:8000/v1"
52 client = OpenAI(base_url=base_url, api_key="empty")
54 - model = get_first_model(client)
53 + model = client.models.list().data[0].id
54 response = client.responses.create(
55 model=model, input=input_messages, tools=tools, tool_choice="required"
56 )