Skip to content

feat: add extended thinking support for AWS Bedrock, Anthropic, and Vertex AI Claude 4+ models#20

Merged
sriaradhyula merged 1 commit intomainfrom
aws-bedrock-extended-thinking-support
Oct 7, 2025
Merged

feat: add extended thinking support for AWS Bedrock, Anthropic, and Vertex AI Claude 4+ models#20
sriaradhyula merged 1 commit intomainfrom
aws-bedrock-extended-thinking-support

Conversation

@adickinson72
Copy link
Copy Markdown
Collaborator

Summary

Adds extended thinking support for Claude 4+ models across AWS Bedrock, Anthropic, and Vertex AI providers.

Features

  • AWS Bedrock: AWS_BEDROCK_THINKING_ENABLED, AWS_BEDROCK_THINKING_BUDGET
  • Anthropic: ANTHROPIC_THINKING_ENABLED, ANTHROPIC_THINKING_BUDGET
  • Vertex AI: VERTEXAI_THINKING_ENABLED, VERTEXAI_THINKING_BUDGET
  • Default budget: 1024 tokens (minimum), automatically clamped to max_tokens if provided
  • Handles parameter incompatibilities (temperature, top_p, top_k)

Bug Fixes

  • Fixed critical model_kwargs clobbering bug where response_format would overwrite thinking config
  • Now properly merges model_kwargs instead of replacing, preserving all configurations

Tests

✅ 147 comprehensive tests passing, covering:

  • Budget parsing and validation
  • Provider-specific configuration
  • Parameter compatibility
  • model_kwargs preservation (bug fix verification)

Documentation

  • ✅ Updated README with configuration examples for all three providers
  • ✅ Updated CHANGELOG with detailed changes
  • ✅ Documented parameter incompatibilities

Architectural Decision

After extensive analysis, we decided to:

  • ✅ Keep standard extended thinking in LLMFactory (configuration layer)
  • 🔮 Handle interleaved thinking at agent layer when needed (orchestration layer)

This maintains clean separation of concerns: factory handles model configuration, agents handle runtime orchestration.

Why New PR?

Previous PR #19 was from my fork and had CI permission issues. Now that I'm a maintainer, creating PR from main repo branch for proper permissions.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…ertex AI Claude 4+ models

Add environment variables for configuring extended thinking:
- AWS_BEDROCK_THINKING_ENABLED, AWS_BEDROCK_THINKING_BUDGET
- ANTHROPIC_THINKING_ENABLED, ANTHROPIC_THINKING_BUDGET
- VERTEXAI_THINKING_ENABLED, VERTEXAI_THINKING_BUDGET

Default budget: 1024 tokens (minimum), automatically clamped to max_tokens if provided.
Handles parameter incompatibilities (temperature, top_p, top_k).
Includes 45 comprehensive tests covering all aspects.

Fixes model_kwargs clobbering bug where response_format would overwrite thinking config.
Now properly merges instead of replacing, preserving all configurations.

Signed-off-by: Adam Dickinson <adickinson72@gmail.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 Google Gemini Test Results

Google Gemini Examples: PASS


🔗 View full workflow run

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 GCP Vertex AI Test Results

GCP Vertex AI Examples: PASS


🔗 View full workflow run

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 AWS Bedrock Test Results

AWS Bedrock Examples: PASS


🔗 View full workflow run

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 Azure OpenAI Test Results

Azure OpenAI Examples: PASS


🔗 View full workflow run

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

Code Coverage

Package Line Rate Complexity Health
. 79% 0
tracing 51% 0
Summary 71% (493 / 698) 0

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 OpenAI Test Results

OpenAI Examples: FAIL


🔗 View full workflow run

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

🧪 OpenAI Test Results

OpenAI Examples: FAIL


🔗 View full workflow run

@sriaradhyula
Copy link
Copy Markdown
Member

OpenAI deprecated some models. We need to remove gpt-4o, gpt-4.1 from our testcases

@sriaradhyula sriaradhyula merged commit 69be40f into main Oct 7, 2025
12 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants