Skip to content

[Frontend] [Bugfix] Refactor tool parsers and simplify the tool parsing interface.#16096

Closed
paolovic wants to merge 10 commits intovllm-project:mainfrom
paolovic:feature/tool_parser
Closed

[Frontend] [Bugfix] Refactor tool parsers and simplify the tool parsing interface.#16096
paolovic wants to merge 10 commits intovllm-project:mainfrom
paolovic:feature/tool_parser

Conversation

@paolovic
Copy link
Contributor

@paolovic paolovic commented Apr 5, 2025

Co-authored-by: elementary-particle

Completed the following, stale PR:

"This is the PR for the RFC #11522. Currently we are building a draft of simpler tool parsers using streaming JSON parsing libraries to reduce overhead and avoid bugs. Tests and commits will be added gradually.

FIX #11392 ."

Co-authored-by: elementary-particle
Signed-off-by: paolovic <paul-philipp.luley@uzh.ch>
@github-actions
Copy link

github-actions bot commented Apr 5, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

Co-authored-by: elementary-particle
Signed-off-by: paolovic <paul-philipp.luley@uzh.ch>
@paolovic
Copy link
Contributor Author

paolovic commented Apr 5, 2025

Hi @marcelodiaz558, hi @Endebert,
can you verify if this fits your needs?

Thank you and best regards,
Paul

@PedroF43
Copy link

PedroF43 commented Apr 7, 2025

Just chiming in, there is also a problem with the llama 3 tool parser where it cant generate non ascii characters

@Endebert
Copy link

Endebert commented Apr 7, 2025

@paolovic Thanks for doing this. I can confirm my issues with streamed function calling are resolved with this PR.

@paolovic
Copy link
Contributor Author

paolovic commented Apr 7, 2025

Hi @PedroF43 ,
if this is related to this PR, could you provide an example, please?

Thank you and best regards,
Paul

@PedroFariadtx
Copy link

Hi @PedroF43 , if this is related to this PR, could you provide an example, please?

Thank you and best regards, Paul

this PR of mine has better examples #13826

@paolovic
Copy link
Contributor Author

paolovic commented Apr 7, 2025

Hi @PedroF43 , if this is related to this PR, could you provide an example, please?
Thank you and best regards, Paul

this PR of mine has better examples #13826

But this PR is about hermes tool parser, yours is about llama tool parser, isn't it?

@PedroFariadtx
Copy link

Hi @PedroF43 , if this is related to this PR, could you provide an example, please?
Thank you and best regards, Paul

this PR of mine has better examples #13826

But this PR is about hermes tool parser, yours is about llama tool parser, isn't it?

yes you are correct, i thought that by your title you intended to go trough all the available tool parsers

@DarkLight1337 DarkLight1337 requested a review from mgoin April 10, 2025 14:34
@DarkLight1337
Copy link
Member

cc @K-Mistele

@mergify
Copy link

mergify bot commented Apr 10, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @paolovic.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Apr 10, 2025
Co-authored-by: elementary-particle
Signed-off-by: paolovic <paul-philipp.luley@uzh.ch>
@mergify mergify bot removed the needs-rebase label Apr 10, 2025
@paolovic
Copy link
Contributor Author

Hi @K-Mistele could you have a look, please?

paolovic added 2 commits April 23, 2025 13:44
Co-authored-by: elementary-particle
Signed-off-by: paolovic <paul-philipp.luley@uzh.ch>
@paolovic
Copy link
Contributor Author

Hi @Endebert ,
I got a notification from you about a potential bug containing two JSONs as arguments.
Did you delete this comment because it is resolved?

@Endebert
Copy link

Hi @Endebert ,
I got a notification from you about a potential bug containing two JSONs as arguments.
Did you delete this comment because it is resolved?

@paolovic Yes, sorry about that. Turned out it was a bug in our code, which appended arguments objects if multiple functions were called during the same streaming response.

@paolovic
Copy link
Contributor Author

Hi @Endebert ,
I got a notification from you about a potential bug containing two JSONs as arguments.
Did you delete this comment because it is resolved?

@paolovic Yes, sorry about that. Turned out it was a bug in our code, which appended arguments objects if multiple functions were called during the same streaming response.

Easy, no problem, thanks for letting me know!
Best regards

@mergify
Copy link

mergify bot commented May 4, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @paolovic.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label May 4, 2025
Co-authored-by: elementary-particle
Signed-off-by: paolovic <paul-philipp.luley@uzh.ch>
@mergify mergify bot removed the needs-rebase label May 5, 2025
@DarkLight1337
Copy link
Member

@aarnphm can you help review this?

Copy link
Collaborator

@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

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

Hi there, thanks for your contribution.

I want to propose that we pause refactoring effort on tool calling atm, given that xgrammar has recently shared with us their plans to add function calling to structural tags (will share more on this).

I'm writing a RFC for tool calling, but the basic idea is that if we can reliably enforce structural tags, the parsing logic can be simplified. This would in hands address partial JSON issue without having to introduce another library to parse this.

@Endebert
Copy link

Endebert commented May 7, 2025

@aarnphm Do you have an ETA regarding your alternative route? Because we need these changes for production use. It's fine I guess to stay on this fork and rebase + manually build it occasionally, but it's still an inconvenience.

@aarnphm
Copy link
Collaborator

aarnphm commented May 8, 2025

Do you have an ETA regarding your alternative route? Because we need these changes for production use. It's fine I guess to stay on this fork and rebase + manually build it occasionally, but it's still an inconvenience.

I would want to have this ready before 0.10.0, which will be in around 4-6 weeks.

fwiw we might want to just merge all of the implementations/fix right now to make sure that it will still work for 0.9.x, but for 0.10.x, i would be more lenient for a RFC for redesigning the parser.

@mergify
Copy link

mergify bot commented May 8, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @paolovic.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@github-actions
Copy link

github-actions bot commented Aug 9, 2025

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions bot added the stale Over 90 days of inactivity label Aug 9, 2025
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

This pull request has been automatically closed due to inactivity. Please feel free to reopen if you intend to continue working on it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: [v0.6.5] Streaming tool call responses with the hermes template is inconsistent with the non-stream version.

6 participants