Description
Checklist
- 1. I have searched related issues but cannot get the expected help.
- 2. The bug has not been fixed in the latest version.
- 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
- 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/sgl-project/sglang/discussions/new/choose Otherwise, it will be closed.
- 5. Please use English, otherwise it will be closed.
Describe the bug
After deploying deepseekv3-0324 using sglang 0.4.5-post3-cu124, when testing the function call, it was found that if the message contains system information, the function behaves abnormally.
Reproduction
After deploying deepseekv3-0324 using sglang 0.4.5-post3-cu124, when testing the function call, it was found that if the message contains system information, the function behaves abnormally.
Environment
for example
curl "http://XXX/v1/chat/completions"
-H "Content-Type: application/json"
-d '{
"messages": [
{
"role": "system",
"content": "Use the tools to answer the questions."
},
{
"role": "user",
"content": "What is the weather in Tokyo"
}
],
"temperature": 0.3,
"max_tokens": 1000,
"model": "mssgpt_v3",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "add",
"description": "Add two numbers",
"parameters": {
"properties": {
"a": {
"title": "A",
"type": "integer"
},
"b": {
"title": "B",
"type": "integer"
}
},
"required": [
"a",
"b"
],
"title": "addArguments",
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_secret_word",
"description": "",
"parameters": {
"properties": {},
"title": "get_secret_wordArguments",
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "",
"parameters": {
"properties": {
"city": {
"title": "City",
"type": "string"
}
},
"required": [
"city"
],
"title": "get_current_weatherArguments",
"type": "object"
}
}
}
]
}
'
the function call is wrong and "content" is not null, "tool_calls" is null
{
"id": "1d2854e227fe437191ee78b16e1bcfd8",
"object": "chat.completion",
"created": 1745811416,
"model": "mssgpt-v3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "I'll add the numbers 7 and 22 for you. One moment.???????????????????????????",
"reasoning_content": null,
"tool_calls": null
},
"logprobs": null,
"finish_reason": "stop",
"matched_stop": 1
}
],
"usage": {
"prompt_tokens": 278,
"total_tokens": 349,
"completion_tokens": 71,
"prompt_tokens_details": null
}
}
BUT....
curl "http://xxxx/v1/chat/completions"
-H "Content-Type: application/json"
-d '{
"messages": [
{
"role": "user",
"content": "What is the weather in Tokyo"
}
],
"temperature": 0.3,
"max_tokens": 1000,
"model": "mssgpt_v3",
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "add",
"description": "Add two numbers",
"parameters": {
"properties": {
"a": {
"title": "A",
"type": "integer"
},
"b": {
"title": "B",
"type": "integer"
}
},
"required": [
"a",
"b"
],
"title": "addArguments",
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_secret_word",
"description": "",
"parameters": {
"properties": {},
"title": "get_secret_wordArguments",
"type": "object"
}
}
},
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "",
"parameters": {
"properties": {
"city": {
"title": "City",
"type": "string"
}
},
"required": [
"city"
],
"title": "get_current_weatherArguments",
"type": "object"
}
}
}
]
}
'
function call correct tool_calls reuslt successs
{
"id": "f387b0fe9e5a40e8b40a585d69dcfeb1",
"object": "chat.completion",
"created": 1745811225,
"model": "mssgpt_v3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"reasoning_content": null,
"tool_calls": [
{
"id": "2",
"type": "function",
"function": {
"name": "get_current_weather",
"arguments": "{"city": "Tokyo"}"
}
}
]
},
"logprobs": null,
"finish_reason": "tool_calls",
"matched_stop": null
}
],
"usage": {
"prompt_tokens": 261,
"total_tokens": 282,
"completion_tokens": 21,
"prompt_tokens_details": null
}
}