Skip to content

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

Closed
adickinson72 wants to merge 1 commit intocnoe-io:mainfrom
adickinson72:aws-bedrock-extended-thinking-support
Closed

feat: add extended thinking support for AWS Bedrock, Anthropic, and Vertex AI Claude 4+ models#19
adickinson72 wants to merge 1 commit intocnoe-io:mainfrom
adickinson72:aws-bedrock-extended-thinking-support

Conversation

@adickinson72
Copy link
Copy Markdown
Collaborator

@adickinson72 adickinson72 commented Oct 6, 2025

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

✅ 45 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 (see conversation thread), 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.

🤖 Generated with Claude Code

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

@adickinson72 adickinson72 force-pushed the aws-bedrock-extended-thinking-support branch 3 times, most recently from cf2b1e5 to 505bf13 Compare October 6, 2025 21:13
@adickinson72 adickinson72 changed the title Add extended thinking support for AWS Bedrock and Anthropic Claude 4+ models feat: add extended thinking support for AWS Bedrock and Anthropic Claude 4+ models Oct 6, 2025
@adickinson72 adickinson72 force-pushed the aws-bedrock-extended-thinking-support branch from 505bf13 to 40d09f0 Compare October 6, 2025 21:53
@adickinson72 adickinson72 changed the title feat: add extended thinking support for AWS Bedrock and Anthropic Claude 4+ models feat: add extended thinking support for AWS Bedrock, Anthropic, and Vertex AI Claude 4+ models Oct 7, 2025
@adickinson72 adickinson72 force-pushed the aws-bedrock-extended-thinking-support branch from 769c6e2 to 662533b Compare October 7, 2025 16:59
…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>
@adickinson72 adickinson72 force-pushed the aws-bedrock-extended-thinking-support branch from 662533b to 21f8b14 Compare October 7, 2025 17:02
@adickinson72
Copy link
Copy Markdown
Collaborator Author

Closing this PR from fork. Reopening from main repo branch for proper CI permissions as I'm now a maintainer.

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.

1 participant