From a8238bbdb086d2e25a6c1a16b3438e0ffeb0de89 Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Wed, 7 May 2025 21:48:57 -0400 Subject: [PATCH] [Chore][Doc] uses model id determined from OpenAI client (#17815) Signed-off-by: Aaron Pham --- .../online_serving/openai_chat_completion_structured_outputs.py | 2 +- .../openai_chat_completion_structured_outputs_structural_tag.py | 2 +- .../openai_chat_completion_structured_outputs_with_reasoning.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/online_serving/openai_chat_completion_structured_outputs.py b/examples/online_serving/openai_chat_completion_structured_outputs.py index 9c57af1c1..660369e55 100644 --- a/examples/online_serving/openai_chat_completion_structured_outputs.py +++ b/examples/online_serving/openai_chat_completion_structured_outputs.py @@ -138,7 +138,7 @@ def main(): api_key="-", ) - model = "Qwen/Qwen2.5-3B-Instruct" + model = client.models.list().data[0].id print("Guided Choice Completion:") print(guided_choice_completion(client, model)) diff --git a/examples/online_serving/openai_chat_completion_structured_outputs_structural_tag.py b/examples/online_serving/openai_chat_completion_structured_outputs_structural_tag.py index b807bc540..42aa12c45 100644 --- a/examples/online_serving/openai_chat_completion_structured_outputs_structural_tag.py +++ b/examples/online_serving/openai_chat_completion_structured_outputs_structural_tag.py @@ -59,7 +59,7 @@ and San Francisco? }] response = client.chat.completions.create( - model="meta-llama/Llama-3.1-8B-Instruct", + model=client.models.list().data[0].id, messages=messages, response_format={ "type": diff --git a/examples/online_serving/openai_chat_completion_structured_outputs_with_reasoning.py b/examples/online_serving/openai_chat_completion_structured_outputs_with_reasoning.py index 5da9236c5..a04f0cdf1 100644 --- a/examples/online_serving/openai_chat_completion_structured_outputs_with_reasoning.py +++ b/examples/online_serving/openai_chat_completion_structured_outputs_with_reasoning.py @@ -4,7 +4,7 @@ An example shows how to generate structured outputs from reasoning models like DeepSeekR1. The thinking process will not be guided by the JSON schema provided by the user. Only the final output will be structured. -To run this example, you need to start the vLLM server with the reasoning +To run this example, you need to start the vLLM server with the reasoning parser: ```bash