Skip to content

渠道接入 Sglang 部署的deepseek v3.1 模型无法启用思考模式 #2400

@verigle

Description

@verigle

Routine Checks

  • [ x] I have confirmed there are no similar issues currently
  • [x ] I have confirmed I have upgraded to the latest version
  • [x ] I have thoroughly read the project README, especially the FAQ section
  • [ x] I understand and am willing to follow up on this issue, assist with testing and provide feedback
  • [ x] I understand and acknowledge the above, and understand that project maintainers have limited time and energy, issues that do not follow the rules may be ignored or closed directly

Issue Description
渠道接入 Sglang 部署的deepseek v3.1 模型无法启用思考模式, 直接调用sglang 是可以开启思考模式的
Steps to Reproduce
渠道接入deeseek v3.1 思考模型, 启用参数覆盖:

{
  "operations": [
    {
      "path": "chat_template_kwargs.thinking",
      "mode": "set",
      "value": true,
      "keep_origin": true
    },
    {
      "path":"separate_reasoning",
      "model": "set",
      "value": true,
      "keep_origin": true
    }
  ]
}

Expected Result

curl http://127.0.0.1:40000/v1/chat/completions   -H "Content-Type: application/json"   -d '{
    "model": "DeepSeek-V3.1-Terminus",
    "messages": [
      {"role": "user", "content": "你好"},
      {"role": "assistant", "content": "你好,请问有什么可以帮助您的吗?"},
      {"role": "user", "content": "介绍一下你自己"}
    ],
    "stream": false,
    "chat_template_kwargs": {"thinking": true},
    "separate_reasoning": true
  }'
{"id":"7248079f80c54bf69d6ac90ed634d403","object":"chat.completion","created":1765249796,"model":"DeepSeek-V3.1-Terminus","choices":[{"index":0,"message":{"role":"assistant","content":"你好!很高兴认识你!😊\n\n我是DeepSeek,由深度求索公司创造的AI助手。让我简单介绍一下自己:\n\n**基本信息:**\n- 我是一个纯文本AI模型,专注于理解和生成自然语言\n- 知识截止到2024年7月,是DeepSeek的最新版本\n\n**我的能力:**\n- 💬 文本对话和问答\n- 📄 处理多种文件格式(图像、txt、pdf、ppt、word、excel等)\n- 🔍 支持联网搜索(需要手动开启)\n- 📝 写作、翻译、编程、分析等各种文本任务\n\n**使用特点:**\n- 完全免费使用,没有收费计划\n- 支持128K上下文长度\n- 可通过官方应用商店下载App使用\n\n我会用热情细腻的方式为你提供帮助,无论是学习、工作还是日常问题,都可以随时找我聊天!有什么特别想了解或需要帮助的吗?","reasoning_content":"哦,用户让我介绍一下自己,这是个很基础的请求。需要简洁清晰地说明身份、能力和特点,避免过度展开。\n\n可以用公司背景和核心功能作为开头,让用户快速了解我的定位。然后分块列举关键能力,比如文本处理、文件支持和联网搜索,这样结构比较清晰。最后提一下使用方式和风格特点,保持友好收尾。\n\n不需要过多技术细节,重点突出实用性和免费特性,让用户觉得容易接触。用表情符号增加亲和力,但思考中不需要考虑格式。","tool_calls":null},"logprobs":null,"finish_reason":"stop","matched_stop":1}],"usage":{"prompt_tokens":25,"total_tokens":327,"completion_tokens":302,"prompt_tokens_details":null,"reasoning_tokens":0},"metadata":{"weight_version":"default"}}

Related Screenshots
If none, please delete this section.
经过newapi 实际返回的结果没有思考过程,还存在答非所问的问题

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions