Skip to content

Olmo 3 tool parser and tests#26143

Merged
chaunceyjiang merged 9 commits intovllm-project:mainfrom
pdasigi:olmo_3_tool_parser
Oct 15, 2025
Merged

Olmo 3 tool parser and tests#26143
chaunceyjiang merged 9 commits intovllm-project:mainfrom
pdasigi:olmo_3_tool_parser

Conversation

@pdasigi
Copy link
Copy Markdown
Contributor

@pdasigi pdasigi commented Oct 2, 2025

Purpose

This PR adds a tool parser for parsing the function calls made by the Olmo 3 model. Support for the model has already been merged (#24534). Olmo 3 outputs function calls in the following format

<function_calls>function1(arg1=value1)\nfunction2(arg2=value2)</function_calls>

This format is similar to the one that the existing Pythonic parser expects except for the presence of xml tags and function calls being delimited by newline characters instead of being represented as a list within brackets.

Test Plan

This PR also includes tests. Existing tests have not been modified or will be impacted.

Test Result

pytest tests/entrypoints/openai/tool_parsers/test_olmo3_tool_parser.py

Output:

========================================================================= test session starts ==========================================================================
platform darwin -- Python 3.11.13, pytest-8.4.2, pluggy-1.6.0
rootdir: /Users/pradeepd/workspace/vllm
configfile: pyproject.toml
plugins: anyio-4.10.0
collected 20 items                                                                                                                                                     

tests/entrypoints/openai/tool_parsers/test_olmo3_tool_parser.py ....................                                                                             [100%]

========================================================================== 20 passed in 1.67s ==========================================================================

Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Pradeep Dasigi <[email protected]>
Copy link
Copy Markdown
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 introduces a tool parser for the Olmo 3 model, along with a comprehensive set of tests. The implementation correctly handles the specific format of Olmo 3's function calls, including XML tags, newline delimiters, and non-Pythonic literals like null, true, and false. The tests are well-structured and cover a wide range of scenarios for both streaming and non-streaming modes. My main feedback is regarding significant code duplication between the new Olmo3PythonicToolParser and the existing PythonicToolParser. Refactoring this into a shared base class would greatly improve maintainability.

@chaunceyjiang chaunceyjiang self-assigned this Oct 8, 2025
@mergify
Copy link
Copy Markdown

mergify bot commented Oct 13, 2025

Documentation preview: https://vllm--26143.org.readthedocs.build/en/26143/

@mergify mergify bot added documentation Improvements or additions to documentation ci/build labels Oct 13, 2025
@pdasigi
Copy link
Copy Markdown
Contributor Author

pdasigi commented Oct 13, 2025

@chaunceyjiang I addressed the comments you made. Can you please take a look again. Thanks!

Copy link
Copy Markdown
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

Thanks~

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 15, 2025
@chaunceyjiang chaunceyjiang enabled auto-merge (squash) October 15, 2025 03:13
@chaunceyjiang chaunceyjiang merged commit 4794c2b into vllm-project:main Oct 15, 2025
48 checks passed
albertoperdomo2 pushed a commit to albertoperdomo2/vllm that referenced this pull request Oct 16, 2025
Signed-off-by: Pradeep Dasigi <[email protected]>
Signed-off-by: Alberto Perdomo <[email protected]>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: Pradeep Dasigi <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: Pradeep Dasigi <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed tool-calling

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants