Support DeepSeek-V3.1 tool call#9446
Conversation
Signed-off-by: 许文卿 <xwq391974@alibaba-inc.com>
Signed-off-by: 许文卿 <xwq391974@alibaba-inc.com>
|
does it work? |
not work, here's an example: request response |
|
@jinmingyi1998 @freedomkk-qfeng I will write a new tool parser to support DeepSeek-V3.1 CC @CatherineSue @zhyncs @JustinTong0323 |
Signed-off-by: 许文卿 <xwq391974@alibaba-inc.com>
|
@CatherineSue @JustinTong0323 @zhyncs This PR is ready to review. Added tests results in PR descriptions. |
When thinking mode is disabled, the new parser works! |
@freedomkk-qfeng |
|
--reasoning-parser deepseek-r1 curl http://127.0.0.1:30000/v1/chat/completions "tool_calls" still is null |
Maybe use --reasoning-parser deepseek-v3? |
|
多轮对话调用工具时报错: |
I also encountered the same problem. |
|
ExecStart=/apps/miniforge3/envs/sglangpro/bin/python3.13 -m sglang.launch_server run deepseek v3.1 with this command . function call not work with openai sdk. in non-thinking @Xu-Wenqing and tool_chat_template_deepseekv31.jinja this with jinja2 error this is the wireshark packet T 172.16.8.50:40000 -> 172.16.8.199:50494 [AP] #6 |
|
Is the multi-round dialogue tool call available now? |
|
For those who encountered multi-turn FC issue, try this PR: |
Signed-off-by: 许文卿 <xwq391974@alibaba-inc.com> Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>

Motivation
Support tool call for DeepSeek-V3.1
The tool call format of DeepSeek-V3.1 is different from DeepSeek-V3/R1:
DeepSeek-V3.1: <|tool▁calls▁begin|><|tool▁call▁begin|>tool_call_name<|tool▁sep|>tool_call_arguments<|tool▁call▁end|><|tool▁calls▁end|>
DeepSeek-R1/V3: <|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>FUNCTION_NAME\n'
json\n{"param1": "value1", "param2": "value2"}\n<|tool▁call▁end|><|tool▁calls▁end|>So we can't use --tool-call-parser deepseekv3 for this DeepSeek-V3.1, we need a new tool call parser "deepseekv31"
Modifications
Accuracy Tests
Test Script (Streaming):
Test Result (Streaming):
Test Script (Non-Streaming):
Test Result (Non-Streaming):
Benchmarking and Profiling
Checklist