Skip to content

Update tool parser and related documentation#11223

Merged
JustinTong0323 merged 5 commits intosgl-project:mainfrom
JustinTong0323:xinyuan-update-tool-call-parser
Oct 7, 2025
Merged

Update tool parser and related documentation#11223
JustinTong0323 merged 5 commits intosgl-project:mainfrom
JustinTong0323:xinyuan-update-tool-call-parser

Conversation

@JustinTong0323
Copy link
Collaborator

@JustinTong0323 JustinTong0323 commented Oct 5, 2025

  • Updated supported parsers table to include Qwen, DeepSeek, GLM, and Mistral models.
  • Refactored tool call parser mappings to use simplified names.
  • Implemented deprecation warnings for outdated tool call parsers in server arguments handling.

Motivation

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

- Added reasoning parser note for reasoning models in tool parser documentation.
- Updated supported parsers table to include Qwen, DeepSeek, GLM, and Mistral models.
- Refactored tool call parser mappings to use simplified names.
- Implemented deprecation warnings for outdated tool call parsers in server arguments handling.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JustinTong0323, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the tool parsing capabilities and user experience by updating relevant documentation, streamlining internal parser naming conventions, and introducing deprecation warnings for older parser names. These changes aim to improve clarity, maintainability, and compatibility with a broader range of language models.

Highlights

  • Documentation Update: The tool parser documentation has been updated to include a note about enabling reasoning parsers for reasoning models and an expanded table of supported models, now including Qwen, DeepSeek, GLM, and Mistral series.
  • Parser Name Refactoring: Tool call parser mappings have been refactored to use simplified names, specifically changing 'qwen25' to 'qwen' and 'glm45' to 'glm' for better consistency.
  • Deprecation Warnings: Deprecation warnings have been implemented for outdated tool call parser names in the server arguments handling, guiding users to adopt the new, simplified names.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the tool parser names for better consistency and adds support for new models like Qwen, DeepSeek, GLM, and Mistral. The changes include refactoring parser mappings, updating documentation, and adding deprecation warnings for backward compatibility. My review focuses on improving code clarity and fixing a minor issue in the documentation. Overall, the changes are well-structured and improve the usability of the tool parsing feature.

"| `qwen` | Qwen series (e.g. `Qwen/Qwen3-Next-80B-A3B-Instruct`, `Qwen/Qwen3-VL-30B-A3B-Thinking`) except Qwen3-Coder| |\n",
"| `qwen3_coder` | Qwen3-Coder (e.g. `Qwen/Qwen3-Coder-30B-A3B-Instruct`) | |\n",
"| `deepseekv3` | DeepSeek-v3 (e.g., `deepseek-ai/DeepSeek-V3-0324`) | Recommend adding `--chat-template ./examples/chat_template/tool_chat_template_deepseekv3.jinja` to launch command. |\n",
"| `deepseekv31` | DeepSeek-V3.1 and DeepSeek-V3.2 (e.g. `deepseek-ai/DeepSeek-V3.1`, `deepseek-ai/DeepSeek-V3.2-Exp`) | Recommend adding `--chat-template ./examples/chat_template/tool_chat_template_deepseekv31.jinja` (Or ..deepseekv32.jinja for DeepSeek-V3.2) to launch command. |\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The path ..deepseekv32.jinja in the note is a bit ambiguous and could be a typo. For clarity and to avoid user confusion, it's better to provide the full relative path from the project root, similar to the other examples. Also, "Or" is typically not capitalized in parentheses.

| `deepseekv31` | DeepSeek-V3.1 and DeepSeek-V3.2 (e.g. `deepseek-ai/DeepSeek-V3.1`, `deepseek-ai/DeepSeek-V3.2-Exp`) | Recommend adding `--chat-template ./examples/chat_template/tool_chat_template_deepseekv31.jinja` (or `./examples/chat_template/tool_chat_template_deepseekv32.jinja` for DeepSeek-V3.2) to launch command. |\n

Comment on lines +526 to +530
if self.tool_call_parser in deprecated_tool_call_parsers:
logger.warning(
f"The tool_call_parser '{self.tool_call_parser}' is deprecated. Please use '{deprecated_tool_call_parsers[self.tool_call_parser]}' instead."
)
self.tool_call_parser = deprecated_tool_call_parsers[self.tool_call_parser]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and avoid multiple dictionary lookups, you can store the new parser name in a variable.

Additionally, the deprecated_tool_call_parsers dictionary is created on each call. Since this is a constant mapping, consider defining it as a module-level constant (e.g., _DEPRECATED_TOOL_CALL_PARSERS) outside this method to avoid repeated creation and improve performance.

Suggested change
if self.tool_call_parser in deprecated_tool_call_parsers:
logger.warning(
f"The tool_call_parser '{self.tool_call_parser}' is deprecated. Please use '{deprecated_tool_call_parsers[self.tool_call_parser]}' instead."
)
self.tool_call_parser = deprecated_tool_call_parsers[self.tool_call_parser]
if self.tool_call_parser in deprecated_tool_call_parsers:
new_parser = deprecated_tool_call_parsers[self.tool_call_parser]
logger.warning(
f"The tool_call_parser '{self.tool_call_parser}' is deprecated. Please use '{new_parser}' instead."
)
self.tool_call_parser = new_parser

def _handle_deprecated_args(self):
pass
# handle deprecated tool call parsers
deprecated_tool_call_parsers = {"qwen25": "qwen", "glm45": "glm"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw qwen25 still exists in the above map.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here is just for the warning... Maybe remove in future

"metadata": {},
"source": [
"## Currently supported parsers:\n",
"> For reasoning models, you can always enable reasoning parser together with tool call parser.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we have a single command argument for both parsers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's ambiguous, just remove this line.

"| Parser | Supported Models | Notes |\n",
"|---|---|---|\n",
"| `llama3` | Llama 3.1 / 3.2 / 3.3 (e.g. `meta-llama/Llama-3.1-8B-Instruct`, `meta-llama/Llama-3.2-1B-Instruct`, `meta-llama/Llama-3.3-70B-Instruct`) | |\n",
"| `qwen` | Qwen series (e.g. `Qwen/Qwen3-Next-80B-A3B-Instruct`, `Qwen/Qwen3-VL-30B-A3B-Thinking`) except Qwen3-Coder| |\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use alphabetical orders here to make it easier to maintain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes updated

@JustinTong0323 JustinTong0323 merged commit e3c7f09 into sgl-project:main Oct 7, 2025
60 of 67 checks passed
ch-tiger1 pushed a commit to ch-tiger1/sglang that referenced this pull request Oct 9, 2025
mwcrutcher pushed a commit to crutcher-ai/sglang that referenced this pull request Oct 15, 2025
@JustinTong0323 JustinTong0323 deleted the xinyuan-update-tool-call-parser branch October 20, 2025 18:55
lpc0220 pushed a commit to lpc0220/sglang that referenced this pull request Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments