-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[Feature] Support DeepSeekV3 Function Call #17784
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
[Feature] Support DeepSeekV3 Function Call #17784
Conversation
Signed-off-by: 许文卿 <[email protected]>
Signed-off-by: 许文卿 <[email protected]>
Signed-off-by: 许文卿 <[email protected]>
|
👋 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 🚀 |
Signed-off-by: 许文卿 <[email protected]>
Signed-off-by: 许文卿 <[email protected]>
Signed-off-by: 许文卿 <[email protected]>
|
Could you lint and attach a test plan? |
Signed-off-by: 许文卿 <[email protected]>
Signed-off-by: 许文卿 <[email protected]>
aarnphm
left a comment
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.
qq. The parser looks good for merging for now, but do we need toe tool chat template?
iirc this is already included in the default chat templates from the model repo?
Signed-off-by: 许文卿 <[email protected]>
@aarnphm yeah, DeepSeek-V3-0324 default chat template not works for vllm, fixed some issues, e.g. I updated the code, need review again, thanks. |
@houseroad updated descriptions, including some test cases. |
| logger = init_logger(__name__) | ||
|
|
||
|
|
||
| @ToolParserManager.register_module("deepseekv3") |
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.
| @ToolParserManager.register_module("deepseekv3") | |
| @ToolParserManager.register_module("deepseek_v3") |
minor s/deepseekv3/deepseek_v3
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.
Done.
aarnphm
left a comment
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.
Tiny
Signed-off-by: Xu Wenqing <[email protected]>
@aarnphm done. |
|
@DarkLight1337 @simon-mo @houseroad @russellb need review with write access, thanks. |
Signed-off-by: Xu Wenqing <[email protected]>
Signed-off-by: 许文卿 <[email protected]> Signed-off-by: Xu Wenqing <[email protected]> Signed-off-by: Mu Huai <[email protected]>
Signed-off-by: 许文卿 <[email protected]> Signed-off-by: Xu Wenqing <[email protected]>
Signed-off-by: 许文卿 <[email protected]> Signed-off-by: Xu Wenqing <[email protected]> Signed-off-by: Yuqi Zhang <[email protected]>
|
@Xu-Wenqing Can this support deepseek_r1 tool calling? |
@WangErXiao Yes. DeepSeek just released DeepSeek-R1-0528 model, this model support function call. We can use "deepseek_v3" tool call parser, but the chat template "tool_chat_template_deepseekv3.jinja" here don't support DeepSeek-R1-0528. I created a PR: #18874, add DeepSeek-R1-0528 chat template. |
|
LGTM 👍 @Xu-Wenqing |
|
@Xu-Wenqing https://docs.vllm.ai/en/stable/features/tool_calling.html?h=function+call#deepseek-v3-models-deepseek_v3 Description in the official documentation. If the vllm version is greater than 0.8.3, it supports function call. Is there any difference between this update? |
Signed-off-by: 许文卿 <[email protected]> Signed-off-by: Xu Wenqing <[email protected]>
Signed-off-by: 许文卿 <[email protected]> Signed-off-by: Xu Wenqing <[email protected]>
Support DeepSeek-V3-0324 function call.
usage:
test script (no streaming):
Output:
None get_current_temperature {"location": "San Francisco, CA, USA", "unit": "celsius"} get_temperature_date {"location": "San Francisco, CA, USA", "date": "2024-10-01", "unit": "celsius"}test script (streaming):
Output: