Skip to content

Conversation

@MuriloFP
Copy link
Contributor

@MuriloFP MuriloFP commented Jun 27, 2025

Related GitHub Issue

Closes: #2500

Description

Fix: Update AWS Bedrock Claude model max output tokens to match official specs

Changes:

Models Updated:

  • Claude Sonnet 4 (anthropic.claude-sonnet-4-20250514-v1:0): 8,19264,000 tokens
  • Claude Opus 4 (anthropic.claude-opus-4-20250514-v1:0): 8,19232,000 tokens
  • Claude 3.7 Sonnet (anthropic.claude-3-7-sonnet-20250219-v1:0): 8,19264,000 tokens

Impact:

  • Users now see correct max output token limits in settings UI
  • Enables generation of significantly longer responses (up to 7.8x increase)
  • Resolves discrepancy between displayed limits and AWS Bedrock documentation

References:

  • AWS Bedrock Claude 3.7 documentation: 64k tokens (128k with beta header)
  • Anthropic official model comparison table

Test Procedure

  • Open Settings, select Amazon Bedrock as a provider
  • Select any of the affected models
  • Look at the Max Tokens value

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

I've looked over Bedrock official documentation, and it links back to Anthropic's. I don't believe there are different values for models used through Bedrock. There is no explicit list of the mentioned models with their Max Output values in Bedrock's documentation, only on Anthropic's.

Get in Touch

@MuriloFP


Important

Update maxTokens for three models in bedrock.ts to align with official documentation, correcting UI limits and resolving documentation discrepancies.

  • Behavior:
    • Updated maxTokens in bedrock.ts for models anthropic.claude-sonnet-4-20250514-v1:0, anthropic.claude-opus-4-20250514-v1:0, and anthropic.claude-3-7-sonnet-20250219-v1:0.
    • New maxTokens values: 64,000, 32,000, and 64,000 respectively.
  • Impact:
    • Corrects max output token limits in settings UI.
    • Allows generation of longer responses, up to 7.8x increase.
    • Fixes discrepancy with AWS Bedrock documentation.

This description was created by Ellipsis for 6d29f44. You can customize this summary. It will automatically update as commits are pushed.

MuriloFP and others added 2 commits June 26, 2025 21:22
…ficial specs

**Fixes:** [RooCodeInc#2500](RooCodeInc#2500)

### Changes:
- Updated `maxTokens` values in `packages/types/src/providers/bedrock.ts` to align with [official Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models/overview#model-comparison)

### Models Updated:
- **Claude Sonnet 4** (`anthropic.claude-sonnet-4-20250514-v1:0`): `8,192` → `64,000` tokens
- **Claude Opus 4** (`anthropic.claude-opus-4-20250514-v1:0`): `8,192` → `32,000` tokens
- **Claude 3.7 Sonnet** (`anthropic.claude-3-7-sonnet-20250219-v1:0`): `8,192` → `64,000` tokens

### Impact:
- Users now see correct max output token limits in settings UI
- Enables generation of significantly longer responses (up to 7.8x increase)
- Resolves discrepancy between displayed limits and AWS Bedrock documentation

### References:
- AWS Bedrock Claude 3.7 documentation: 64k tokens (128k with beta header)
- Anthropic official model comparison table
@mrubens
Copy link
Collaborator

mrubens commented Jun 27, 2025

What does the output tokens default to after this change? Do these have sliders?

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 27, 2025
@MuriloFP
Copy link
Contributor Author

What does the output tokens default to after this change? Do these have sliders?

For most users: They'll now get the full model capability by default (64k tokens for Claude 3.7 Sonnet, 32k for Opus 4) with no sliders needed - its just set at the correct limit.
For reasoning-enabled models: Defaults to 16,384 tokens but sliders are available in the "Thinking Budget" section to adjust up to the model's full capability.
Bottom line: Regular users get an improvement (8k → 64k tokens) automatically, while users with reasoning enabled still have full control via sliders.

No other defaults were changed, just the model information that was incorrect.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 27, 2025
@dosubot dosubot bot added the bug Something isn't working label Jun 27, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 27, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 27, 2025
- Updated maxTokens values to use numeric separators (e.g., 64_000)
- Improves readability and consistency with other large numbers like contextWindow
- Applied to all three updated models:
  - anthropic.claude-sonnet-4-20250514-v1:0
  - anthropic.claude-opus-4-20250514-v1:0
  - anthropic.claude-3-7-sonnet-20250219-v1:0
@daniel-lxs
Copy link
Member

With this change the defaults look like this for me:
image
image
image

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jun 27, 2025
@mrubens
Copy link
Collaborator

mrubens commented Jun 27, 2025

What does the output tokens default to after this change? Do these have sliders?

For most users: They'll now get the full model capability by default (64k tokens for Claude 3.7 Sonnet, 32k for Opus 4) with no sliders needed - its just set at the correct limit. For reasoning-enabled models: Defaults to 16,384 tokens but sliders are available in the "Thinking Budget" section to adjust up to the model's full capability. Bottom line: Regular users get an improvement (8k → 64k tokens) automatically, while users with reasoning enabled still have full control via sliders.

No other defaults were changed, just the model information that was incorrect.

My concern is that I don't actually think that 64k output tokens is clearly an improvement. That 64k is always reserved in the context window, reducing the amount that's usable for input. I think it makes sense that the user can opt into it, but I think the default shouldn't be higher than 16k for modes with a 200k context window.

@hannesrudolph
Copy link
Collaborator

Closing as we need to setup a max token slider across providers where models have the ability to have variable tokens set.

@github-project-automation github-project-automation bot moved this from PR [Changes Requested] to Done in Roo Code Roadmap Jul 16, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PR - Changes Requested size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Max Output Wrong for AWS Bedrock Claude (?)

4 participants