Skip to content

[Bugfix] Mistral Devstral tool calling #18629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

vvidovic
Copy link

@vvidovic vvidovic commented May 23, 2025

Mistral's Codestral model mistralai/Devstral-Small-2505 fails when using with tools.
Similar to the existing patch for assistant message content (converting to string) we must convert tool message content to string + make sure the reasoning_content is not present.

FIX Tools usage with mistralai/Devstral-Small-2505 failsMistral

Mistral's Codestral model `mistralai/Devstral-Small-2505` fails
when using with tools.
Similar to the existing patch for `assistant` message content
(converting to string) we must convert `tool` message content
to string + make sure the `reasoning_content` is not present.
Copy link

👋 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.

🚀

Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

Could you please add a test for the new model behavior?

@vvidovic
Copy link
Author

Could you please add a test for the new model behavior?

I will just close the issue, it is to hard to run locally the one python test that I would like to update.
After spending many hours updating nvidia drivers, cuda toolkit and similar, I still wasn't able to run successfully pytest tests/mistral_tool_use/test_mistral_tool_calls.py in my local venv environment (Ubuntu 22.04). Maybe it is the result of the Python version (3.10.12).
I don't have more time for this "15 minutes fix".
Hopefully, someone who has already set up a dev environment will solve this issue and I will use the patched wheel of vllm 0.8.5 in the meantime.

@mgoin mgoin changed the title Mistral Codestral tools patch [Bugfix] Mistral Devstral tool calling May 26, 2025
@mgoin
Copy link
Member

mgoin commented May 26, 2025

Okay thanks for letting me know, I can take it on

@mgoin
Copy link
Member

mgoin commented May 26, 2025

Superseded by #18729

@mgoin mgoin closed this May 26, 2025
@vvidovic
Copy link
Author

Okay thanks for letting me know, I can take it on

Thanks a lot.

I did try again yesterday by reinstalling nvidia drivers and cuda toolkit and using uv venv instead of pip -m venv to create new environment. It worked on my laptop but my 4 GiB GPU memory was not enough to run the test.
I also tried to run test in the VM in the cloud with the L40S GPU but I was stuck again on the test message "Failed to infer device type".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Tools usage with mistralai/Devstral-Small-2505 fails
3 participants