-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Fix] correct tool_id for kimi-k2 when use tool_choice=required #21259
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
Conversation
👋 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 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 🚀 |
There was a problem hiding this 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 implements deterministic tool IDs for the kimi-k2
model. The changes look good, but there's a critical bug in the non-streaming generation path when multiple choices (n > 1
) are requested, which could lead to non-unique tool call IDs. There's also a potential TypeError
in the streaming path that should be addressed to improve code robustness.
Thank you for the fix, can you please address some of the comments? Thank you! |
yeah I'll fix them as soon as possible. Orz |
This pull request has merge conflicts that must be resolved before it can be |
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have to make this change to interface just for kimi. Let's just make a special case for kimi for now.
vllm/entrypoints/openai/protocol.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't work, given that the default would always be random, so not sure how this would work with kimi here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kimi-k2 will always set ToolCall.id
manually, so the random default value doesn't matter.
@simon-mo 3 hours ago, openai v1.100.0 removed ResponseTextConfig from openai.types.responses, see: https://github.com/openai/openai-python/blob/adb1af8073391a6d58be9c13cfa0664c04d859e2/src/openai/types/responses/response.py which cause readthedocs build failed |
Head branch was pushed to by a user without write access
…-project#21259) Co-authored-by: wangzhengtao <[email protected]> Signed-off-by: Duncan Moss <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]> Signed-off-by: Xiao Yu <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]>
…-project#21259) Co-authored-by: wangzhengtao <[email protected]>
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
This is to fix tool_id for kimi-k2 when use tool_choice=required. Now it will return tool id with format
functions.func_name:idx
instead of random string.Test Plan
Additional tests were added to
test_completion_with_function_calling
, and corresponding changes to themodel_type
hack were also required.Test Result
tests passed.
(Optional) Documentation Update