[docs] Refactor, remove compiled results and add gpt-oss (#9613)

Co-authored-by: zhaochenyang20 <zhaochenyang20@gmail.com>
This commit is contained in:
Chayenneandzhaochenyang20 authored and GitHub committed 2025-08-25 15:27:06 -07:00
1 parent a0a77d937b
commit 9b08d975a0
5 files changed
+176 -621

No files matched your search

+153 -147
View File
@@ -51,7 +51,8 @@
"- mistral: Mistral (e.g. mistralai/Mistral-7B-Instruct-v0.3, mistralai/Mistral-Nemo-Instruct-2407, mistralai/\n",
"Mistral-Nemo-Instruct-2407, mistralai/Mistral-7B-v0.3).\n",
"- qwen25: Qwen 2.5 (e.g. Qwen/Qwen2.5-1.5B-Instruct, Qwen/Qwen2.5-7B-Instruct) and QwQ (i.e. Qwen/QwQ-32B). Especially, for QwQ, we can enable the reasoning parser together with tool call parser, details about reasoning parser can be found in [reasoning parser](https://docs.sglang.ai/backend/separate_reasoning.html).\n",
"- deepseekv3: DeepSeek-v3 (e.g., deepseek-ai/DeepSeek-V3-0324).\n"
"- deepseekv3: DeepSeek-v3 (e.g., deepseek-ai/DeepSeek-V3-0324).\n",
"- gpt-oss: GPT-OSS (e.g., openai/gpt-oss-120b, openai/gpt-oss-20b, lmsys/gpt-oss-120b-bf16, lmsys/gpt-oss-20b-bf16). Note: The gpt-oss tool parser filters out analysis channel events and only preserves normal text. This can cause the content to be empty when explanations are in the analysis channel. To work around this, complete the tool round by returning tool results as role=\"tool\" messages, which enables the model to generate the final content."
]
},
{
@@ -354,6 +355,155 @@
"print(final_response.choices[0].message.content)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Native API and SGLang Runtime (SRT)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transformers import AutoTokenizer\n",
"import requests\n",
"\n",
"# generate an answer\n",
"tokenizer = AutoTokenizer.from_pretrained(\"Qwen/Qwen2.5-7B-Instruct\")\n",
"\n",
"messages = get_messages()\n",
"\n",
"input = tokenizer.apply_chat_template(\n",
" messages,\n",
" tokenize=False,\n",
" add_generation_prompt=True,\n",
" tools=tools,\n",
")\n",
"\n",
"gen_url = f\"http://localhost:{port}/generate\"\n",
"gen_data = {\n",
" \"text\": input,\n",
" \"sampling_params\": {\n",
" \"skip_special_tokens\": False,\n",
" \"max_new_tokens\": 1024,\n",
" \"temperature\": 0,\n",
" \"top_p\": 0.95,\n",
" },\n",
"}\n",
"gen_response = requests.post(gen_url, json=gen_data).json()[\"text\"]\n",
"print_highlight(\"==== Response ====\")\n",
"print(gen_response)\n",
"\n",
"# parse the response\n",
"parse_url = f\"http://localhost:{port}/parse_function_call\"\n",
"\n",
"function_call_input = {\n",
" \"text\": gen_response,\n",
" \"tool_call_parser\": \"qwen25\",\n",
" \"tools\": tools,\n",
"}\n",
"\n",
"function_call_response = requests.post(parse_url, json=function_call_input)\n",
"function_call_response_json = function_call_response.json()\n",
"\n",
"print_highlight(\"==== Text ====\")\n",
"print(function_call_response_json[\"normal_text\"])\n",
"print_highlight(\"==== Calls ====\")\n",
"print(\"function name: \", function_call_response_json[\"calls\"][0][\"name\"])\n",
"print(\"function arguments: \", function_call_response_json[\"calls\"][0][\"parameters\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"terminate_process(server_process)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Offline Engine API"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sglang as sgl\n",
"from sglang.srt.function_call.function_call_parser import FunctionCallParser\n",
"from sglang.srt.managers.io_struct import Tool, Function\n",
"\n",
"llm = sgl.Engine(model_path=\"Qwen/Qwen2.5-7B-Instruct\")\n",
"tokenizer = llm.tokenizer_manager.tokenizer\n",
"input_ids = tokenizer.apply_chat_template(\n",
" messages, tokenize=True, add_generation_prompt=True, tools=tools\n",
")\n",
"\n",
"# Note that for gpt-oss tool parser, adding \"no_stop_trim\": True\n",
"# to make sure the tool call token <call> is not trimmed.\n",
"\n",
"sampling_params = {\n",
" \"max_new_tokens\": 1024,\n",
" \"temperature\": 0,\n",
" \"top_p\": 0.95,\n",
" \"skip_special_tokens\": False,\n",
"}\n",
"\n",
"# 1) Offline generation\n",
"result = llm.generate(input_ids=input_ids, sampling_params=sampling_params)\n",
"generated_text = result[\"text\"] # Assume there is only one prompt\n",
"\n",
"print(\"=== Offline Engine Output Text ===\")\n",
"print(generated_text)\n",
"\n",
"\n",
"# 2) Parse using FunctionCallParser\n",
"def convert_dict_to_tool(tool_dict: dict) -> Tool:\n",
" function_dict = tool_dict.get(\"function\", {})\n",
" return Tool(\n",
" type=tool_dict.get(\"type\", \"function\"),\n",
" function=Function(\n",
" name=function_dict.get(\"name\"),\n",
" description=function_dict.get(\"description\"),\n",
" parameters=function_dict.get(\"parameters\"),\n",
" ),\n",
" )\n",
"\n",
"\n",
"tools = [convert_dict_to_tool(raw_tool) for raw_tool in tools]\n",
"\n",
"parser = FunctionCallParser(tools=tools, tool_call_parser=\"qwen25\")\n",
"normal_text, calls = parser.parse_non_stream(generated_text)\n",
"\n",
"print(\"=== Parsing Result ===\")\n",
"print(\"Normal text portion:\", normal_text)\n",
"print(\"Function call portion:\")\n",
"for call in calls:\n",
" # call: ToolCallItem\n",
" print(f\" - tool name: {call.name}\")\n",
" print(f\" parameters: {call.parameters}\")\n",
"\n",
"# 3) If needed, perform additional logic on the parsed functions, such as automatically calling the corresponding function to obtain a return value, etc."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"llm.shutdown()"
]
},
{
"cell_type": "markdown",
"metadata": {},
@@ -490,152 +640,6 @@
"terminate_process(server_process_tool_choice)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Native API and SGLang Runtime (SRT)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from transformers import AutoTokenizer\n",
"import requests\n",
"\n",
"# generate an answer\n",
"tokenizer = AutoTokenizer.from_pretrained(\"Qwen/Qwen2.5-7B-Instruct\")\n",
"\n",
"messages = get_messages()\n",
"\n",
"input = tokenizer.apply_chat_template(\n",
" messages,\n",
" tokenize=False,\n",
" add_generation_prompt=True,\n",
" tools=tools,\n",
")\n",
"\n",
"gen_url = f\"http://localhost:{port}/generate\"\n",
"gen_data = {\n",
" \"text\": input,\n",
" \"sampling_params\": {\n",
" \"skip_special_tokens\": False,\n",
" \"max_new_tokens\": 1024,\n",
" \"temperature\": 0,\n",
" \"top_p\": 0.95,\n",
" },\n",
"}\n",
"gen_response = requests.post(gen_url, json=gen_data).json()[\"text\"]\n",
"print_highlight(\"==== Response ====\")\n",
"print(gen_response)\n",
"\n",
"# parse the response\n",
"parse_url = f\"http://localhost:{port}/parse_function_call\"\n",
"\n",
"function_call_input = {\n",
" \"text\": gen_response,\n",
" \"tool_call_parser\": \"qwen25\",\n",
" \"tools\": tools,\n",
"}\n",
"\n",
"function_call_response = requests.post(parse_url, json=function_call_input)\n",
"function_call_response_json = function_call_response.json()\n",
"\n",
"print_highlight(\"==== Text ====\")\n",
"print(function_call_response_json[\"normal_text\"])\n",
"print_highlight(\"==== Calls ====\")\n",
"print(\"function name: \", function_call_response_json[\"calls\"][0][\"name\"])\n",
"print(\"function arguments: \", function_call_response_json[\"calls\"][0][\"parameters\"])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"terminate_process(server_process)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Offline Engine API"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sglang as sgl\n",
"from sglang.srt.function_call.function_call_parser import FunctionCallParser\n",
"from sglang.srt.managers.io_struct import Tool, Function\n",
"\n",
"llm = sgl.Engine(model_path=\"Qwen/Qwen2.5-7B-Instruct\")\n",
"tokenizer = llm.tokenizer_manager.tokenizer\n",
"input_ids = tokenizer.apply_chat_template(\n",
" messages, tokenize=True, add_generation_prompt=True, tools=tools\n",
")\n",
"\n",
"sampling_params = {\n",
" \"max_new_tokens\": 1024,\n",
" \"temperature\": 0,\n",
" \"top_p\": 0.95,\n",
" \"skip_special_tokens\": False,\n",
"}\n",
"\n",
"# 1) Offline generation\n",
"result = llm.generate(input_ids=input_ids, sampling_params=sampling_params)\n",
"generated_text = result[\"text\"] # Assume there is only one prompt\n",
"\n",
"print(\"=== Offline Engine Output Text ===\")\n",
"print(generated_text)\n",
"\n",
"\n",
"# 2) Parse using FunctionCallParser\n",
"def convert_dict_to_tool(tool_dict: dict) -> Tool:\n",
" function_dict = tool_dict.get(\"function\", {})\n",
" return Tool(\n",
" type=tool_dict.get(\"type\", \"function\"),\n",
" function=Function(\n",
" name=function_dict.get(\"name\"),\n",
" description=function_dict.get(\"description\"),\n",
" parameters=function_dict.get(\"parameters\"),\n",
" ),\n",
" )\n",
"\n",
"\n",
"tools = [convert_dict_to_tool(raw_tool) for raw_tool in tools]\n",
"\n",
"parser = FunctionCallParser(tools=tools, tool_call_parser=\"qwen25\")\n",
"normal_text, calls = parser.parse_non_stream(generated_text)\n",
"\n",
"print(\"=== Parsing Result ===\")\n",
"print(\"Normal text portion:\", normal_text)\n",
"print(\"Function call portion:\")\n",
"for call in calls:\n",
" # call: ToolCallItem\n",
" print(f\" - tool name: {call.name}\")\n",
" print(f\" parameters: {call.parameters}\")\n",
"\n",
"# 3) If needed, perform additional logic on the parsed functions, such as automatically calling the corresponding function to obtain a return value, etc."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"llm.shutdown()"
]
},
{
"cell_type": "markdown",
"metadata": {},
@@ -657,6 +661,8 @@
"\n",
"For more information, refer to Meta’s documentation on [Zero shot function calling](https://github.com/meta-llama/llama-models/blob/main/models/llama4/prompt_format.md#zero-shot-function-calling---system-message).\n",
"\n",
"Note that this feature is still under development on Blackwell.\n",
"\n",
"### How to enable\n",
"- Launch the server with `--tool-call-parser pythonic`\n",
"- You may also specify --chat-template with the improved template for the model (e.g., `--chat-template=examples/chat_template/tool_chat_template_llama4_pythonic.jinja`).\n",
@@ -17,7 +17,7 @@
"| [Standard Qwen3 models](https://huggingface.co/collections/Qwen/qwen3-67dd247413f0e2e4f653967f) | `<think>` … `</think>` | `qwen3` | Supports `enable_thinking` parameter |\n",
"| [Qwen3-Thinking models](https://huggingface.co/Qwen/Qwen3-235B-A22B-Thinking-2507) | `<think>` … `</think>` | `qwen3` or `qwen3-thinking` | Always generates thinking content |\n",
"| [Kimi models](https://huggingface.co/moonshotai/models) | `◁think▷` … `◁/think▷` | `kimi` | Uses special thinking delimiters |\n",
"\n",
"| [GPT OSS](https://huggingface.co/openai/gpt-oss-120b) | `<\\|channel\\|>analysis<\\|message\\|>` … `<\\|end\\|>` | `gpt-oss` | N/A |\n",
"### Model-Specific Behaviors\n",
"\n",
"**DeepSeek-R1 Family:**\n",
+10 -227
View File
@@ -36,32 +36,7 @@
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<|im_start|>system\n",
"You are a helpful assistant.<|im_end|>\n",
"<|im_start|>user\n",
"What's shown here: <|vision_start|><|image_pad|><|vision_end|>?<|im_end|>\n",
"<|im_start|>assistant\n",
"\n"
]
},
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAF8AjoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1h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EssTSaRDlgOZ4KCKYM8ASC4EpRoqbBUgRWDg1A9AFCBao2OhCYlRxsxgAEXdlZ2T+Fb/s4ATIGWbwbKXSR5qaXg9cZp/XcqwogoFJVHm1CVaVRgC+CN3NRUQeiTb2mQGJbrVaTeIuxuZ97u9/VyH4vjtydu3xrXv5jWhtzOd7u/tsYUG4CoVZiqy58H41U3Kg+KQmb483GSWgq4yYYmCYh3qdDhv5JQg7FzcLHSzDbf0yCjSTJdSapCADtcKbeo0fnq2nv2aOqguVjKuWhZegVU/xYeG7PCOCsIC68DkVC7hVWvA2gku2OB8D1MC1lEd288GaDKKHN44vB3AYiIquacoVYEPPB0IwyrnKtcqU4GQiKUxsZpKo2KEeIrCeRjSzDY2NCqozAdqbNoVAI0TQNMGBkDDy7rzbfFY0lPV18DfeQ4caGKGV2D89RoT1a8wo11229sTNX57U7UfwWdxFvqDbJVBokH37do6/UNZ75mbPDoigNTM5f2tiZvNyfbhdHdtFvtkYGLujlZeN69mPvaaCrvRozT/IetwuMY0SlGUhPZmab+2fwhEctMpFpGS8zQMypdtpPiTxjKYq546BreqwWRTTvLBdb1oPou7TJPOb+dwpsu2vkbBmdpSRvWiIqIt1tdVk97L5u1iPlvMr+82t7aFgJS21fLNbfryW1vbqp4xQN5ksotsLFD5YNADT+CrIevVCAEgBDA/2rxymXlYOXRyYj1p26OjCIkkQmppYNkBQup8fkX6ZH14gK7MYRr86cI2vLT7R4cIkItSb41uM33HRednoClf5sEwhR/mDz76GBLFZ/bYJEikZceR0UZLUiFtACiHmVng+Xy8nT4Ep55AqnodW6WUaRRg1UiLine truncated
"text/plain": [
"<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=570x380>"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Lets create a prompt.\n",
"\n",
@@ -101,22 +76,7 @@
"execution_count": null,
"id": "5",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"You have video processor config saved in `preprocessor.json` file which is deprecated. Video processor configs should be saved in their own `video_preprocessor.json` file. You can rename the file or load and save the processor back which renames it automatically. Loading from `preprocessor.json` will be removed in v5.0.\n",
"You have video processor config saved in `preprocessor.json` file which is deprecated. Video processor configs should be saved in their own `video_preprocessor.json` file. You can rename the file or load and save the processor back which renames it automatically. Loading from `preprocessor.json` will be removed in v5.0.\n",
"Loading safetensors checkpoint shards: 0% Completed | 0/2 [00:00<?, ?it/s]\n",
"Loading safetensors checkpoint shards: 50% Completed | 1/2 [00:03<00:03, 3.13s/it]\n",
"Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:06<00:00, 3.27s/it]\n",
"Loading safetensors checkpoint shards: 100% Completed | 2/2 [00:06<00:00, 3.25s/it]\n",
"\n",
"Capturing batches (bs=1 avail_mem=21.63 GB): 100%|██████████| 35/35 [00:10<00:00, 3.19it/s] \n"
]
}
],
"outputs": [],
"source": [
"from sglang import Engine\n",
"\n",
@@ -130,15 +90,7 @@
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"In the picture, a person in a yellow shirt is hanging laundry on a clothesline attached to the back of a yellow taxi in an urban setting. There are city streets, buildings, and traffic lights visible in the background. The scene appears to be incongruous and amusing, as it shows an unusual and somewhat chaotic activity happening in a busy city environment.\n"
]
}
],
"outputs": [],
"source": [
"out = llm.generate(prompt=conv.get_prompt(), image_data=[image])\n",
"print(out[\"text\"])"
@@ -157,22 +109,7 @@
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7c94dead4660409c9acfac1f3461d7d9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"# Compute the image embeddings using Huggingface.\n",
"\n",
@@ -190,15 +127,7 @@
"execution_count": null,
"id": "9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The image shows a scene with two yellow taxis in an urban setting. The taxi on the left has a red light on top, indicating that it may be waiting or preparing to drive. The other taxi, which is facing left, has its hatch open with some clothing or fabric hanging out. The background features high-rise buildings and city streets, suggesting this is taking place in a downtown area of a city. The presence of multiple flags on flagpoles indicates that there might be some celebration or event within the vicinity.\n"
]
}
],
"outputs": [],
"source": [
"processed_prompt = processor(\n",
" images=[image], text=conv.get_prompt(), return_tensors=\"pt\"\n",
@@ -245,32 +174,7 @@
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<|header_start|>user<|header_end|>\n",
"\n",
"What's shown here: <|image|>?<|eot|><|header_start|>assistant<|header_end|>\n",
"\n",
"\n",
"Image size: (570, 380)\n"
]
},
{
"data": {
"image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAF8AjoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEE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Qmb483GSWgq4yYYmCYh3qdDhv5JQg7FzcLHSzDbf0yCjSTJdSapCADtcKbeo0fnq2nv2aOqguVjKuWhZegVU/xYeG7PCOCsIC68DkVC7hVWvA2gku2OB8D1MC1lEd288GaDKKHN44vB3AYiIquacoVYEPPB0IwyrnKtcqU4GQiKUxsZpKo2KEeIrCeRjSzDY2NCqozAdqbNoVAI0TQNMGBkDDy7rzbfFY0lPV18DfeQ4caGKGV2D89RoT1a8wo11229sTNX57U7UfwWdxFvqDbJVBokH37do6/UNZ75mbPDoigNTM5f2tiZvNyfbhdHdtFvtkYGLujlZeN69mPvaaCrvRozT/IetwuMY0SlGUhPZmab+2fwhEctMpFpGS8zQMypdtpPiTxjKYq546BreqwWRTTvLBdb1oPou7TJPOb+dwpsu2vkbBmdpSRvWiIqIt1tdVk97L5u1iPlvMr+82t7aFgJS21fLNbfryW1vbqp4xQN5ksotsLFD5YNADT+CrIevVCAEgBDA/2rxymXlYOXRyYj1p26OjCIkkQmppYNkBQup8fkX6ZH14gK7MYRr86cI2vLT7R4cIkItSb41uM33HRednoClf5sEwhR/mDz76GBLFZ/bYJEikZceR0UZLUiFtACiHmVng+Xy8nT4Ep55AqnodW6WUaRRg1UiLine truncated
"text/plain": [
"<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=570x380>"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Lets create a prompt.\n",
"\n",
@@ -312,96 +216,7 @@
"execution_count": null,
"id": "14",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Loading safetensors checkpoint shards: 0% Completed | 0/50 [00:00<?, ?it/s]\n",
"Loading safetensors checkpoint shards: 2% Completed | 1/50 [00:22<18:10, 22.26s/it]\n",
"Loading safetensors checkpoint shards: 4% Completed | 2/50 [00:44<17:44, 22.17s/it]\n",
"Loading safetensors checkpoint shards: 6% Completed | 3/50 [01:06<17:24, 22.22s/it]\n",
"Loading safetensors checkpoint shards: 8% Completed | 4/50 [01:28<16:55, 22.07s/it]\n",
"Loading safetensors checkpoint shards: 10% Completed | 5/50 [01:50<16:28, 21.96s/it]\n",
"Loading safetensors checkpoint shards: 12% Completed | 6/50 [02:11<15:59, 21.80s/it]\n",
"Loading safetensors checkpoint shards: 14% Completed | 7/50 [02:34<15:52, 22.14s/it]\n",
"Loading safetensors checkpoint shards: 16% Completed | 8/50 [02:54<15:05, 21.57s/it]\n",
"Loading safetensors checkpoint shards: 18% Completed | 9/50 [03:17<14:51, 21.74s/it]\n",
"Loading safetensors checkpoint shards: 20% Completed | 10/50 [03:29<12:31, 18.79s/it]\n",
"Loading safetensors checkpoint shards: 22% Completed | 11/50 [03:32<09:10, 14.13s/it]\n",
"Loading safetensors checkpoint shards: 24% Completed | 12/50 [03:36<06:53, 10.89s/it]\n",
"Loading safetensors checkpoint shards: 26% Completed | 13/50 [03:39<05:19, 8.65s/it]\n",
"Loading safetensors checkpoint shards: 28% Completed | 14/50 [03:43<04:15, 7.09s/it]\n",
"Loading safetensors checkpoint shards: 30% Completed | 15/50 [03:46<03:29, 6.00s/it]\n",
"Loading safetensors checkpoint shards: 32% Completed | 16/50 [03:50<02:57, 5.23s/it]\n",
"Loading safetensors checkpoint shards: 34% Completed | 17/50 [03:53<02:35, 4.73s/it]\n",
"Loading safetensors checkpoint shards: 36% Completed | 18/50 [03:57<02:18, 4.33s/it]\n",
"Loading safetensors checkpoint shards: 38% Completed | 19/50 [04:00<02:06, 4.09s/it]\n",
"Loading safetensors checkpoint shards: 40% Completed | 20/50 [04:04<01:56, 3.87s/it]\n",
"Loading safetensors checkpoint shards: 42% Completed | 21/50 [04:07<01:48, 3.74s/it]\n",
"Loading safetensors checkpoint shards: 44% Completed | 22/50 [04:11<01:43, 3.71s/it]\n",
"Loading safetensors checkpoint shards: 46% Completed | 23/50 [04:14<01:37, 3.63s/it]\n",
"Loading safetensors checkpoint shards: 48% Completed | 24/50 [04:18<01:33, 3.60s/it]\n",
"Loading safetensors checkpoint shards: 50% Completed | 25/50 [04:21<01:26, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 52% Completed | 26/50 [04:21<01:02, 2.61s/it]\n",
"Loading safetensors checkpoint shards: 54% Completed | 27/50 [04:25<01:06, 2.91s/it]\n",
"Loading safetensors checkpoint shards: 56% Completed | 28/50 [04:28<01:07, 3.09s/it]\n",
"Loading safetensors checkpoint shards: 58% Completed | 29/50 [04:32<01:07, 3.20s/it]\n",
"Loading safetensors checkpoint shards: 60% Completed | 30/50 [04:35<01:05, 3.25s/it]\n",
"Loading safetensors checkpoint shards: 62% Completed | 31/50 [04:39<01:02, 3.30s/it]\n",
"Loading safetensors checkpoint shards: 64% Completed | 32/50 [04:42<01:00, 3.37s/it]\n",
"Loading safetensors checkpoint shards: 66% Completed | 33/50 [04:46<00:58, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 68% Completed | 34/50 [04:49<00:55, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 70% Completed | 35/50 [04:53<00:51, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 72% Completed | 36/50 [04:56<00:48, 3.46s/it]\n",
"Loading safetensors checkpoint shards: 74% Completed | 37/50 [05:00<00:44, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 76% Completed | 38/50 [05:03<00:41, 3.45s/it]\n",
"Loading safetensors checkpoint shards: 78% Completed | 39/50 [05:07<00:38, 3.50s/it]\n",
"Loading safetensors checkpoint shards: 80% Completed | 40/50 [05:10<00:34, 3.49s/it]\n",
"Loading safetensors checkpoint shards: 82% Completed | 41/50 [05:14<00:31, 3.49s/it]\n",
"Loading safetensors checkpoint shards: 84% Completed | 42/50 [05:17<00:27, 3.47s/it]\n",
"Loading safetensors checkpoint shards: 86% Completed | 43/50 [05:20<00:24, 3.43s/it]\n",
"Loading safetensors checkpoint shards: 88% Completed | 44/50 [05:24<00:20, 3.46s/it]\n",
"Loading safetensors checkpoint shards: 90% Completed | 45/50 [05:27<00:17, 3.44s/it]\n",
"Loading safetensors checkpoint shards: 92% Completed | 46/50 [05:31<00:13, 3.44s/it]\n",
"Loading safetensors checkpoint shards: 94% Completed | 47/50 [05:34<00:10, 3.43s/it]\n",
"Loading safetensors checkpoint shards: 96% Completed | 48/50 [05:38<00:06, 3.43s/it]\n",
"Loading safetensors checkpoint shards: 98% Completed | 49/50 [05:41<00:03, 3.45s/it]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Setting sliding_window_size to be attention_chunk_size: 8192Setting sliding_window_size to be attention_chunk_size: 8192\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Loading safetensors checkpoint shards: 100% Completed | 50/50 [05:44<00:00, 3.43s/it]\n",
"Loading safetensors checkpoint shards: 100% Completed | 50/50 [05:44<00:00, 6.90s/it]\n",
"\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Setting sliding_window_size to be attention_chunk_size: 8192\n",
"Setting sliding_window_size to be attention_chunk_size: 8192\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Capturing batches (bs=1 avail_mem=21.53 GB): 100%|██████████| 35/35 [00:15<00:00, 2.25it/s] \n"
]
}
],
"outputs": [],
"source": [
"from sglang.test.test_utils import is_in_ci\n",
"\n",
@@ -424,15 +239,7 @@
"execution_count": null,
"id": "15",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The image depicts a man ironing clothing on the back of a yellow SUV in a city street, with another yellow taxi passing by. The man is wearing a yellow shirt and appears to be ironing a blue shirt on a makeshift ironing board set up behind the SUV. The scene suggests that the man may be a street vendor or someone who is trying to make a living by providing ironing services to people on the go.\n"
]
}
],
"outputs": [],
"source": [
"if not is_in_ci():\n",
" out = llm.generate(prompt=conv.get_prompt(), image_data=[image])\n",
@@ -452,22 +259,7 @@
"execution_count": null,
"id": "17",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0eae2e36d07d42b89bc4b5ac7d62f226",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Loading checkpoint shards: 0%| | 0/50 [00:00<?, ?it/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"if not is_in_ci():\n",
" # Compute the image embeddings using Huggingface.\n",
@@ -488,16 +280,7 @@
"execution_count": null,
"id": "18",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"processed_prompt[\"pixel_values\"].shape=torch.Size([5, 3, 336, 336])\n",
"The image depicts a man ironing on a makeshift ironing board set up on the back of a yellow SUV, in the middle of a busy street. The man is wearing a yellow shirt and appears to be ironing a blue shirt. In the background, there are other yellow taxis and tall buildings, suggesting that the scene is set in a city, likely New York City. The overall scene is one of a person going about their daily activities in a busy urban environment.\n"
]
}
],
"outputs": [],
"source": [
"if not is_in_ci():\n",
" processed_prompt = processor(\n",
+5
View File
@@ -23,6 +23,11 @@ GPT‑OSS can call built‑in tools for web search and Python execution. You can
- Uses the Exa backend for web search.
- Requires an Exa API key; set `EXA_API_KEY` in your environment. Create a key at `https://exa.ai`.
### Tool & Reasoning Parser
- We support OpenAI Reasoning and Tool Call parser, as well as our SGLang native api for tool call and reasoning. Refer to [reasoning parser](../advanced_features/separate_reasoning.ipynb) and [tool call parser](../advanced_features/function_calling.ipynb) for more details.
## Notes
- Use **Python 3.12** for the demo tools. And install the required `gpt-oss` packages.
+7 -246
View File
@@ -13,63 +13,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/workspaces/sglang/.venv/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:53:32] server_args=ServerArgs(model_path='Qwen/Qwen3-4B', tokenizer_path='Qwen/Qwen3-4B', tokenizer_mode='auto', skip_tokenizer_init=False, enable_tokenizer_batch_encode=False, load_format='auto', trust_remote_code=False, dtype='auto', kv_cache_dtype='auto', quantization=None, quantization_param_path=None, context_length=None, device='cuda', served_model_name='Qwen/Qwen3-4B', chat_template=None, completion_template=None, is_embedding=False, revision=None, host='0.0.0.0', port=38475, mem_fraction_static=0.88, max_running_requests=None, max_total_tokens=None, chunked_prefill_size=8192, max_prefill_tokens=16384, schedule_policy='fcfs', schedule_conservativeness=1.0, cpu_offload_gb=0, page_size=1, tp_size=1, pp_size=1, max_micro_batch_size=None, stream_interval=1, stream_output=False, random_seed=376691526, constrained_json_whitespace_pattern=None, watchdog_timeout=300, dist_timeout=None, download_dir=None, base_gpu_id=0, gpu_id_step=1, log_level='info', log_level_http=None, log_requests=False, log_requests_level=0, show_time_cost=False, enable_metrics=False, decode_log_interval=40, api_key=None, file_storage_path='sglang_storage', enable_cache_report=False, reasoning_parser='qwen3', dp_size=1, load_balance_method='round_robin', ep_size=1, dist_init_addr=None, nnodes=1, node_rank=0, json_model_override_args='{}', lora_paths=None, max_loras_per_batch=8, lora_backend='triton', attention_backend=None, sampling_backend='flashinfer', grammar_backend='xgrammar', speculative_algorithm=None, speculative_draft_model_path=None, speculative_num_steps=None, speculative_eagle_topk=None, speculative_num_draft_tokens=None, speculative_accept_threshold_single=1.0, speculative_accept_threshold_acc=1.0, speculative_token_map=None, enable_double_sparsity=False, ds_channel_config_path=None, ds_heavy_channel_num=32, ds_heavy_token_num=256, ds_heavy_channel_type='qk', ds_sparse_decode_threshold=4096, disable_radix_cache=False, disable_cuda_graph=False, disable_cuda_graph_padding=False, enable_nccl_nvls=False, disable_outlines_disk_cache=False, disable_custom_all_reduce=False, enable_multimodal=None, disable_overlap_schedule=False, enable_mixed_chunk=False, enable_dp_attention=False, enable_ep_moe=False, enable_deepep_moe=False, deepep_mode='auto', enable_torch_compile=False, torch_compile_max_bs=32, cuda_graph_max_bs=None, cuda_graph_bs=None, torchao_config='', enable_nan_detection=False, enable_p2p_check=False, triton_attention_reduce_in_fp32=False, triton_attention_num_kv_splits=8, num_continuous_decode_steps=1, delete_ckpt_after_loading=False, enable_memory_saver=False, allow_auto_truncate=False, enable_custom_logit_processor=False, tool_call_parser=None, enable_hierarchical_cache=False, hicache_ratio=2.0, hicache_size=0, hicache_write_policy='write_through_selective', flashinfer_mla_disable_ragged=False, warmups=None, moe_dense_tp_size=None, n_share_experts_fusion=0, disable_chunked_prefix_cache=False, disable_fast_image_processor=False, debug_tensor_dump_output_folder=None, debug_tensor_dump_input_file=None, debug_tensor_dump_inject=False, disaggregation_mode='null', disaggregation_bootstrap_port=8998, disaggregation_transfer_backend='mooncake', disaggregation_ib_device=None)\n",
"[2025-05-05 17:53:38] Attention backend not set. Use flashinfer backend by default.\n",
"[2025-05-05 17:53:38] Init torch distributed begin.\n",
"[2025-05-05 17:53:38] Init torch distributed ends. mem usage=0.00 GB\n",
"[2025-05-05 17:53:38] Load weight begin. avail mem=43.89 GB\n",
"[2025-05-05 17:53:39] Using model weights format ['*.safetensors']\n",
"Loading safetensors checkpoint shards: 0% Completed | 0/3 [00:00<?, ?it/s]\n",
"Loading safetensors checkpoint shards: 67% Completed | 2/3 [00:00<00:00, 4.06it/s]\n",
"Loading safetensors checkpoint shards: 100% Completed | 3/3 [00:01<00:00, 2.52it/s]\n",
"Loading safetensors checkpoint shards: 100% Completed | 3/3 [00:01<00:00, 2.73it/s]\n",
"\n",
"[2025-05-05 17:53:40] Load weight end. type=Qwen3ForCausalLM, dtype=torch.bfloat16, avail mem=36.25 GB, mem usage=7.63 GB.\n",
"[2025-05-05 17:53:40] KV Cache is allocated. #tokens: 225647, K size: 15.49 GB, V size: 15.49 GB\n",
"[2025-05-05 17:53:40] Memory pool end. avail mem=4.71 GB\n",
"2025-05-05 17:53:41,152 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend\n",
"[2025-05-05 17:53:41] Capture cuda graph begin. This can take up to several minutes. avail mem=4.09 GB\n",
"[2025-05-05 17:53:41] Capture cuda graph bs [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160]\n",
"Capturing batches (avail_mem=4.06 GB): 0%| | 0/23 [00:00<?, ?it/s]2025-05-05 17:53:41,620 - INFO - flashinfer.jit: Loading JIT ops: batch_decode_with_kv_cache_dtype_q_bf16_dtype_kv_bf16_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False\n",
"2025-05-05 17:53:41,642 - INFO - flashinfer.jit: Finished loading JIT ops: batch_decode_with_kv_cache_dtype_q_bf16_dtype_kv_bf16_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False\n",
"Capturing batches (avail_mem=2.68 GB): 100%|██████████| 23/23 [00:06<00:00, 3.75it/s]\n",
"[2025-05-05 17:53:47] Capture cuda graph end. Time elapsed: 6.18 s. mem usage=1.41 GB. avail mem=2.67 GB.\n",
"[2025-05-05 17:53:47] max_total_num_tokens=225647, chunked_prefill_size=8192, max_prefill_tokens=16384, max_running_requests=2821, context_len=40960\n",
"[2025-05-05 17:53:48] INFO: Started server process [1104179]\n",
"[2025-05-05 17:53:48] INFO: Waiting for application startup.\n",
"[2025-05-05 17:53:48] INFO: Application startup complete.\n",
"[2025-05-05 17:53:48] INFO: Uvicorn running on http://0.0.0.0:38475 (Press CTRL+C to quit)\n",
"[2025-05-05 17:53:48] INFO: 127.0.0.1:37502 - \"GET /v1/models HTTP/1.1\" 200 OK\n",
"[2025-05-05 17:53:49] INFO: 127.0.0.1:37516 - \"GET /get_model_info HTTP/1.1\" 200 OK\n",
"[2025-05-05 17:53:49] Prefill batch. #new-seq: 1, #new-token: 6, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"2025-05-05 17:53:49,777 - INFO - flashinfer.jit: Loading JIT ops: batch_prefill_with_kv_cache_dtype_q_bf16_dtype_kv_bf16_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False_f16qk_False\n",
"2025-05-05 17:53:49,799 - INFO - flashinfer.jit: Finished loading JIT ops: batch_prefill_with_kv_cache_dtype_q_bf16_dtype_kv_bf16_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False_f16qk_False\n",
"[2025-05-05 17:53:50] INFO: 127.0.0.1:37526 - \"POST /generate HTTP/1.1\" 200 OK\n",
"[2025-05-05 17:53:50] The server is fired up and ready to roll!\n",
"\n",
"\n",
" NOTE: Typically, the server runs in a separate terminal.\n",
" In this notebook, we run the server and notebook code together, so their outputs are combined.\n",
" To improve clarity, the server logs are displayed in the original black color, while the notebook outputs are highlighted in blue.\n",
" We are running those notebooks in a CI parallel environment, so the throughput is not representative of the actual performance.\n",
" \n",
"Server started on http://localhost:38475\n"
]
}
],
"outputs": [],
"source": [
"from sglang import separate_reasoning, assistant_begin, assistant_end\n",
"from sglang import assistant, function, gen, system, user\n",
@@ -105,15 +49,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:53:53] INFO: 127.0.0.1:37530 - \"GET /get_model_info HTTP/1.1\" 200 OK\n"
]
}
],
"outputs": [],
"source": [
"set_default_backend(\n",
" RuntimeEndpoint(f\"http://localhost:{port}\", chat_template_name=\"qwen\")\n",
@@ -131,41 +67,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:53:53] Prefill batch. #new-seq: 1, #new-token: 31, #cached-token: 0, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:53:54] Decode batch. #running-req: 1, #token: 64, token usage: 0.00, gen throughput (token/s): 6.00, #queue-req: 0\n",
"[2025-05-05 17:53:54] Decode batch. #running-req: 1, #token: 104, token usage: 0.00, gen throughput (token/s): 82.06, #queue-req: 0\n",
"[2025-05-05 17:53:55] Decode batch. #running-req: 1, #token: 144, token usage: 0.00, gen throughput (token/s): 81.56, #queue-req: 0\n",
"[2025-05-05 17:53:55] Decode batch. #running-req: 1, #token: 184, token usage: 0.00, gen throughput (token/s): 81.14, #queue-req: 0\n",
"[2025-05-05 17:53:56] Decode batch. #running-req: 1, #token: 224, token usage: 0.00, gen throughput (token/s): 80.91, #queue-req: 0\n",
"[2025-05-05 17:53:56] Decode batch. #running-req: 1, #token: 264, token usage: 0.00, gen throughput (token/s): 80.55, #queue-req: 0\n",
"[2025-05-05 17:53:56] INFO: 127.0.0.1:37538 - \"POST /generate HTTP/1.1\" 200 OK\n",
"<think>\n",
"Okay, the user is asking for three countries and their capitals. Let me think about which countries to choose. I should pick some well-known ones to make it easy for the user.\n",
"\n",
"First, France is a good start because its capital is Paris, which is a major city. Then maybe Germany with Berlin. Those are both in Europe and have clear capitals. \n",
"\n",
"Next, I need a country from another continent. Let's go with Japan, which has Tokyo as its capital. That covers Asia. \n",
"\n",
"Wait, should I check if there are any countries with non-obvious capitals? Maybe not necessary. The user probably wants straightforward answers. \n",
"\n",
"Let me confirm the capitals again. France - Paris, Germany - Berlin, Japan - Tokyo. Yep, that's correct. \n",
"\n",
"I should present them in a clear list. Maybe number them and list each with the capital. Keep it simple and to the point. No need for extra info unless the user asks. \n",
"\n",
"Alright, that should cover it. Three countries, their capitals, correct and easy to understand.\n",
"</think>\n",
"\n",
"1. **France** - Paris \n",
"2. **Germany** - Berlin \n",
"3. **Japan** - Tokyo\n"
]
}
],
"outputs": [],
"source": [
"@function\n",
"def basic_qa(s, question):\n",
@@ -191,38 +93,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dict_keys(['answer', 'answer_reasoning_content'])\n",
"[2025-05-05 17:56:44] Prefill batch. #new-seq: 1, #new-token: 1, #cached-token: 30, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:56:44] Decode batch. #running-req: 1, #token: 63, token usage: 0.00, gen throughput (token/s): 3.77, #queue-req: 0\n",
"[2025-05-05 17:56:45] Decode batch. #running-req: 1, #token: 103, token usage: 0.00, gen throughput (token/s): 82.12, #queue-req: 0\n",
"[2025-05-05 17:56:45] Decode batch. #running-req: 1, #token: 143, token usage: 0.00, gen throughput (token/s): 81.60, #queue-req: 0\n",
"[2025-05-05 17:56:46] Decode batch. #running-req: 1, #token: 183, token usage: 0.00, gen throughput (token/s): 81.17, #queue-req: 0\n",
"[2025-05-05 17:56:46] Decode batch. #running-req: 1, #token: 223, token usage: 0.00, gen throughput (token/s): 80.90, #queue-req: 0\n",
"[2025-05-05 17:56:46] INFO: 127.0.0.1:45282 - \"POST /generate HTTP/1.1\" 200 OK\n",
"\n",
"Separated Reasoning Content:\n",
"Okay, the user is asking for three countries and their capitals. Let me think. I need to make sure the countries are correct and their capitals are properly matched.\n",
"\n",
"First, I should start with a well-known country. France is a good example. Its capital is Paris. That's straightforward. Next, maybe a country in Asia. Japan's capital is Tokyo. That's correct. Then, perhaps a country in Africa. Egypt's capital is Cairo. Wait, is that right? Yes, Egypt's capital is indeed Cairo. Let me double-check. France - Paris, Japan - Tokyo, Egypt - Cairo. Those are all correct. I should present them in a clear list format. Make sure the country names are spelled correctly and the capitals are properly capitalized. No need for any extra information, just the three pairs. That should answer the user's question effectively.\n",
"\n",
"\n",
"\n",
"Content:\n",
"1. **France** - Paris \n",
"2. **Japan** - Tokyo \n",
"3. **Egypt** - Cairo\n",
"\n",
"\n",
"Messages:\n",
"{'role': 'assistant', 'content': '1. **France** - Paris \\n2. **Japan** - Tokyo \\n3. **Egypt** - Cairo'}\n"
]
}
],
"outputs": [],
"source": [
"@function\n",
"def basic_qa_separate_reasoning(s, question):\n",
@@ -254,71 +125,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:54:03] Decode batch. #running-req: 1, #token: 0, token usage: 0.00, gen throughput (token/s): 79.25, #queue-req: 0\n",
"[2025-05-05 17:54:03] Prefill batch. #new-seq: 1, #new-token: 18, #cached-token: 18, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:54:03] Decode batch. #running-req: 1, #token: 77, token usage: 0.00, gen throughput (token/s): 75.90, #queue-req: 0\n",
"[2025-05-05 17:54:04] Decode batch. #running-req: 1, #token: 117, token usage: 0.00, gen throughput (token/s): 81.85, #queue-req: 0\n",
"[2025-05-05 17:54:04] Decode batch. #running-req: 1, #token: 157, token usage: 0.00, gen throughput (token/s): 81.36, #queue-req: 0\n",
"[2025-05-05 17:54:05] Decode batch. #running-req: 1, #token: 197, token usage: 0.00, gen throughput (token/s): 81.01, #queue-req: 0\n",
"[2025-05-05 17:54:05] Decode batch. #running-req: 1, #token: 237, token usage: 0.00, gen throughput (token/s): 80.80, #queue-req: 0\n",
"[2025-05-05 17:54:06] Decode batch. #running-req: 1, #token: 277, token usage: 0.00, gen throughput (token/s): 80.43, #queue-req: 0\n",
"[2025-05-05 17:54:06] Decode batch. #running-req: 1, #token: 317, token usage: 0.00, gen throughput (token/s): 80.10, #queue-req: 0\n",
"[2025-05-05 17:54:07] Decode batch. #running-req: 1, #token: 357, token usage: 0.00, gen throughput (token/s): 79.83, #queue-req: 0\n",
"[2025-05-05 17:54:07] INFO: 127.0.0.1:41424 - \"POST /generate HTTP/1.1\" 200 OK\n",
"\n",
"\n",
"first_answer:\n",
"Here’s a list of three countries and their capitals:\n",
"\n",
"1. **France** – **Paris** \n",
"2. **United States** – **Washington, D.C.** \n",
"3. **Brazil** – **Brasília** \n",
"\n",
"Let me know if you'd like more examples! 😊\n",
"\n",
"\n",
"first_answer_reasoning_content:\n",
"Okay, the user is asking for a list of three countries and their capitals. Let me think about which countries to choose. They might be a student studying geography or someone just curious. I should pick well-known countries to make it easier for them.\n",
"\n",
"First, I'll start with the most obvious ones. France and its capital Paris are a classic example. Then, maybe the United States with Washington, D.C. That's another common one. For the third country, perhaps Brazil with Brasília? Wait, I should make sure I'm correct about the capitals. Let me double-check: France is Paris, USA is Washington, D.C., and Brazil is indeed Brasília. \n",
"\n",
"Alternatively, maybe including a country from a different continent could be better? Like Japan with Tokyo? But the user didn't specify any particular region. Since the first two are from Europe and North America, adding a South American country might be a good mix. \n",
"\n",
"Wait, but the user just asked for three, so as long as they're accurate, it's fine. I'll go with France, USA, and Brazil. Let me make sure I get the spelling right. Paris, Washington D.C., Brasília. Yeah, that's correct. I should present them in a clear list format. The user might need this for a school assignment or a quiz. Alright, that should cover it.\n",
"\n",
"[2025-05-05 17:54:07] Prefill batch. #new-seq: 1, #new-token: 83, #cached-token: 36, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:54:07] Decode batch. #running-req: 1, #token: 138, token usage: 0.00, gen throughput (token/s): 76.16, #queue-req: 0\n",
"[2025-05-05 17:54:08] Decode batch. #running-req: 1, #token: 178, token usage: 0.00, gen throughput (token/s): 81.10, #queue-req: 0\n",
"[2025-05-05 17:54:08] Decode batch. #running-req: 1, #token: 218, token usage: 0.00, gen throughput (token/s): 80.91, #queue-req: 0\n",
"[2025-05-05 17:54:09] Decode batch. #running-req: 1, #token: 258, token usage: 0.00, gen throughput (token/s): 80.63, #queue-req: 0\n",
"[2025-05-05 17:54:09] Decode batch. #running-req: 1, #token: 298, token usage: 0.00, gen throughput (token/s): 80.29, #queue-req: 0\n",
"[2025-05-05 17:54:10] Decode batch. #running-req: 1, #token: 338, token usage: 0.00, gen throughput (token/s): 79.96, #queue-req: 0\n",
"[2025-05-05 17:54:10] INFO: 127.0.0.1:47266 - \"POST /generate HTTP/1.1\" 200 OK\n",
"\n",
"\n",
"second_answer:\n",
"Here’s another list of three countries and their capitals:\n",
"\n",
"1. **Nigeria** – **Lagos** \n",
"2. **Japan** – **Tokyo** \n",
"3. **Argentina** – **Buenos Aires** \n",
"\n",
"Let me know if you'd like more examples! 😊\n",
"\n",
"\n",
"second_answer_reasoning_content:\n",
"Okay, the user asked for another list of three countries and their capitals. Let me think about what they might need. They previously got France, the US, and Brazil. Maybe they want more variety or different regions? I should pick countries from different continents to cover a broad range.\n",
"\n",
"First, maybe include a country from Africa. Lagos is the capital of Nigeria, which is a common example. Then, Asia – maybe Japan, with Tokyo. That's a major country. Then, a country from South America, like Argentina with Buenos Aires. That gives a good mix. I should check if those capitals are correct. Lagos is right for Nigeria, Tokyo for Japan, and Buenos Aires for Argentina. Yeah, that works. I'll present them in a list format again, making sure to mention each country and its capital clearly. Make sure the response is friendly and offers further help if needed.\n",
"\n"
]
}
],
"outputs": [],
"source": [
"@function\n",
"def multi_turn_qa(s):\n",
@@ -360,23 +167,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:54:10] Prefill batch. #new-seq: 1, #new-token: 9, #cached-token: 26, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:54:10] Decode batch. #running-req: 1, #token: 51, token usage: 0.00, gen throughput (token/s): 76.50, #queue-req: 0\n",
"[2025-05-05 17:54:10] INFO: 127.0.0.1:47276 - \"POST /generate HTTP/1.1\" 200 OK\n",
"Reasoning Content:\n",
" \n",
"Content:\n",
" 1. France - Paris \n",
"2. Germany - Berlin \n",
"3. Japan - Tokyo\n"
]
}
],
"outputs": [],
"source": [
"reasoning_state = basic_qa_separate_reasoning(\n",
" \"List 3 countries and their capitals. /no_think\"\n",
@@ -423,37 +214,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2025-05-05 17:54:11] Prefill batch. #new-seq: 1, #new-token: 26, #cached-token: 8, token usage: 0.00, #running-req: 0, #queue-req: 0\n",
"[2025-05-05 17:54:11] Decode batch. #running-req: 1, #token: 68, token usage: 0.00, gen throughput (token/s): 47.33, #queue-req: 0\n",
"[2025-05-05 17:54:12] Decode batch. #running-req: 1, #token: 108, token usage: 0.00, gen throughput (token/s): 83.03, #queue-req: 0\n",
"[2025-05-05 17:54:12] Decode batch. #running-req: 1, #token: 148, token usage: 0.00, gen throughput (token/s): 82.51, #queue-req: 0\n",
"[2025-05-05 17:54:13] Decode batch. #running-req: 1, #token: 188, token usage: 0.00, gen throughput (token/s): 82.06, #queue-req: 0\n",
"[2025-05-05 17:54:13] Decode batch. #running-req: 1, #token: 228, token usage: 0.00, gen throughput (token/s): 81.80, #queue-req: 0\n",
"[2025-05-05 17:54:14] Decode batch. #running-req: 1, #token: 268, token usage: 0.00, gen throughput (token/s): 81.48, #queue-req: 0\n",
"[2025-05-05 17:54:14] Decode batch. #running-req: 1, #token: 308, token usage: 0.00, gen throughput (token/s): 81.14, #queue-req: 0\n",
"[2025-05-05 17:54:15] Decode batch. #running-req: 1, #token: 348, token usage: 0.00, gen throughput (token/s): 80.84, #queue-req: 0\n",
"[2025-05-05 17:54:15] INFO: 127.0.0.1:47290 - \"POST /generate HTTP/1.1\" 200 OK\n",
"Answer:\n",
"2023-10-05\n",
"\n",
"\n",
"Reasoning Content:\n",
"Okay, the user is asking for the IP addresses of Google's DNS servers. Let me recall what I know about DNS servers. Google provides two public DNS servers, right? They're commonly used for their reliability and speed.\n",
"\n",
"I think the primary one is 8.8.8.8. Wait, isn't there another one? Oh yeah, 8.8.4.4. Those are the two main ones. Let me make sure I'm not mixing them up with other providers. For example, Cloudflare uses 1.1.1.1 and 1.0.0.1. But Google's are definitely 8.8.8.8 and 8.8.4.4. \n",
"\n",
"I should check if there are any other IP addresses, but I don't think so. They have two main ones. The user might be looking to set up their DNS settings, so providing both is important. Also, maybe mention that they're both in the same range, which is 8.8.0.0/14. But the user just asked for the IP addresses, so maybe just list them. \n",
"\n",
"Wait, the user said \"just provide the answer,\" so maybe they don't need extra info. But to be thorough, I should confirm that those are the correct ones. Let me think if there's any chance of confusion. No, 8.8.8.8 is the primary, and 8.8.4.4 is the secondary. Yeah, that's right. So the answer is those two IPs.\n",
"\n"
]
}
],
"outputs": [],
"source": [
"print_highlight(f\"Answer:\\n{reasoning_state['answer']}\")\n",
"print_highlight(\n",