Skip to content

Bedrock provider: support adaptive thinking and output_config.effort for Claude 4.6 / 4.7 #3765

@elliolso-amazon

Description

@elliolso-amazon

Summary

The Bedrock provider's Claude reasoning configuration only emits the legacy {"type": "enabled", "budget_tokens": N} form. It does not support the adaptive thinking configuration used by Claude Sonnet 4.6 and Claude Opus 4.7, nor the associated output_config.effort field. As a result, GenerateConfig.reasoning_effort and GenerateConfig.effortare silently ignored when targeting Claude models through Bedrock.

Current Behavior

In src/inspect_ai/model/_providers/bedrock.py:521-528, BedrockAPI.reasoning_config() handles Claude as follows:

elif self.is_claude():
  if config.reasoning_tokens is not None:
    return {
      "reasoning_config": {
        "type": "enabled",
        "budget_tokens": config.reasoning_tokens,
      }
    }

This branch:

  • Only reacts to config.reasoning_tokens; config.reasoning_effort and config.effort are not read.
  • Emits only type: "enabled" with budget_tokens; type: "adaptive" is not supported.
  • Does not emit an output_config field.

The gpt-oss and Nova branches in the same method do consume reasoning_effort, so the omission is specific to Claude.

Expected Behavior

A request such as the following should be producible from the provider:

response = client.converse(
  modelId="us.anthropic.claude-opus-4-7",
  messages=[{"role": "user", "content": [{"text": "..."}]}],
  inferenceConfig={"maxTokens": 128000},
  additionalModelRequestFields={
    "thinking": {"type": "adaptive"},
    "output_config": {"effort": "high"},
  },
)

Concretely, the Bedrock provider should:

  1. Emit type: "adaptive" (with an output_config.effort) when config.reasoning_effort is set on a Claude model that supports adaptive thinking (4.6 and later).
  2. Emit output_config.effort from config.effort independently of thinking mode, with the same version-gated adjustments applied in the native provider (e.g. xhigh -> high pre-4.7 models).
  3. Continue to support the existing type: "enabled" + budget_tokens when only config.reasoning_tokens is set.

Reference Implementation

The native Anthropic provider already implements the desired semantics at src/inspect_ai/model/_providers/anthropic.py:783-805:

# effort
if config.effort is not None:
  ...
  params["output_config"] = OutputConfigParam(effort=effort)

# some thinking-only stuff
if self.is_using_thinking(config):
  reasoning_effort = self.effort_from_reasoning_effort(config)
  if reasoning_effort is not None:
    params["thinking"] = dict(type="adaptive", display="summarized")
    params["output_config"] = OutputConfigParam(effort=reasoning_effort)
  else:
    params["thinking"] = dict(
      type="enabled",
      budget_tokens=config.reasoning_tokens,
      display="summarized",
    )

The Bedrock provider can mirror this logic, placing the resulting fields into additionalModelRequestFields rather than the top-level Messages API parameter.

Environment

  • inspect_ai main branch (commit d09d608f8 at time of filing)
  • Affected file: src/inspect_ai/model/_providers/bedrock.py
  • Affected models: us.anthropic.claude-opus-4-7 and us.anthropic.claude-sonnet-4-6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions