Skip to content

Incorrect thinking response in self-hosted deepseek-r1-distill-qwen-32bΒ #1327

@MateuszKepczynski

Description

@MateuszKepczynski

What Happened?

When making a request to self-hosted model deepseek-r1-distill-qwen-32b to /v1/chat/completions, model thinking is incorrect formatted or provided.

curl:

curl --request POST \
  --url http://localhost:8787/v1/chat/completions \
  --header 'authorization: ****' \
  --header 'content-type: application/json' \
  --header 'x-portkey-custom-host: http://localhost:8080/openai/v1' \
  --header 'x-portkey-provider: openai' \
  --data '{
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "hi"
    }
  ],
  "model": "deepseek-r1-distill-qwen-32b"
}'

Response:

{
  "id": "*****",
  "object": "chat.completion",
  "created": 1757070852,
  "model": "deepseek-r1-distill-qwen-32b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": null,
        "content": "Okay, so the user greeted me with \"hi\". I need to respond in a friendly and welcoming manner.\n</think>\n\nHello! πŸ‘‹ How can I assist you today?",
        "tool_calls": []
      },
      "logprobs": null,
      "finish_reason": "stop",
      "stop_reason": null
    }
  ],
  "usage": {
    "prompt_tokens": 81,
    "total_tokens": 252,
    "completion_tokens": 171,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null
}

As you can see, the response "content" only contains a closure tag - </think>.

What Should Have Happened?

Opening of the HTML <think> tag should be included in content or thinking should be found in reasoning_content object.

Relevant Code Snippet

No response

Your Twitter/LinkedIn

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions