Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 5, 2025

This PR attempts to address Issue #9874 by adding support for AWS Bedrock service tiers (STANDARD, FLEX, PRIORITY).

Summary

Implements service tier selection for AWS Bedrock models, allowing users to optimize for cost (FLEX tier with ~20% discount) or performance (PRIORITY tier with ~20% premium pricing and better latency).

Changes

  • ✅ Added awsBedrockServiceTier field to provider settings schema
  • ✅ Added tier-specific pricing information to Bedrock models (Claude models)
  • ✅ Updated Bedrock provider to include service_tier parameter in API requests
  • ✅ Added UI dropdown for service tier selection in Bedrock settings
  • ✅ Applied tier-specific pricing in cost calculations

Testing

  • All existing Bedrock tests pass
  • Linting passes
  • Type checking passes

Screenshots

The service tier selector appears in the Bedrock settings when a model that supports tiers is selected.

Feedback and guidance are welcome!

Closes #9874

- Add awsBedrockServiceTier field to provider settings schema
- Add tier-specific pricing for Claude models (FLEX ~20% discount, PRIORITY ~20% premium)
- Update Bedrock provider to include service_tier in API requests
- Add service tier selector UI in Bedrock settings
- Apply tier-specific pricing in cost calculations

Implements #9874
@roomote
Copy link
Contributor Author

roomote bot commented Dec 5, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 inline comment and 1 additional issue to address:

Issues to Resolve

  • Service tier API parameter handling: When "default" tier is selected, the service_tier parameter should be omitted from API requests rather than sending "STANDARD". See inline comment.
  • Missing service tier in completePrompt: The completePrompt method doesn't include the service_tier parameter in API requests, creating a cost tracking inconsistency where pricing calculations use one tier but API calls use another. The service tier logic should be added to this method similar to how it's implemented in createMessage.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment on lines +437 to +457
// Add service tier if specified and model supports it
if (this.options.awsBedrockServiceTier && modelConfig.info.tiers && modelConfig.info.tiers.length > 0) {
if (!additionalModelRequestFields) {
additionalModelRequestFields = {} as BedrockAdditionalModelFields
}
// Convert from lowercase to uppercase for API
const tierMap: Record<string, "STANDARD" | "FLEX" | "PRIORITY"> = {
default: "STANDARD",
flex: "FLEX",
priority: "PRIORITY",
}
const mappedTier = tierMap[this.options.awsBedrockServiceTier as string]
if (mappedTier) {
additionalModelRequestFields.service_tier = mappedTier
logger.info("Service tier specified for Bedrock request", {
ctx: "bedrock",
modelId: modelConfig.id,
serviceTier: mappedTier,
})
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "default" tier should not send service_tier parameter to AWS. When the user selects "default", the service_tier field should be omitted from the API request entirely, allowing AWS Bedrock to use its implicit default behavior. Currently, the code maps "default" to "STANDARD" and includes it in the request, which is inconsistent with AWS best practices and the pricing logic (which correctly skips tier adjustments when tier is "default"). The condition at line 438 should check tier !== "default" before setting the parameter, or the tierMap should not include a "default" entry.

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] - Add support for bedrock service tiers

3 participants