Skip to content

Reasoning Effort parameter does not work with DeepSeek V3.1 #181

@sebastian-ytree

Description

@sebastian-ytree

Describe the bug
The reasoning_effort parameter is broken for DeepSeek V3.1.

Please complete the following information:

  • Which API you used:
    • /chat/completions
  • Which model you used:
    • deepseek.v3-v1:0

To Reproduce
Send a request to Bedrock Access Gateway:

POST /api/v1/chat/completions

{"messages":[{"name":null,"role":"user","content":"Tell me a random fun fact about the Roman Empire"}],"model":"qwen.qwen3-coder-480b-a35b-v1:0","frequency_penalty":0.0,"presence_penalty":0.0,"stream":true,"stream_options":{"include_usage":true},"temperature":1.0,"top_p":1.0,"user":null,"max_tokens":2048,"max_completion_tokens":null,"reasoning_effort":"medium","n":1,"tools":null,"tool_choice":"auto","stop":null,"extra_body":null}

Expected behavior
Bedrock's DeepSeek V3.1 should respond with reasoning content.

Logs

INFO:     127.0.0.6:47269 - "POST /api/v1/chat/completions HTTP/1.1" 200 OK

2025-10-01 14:38:00,956 [INFO] Raw request: {"messages":[{"name":null,"role":"user","content":"Tell me a random fun fact about the Roman Empire"}],"model":"deepseek.v3-v1:0","frequency_penalty":0.0,"presence_penalty":0.0,"stream":true,"stream_options":{"include_usage":true},"temperature":1.0,"top_p":1.0,"user":null,"max_tokens":2048,"max_completion_tokens":null,"reasoning_effort":"medium","n":1,"tools":null,"tool_choice":"auto","stop":null,"extra_body":null}

2025-10-01 14:38:00,956 [INFO] Bedrock request: "{'modelId': 'deepseek.v3-v1:0', 'messages': [{'role': 'user', 'content': [{'text': 'Tell me a random fun fact about the Roman Empire'}]}], 'system': [], 'inferenceConfig': {'temperature': 1.0, 'maxTokens': 2048}, 'additionalModelRequestFields': {'reasoning_config': {'type': 'enabled', 'budget_tokens': 1228}}}"

2025-10-01 14:38:01,017 [ERROR] Bedrock validation error for model deepseek.v3-v1:0: An error occurred (ValidationException) when calling the ConverseStream operation: The model returned the following errors: Failed to deserialize the JSON body into the target type: Invalid 'reasoning_effort': unknown variant `type`, expected one of `minimal`, `low`, `medium`, `high` at line 1 column 230

Additional context
DeepSeek V3.1 in the Bedrock UI's chat playground supports reasoning which can be toggled on or off, but the BAG API doesn't provide a way to configure it.

If I understand the logs correctly, it seems like the original request received by BAG includes:

"reasoning_effort":"medium"

Which is then translated into an outgoing request to Bedrock like so:

'additionalModelRequestFields': {'reasoning_config': {'type': 'enabled', 'budget_tokens': 1228}}}

But the error suggests the actual outgoing request should be more like:

'additionalModelRequestFields': {'reasoning_config': {'type': 'medium'}}}

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