Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 9, 2025

This PR attempts to address Issue #9874 by implementing AWS Bedrock service tier support.

Summary

Adds support for AWS Bedrock service tiers (STANDARD, FLEX, PRIORITY) allowing users to optimize their AI workloads based on cost and latency requirements.

Changes

  • ✅ Added service tier type definitions and constants
  • ✅ Added awsBedrockServiceTier field to provider settings schema
  • ✅ Updated Bedrock provider to include service_tier parameter in API requests
  • ✅ Implemented tier-specific pricing (75% premium for Priority, 50% discount for Flex)
  • ✅ Added UI selector for service tier in Bedrock settings component
  • ✅ Added translation strings for the new UI elements
  • ✅ Updated supported models list based on AWS documentation

Supported Models

Based on the AWS documentation provided, the following models support service tiers:

  • Amazon Nova models (Lite, Pro, Pro Latency Optimized)
  • DeepSeek R1
  • Qwen models (qwen3-next-80b-a3b, qwen3-coder-480b-a35b)
  • OpenAI GPT-OSS models (20b, 120b)

Testing

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

Notes

The pricing multipliers have been updated based on the feedback:

  • FLEX: 50% discount from standard (0.5x multiplier)
  • PRIORITY: 75% premium over standard (1.75x multiplier)

Feedback and guidance are welcome!

Closes #9874


Important

Adds AWS Bedrock service tier support with UI updates, pricing adjustments, and tests for tier-specific functionality.

  • Behavior:
    • Adds awsBedrockServiceTier field to provider settings schema in provider-settings.ts.
    • Updates AwsBedrockHandler in bedrock.ts to include service_tier in API requests for supported models.
    • Implements tier-specific pricing in bedrock.ts with 75% premium for Priority and 50% discount for Flex.
  • UI:
    • Adds UI selector for service tier in Bedrock.tsx.
    • Adds translation strings for service tiers in multiple language files.
  • Testing:
    • Adds tests in bedrock.spec.ts for pricing multipliers and API request parameters.
  • Misc:
    • Defines service tier types and constants in bedrock.ts and provider-settings.ts.
    • Updates supported models list in bedrock.ts based on AWS documentation.

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

- Add service tier type definitions (STANDARD, FLEX, PRIORITY)
- Add awsBedrockServiceTier field to provider settings schema
- Include service_tier parameter in Bedrock API requests for supported models
- Apply tier-specific pricing (75% premium for Priority, 50% discount for Flex)
- Add UI selector for service tier in Bedrock settings component
- Add models that support service tiers based on AWS documentation:
  - Amazon Nova models (Lite, Pro, Pro Latency Optimized)
  - DeepSeek R1
  - Qwen models
  - OpenAI GPT-OSS models
- Add translation strings for service tier UI

Addresses #9874
@roomote
Copy link
Contributor Author

roomote bot commented Dec 9, 2025

Rooviewer Clock   See task on Roo Cloud

All issues have been resolved. Recent changes fix grammar typos in Catalan and Spanish translations.

  • Add tests for service tier functionality in bedrock.spec.ts (pricing multipliers, API request parameters, unsupported models)
  • Add translations for all locales
Previous reviews

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

}

// Add service tier if specified and model supports it
if (this.options.awsBedrockServiceTier && BEDROCK_SERVICE_TIER_MODEL_IDS.includes(baseModelId as any)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This service tier feature should have test coverage. The existing bedrock.spec.ts has comprehensive tests for similar features (like the 1M context beta). Consider adding tests for: (1) service tier parameter being included in API requests for supported models, (2) pricing multipliers being correctly applied in getModel(), and (3) service tier NOT being applied for unsupported models.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@roomote amazon.nova-2-lite-v1:0 is also supported for the Service Tiers. Add to the list of models

Copy link
Contributor Author

@roomote roomote bot Dec 9, 2025

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issues. All local checks passed.

View commit | Revert commit

Copy link
Contributor

Choose a reason for hiding this comment

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

@roomote
1/Error message received - Unknown Error: The model returned the following errors: Malformed input request: #: extraneous key [service_tier] is not permitted, please reformat your input and try again.
2/The code is adding service_tier to additionalModelRequestFields, but according to the AWS Bedrock documentation, service_tier should be a top-level parameter in the request, not nested inside additionalModelRequestFields. Fix accordingly
3/Documentation https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html

https://docs.aws.amazon.com/bedrock/latest/userguide/custom-model-import-advanced-features.html

Copy link
Contributor Author

@roomote roomote bot Dec 9, 2025

Choose a reason for hiding this comment

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

Fixaroo Clock   See task on Roo Cloud

Fixed the service_tier placement. Per AWS documentation, it must be a top-level request parameter, not nested inside additionalModelRequestFields. All tests pass.

View commit | Revert commit

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 9, 2025
Per AWS Bedrock documentation, service_tier must be a top-level parameter
in the API request, not nested inside additionalModelRequestFields.

The previous implementation incorrectly placed service_tier inside
additionalModelRequestFields which caused "extraneous key [service_tier]
is not permitted" errors from the Bedrock API.

This fix:
- Moves service_tier to be a top-level payload parameter
- Updates tests to verify service_tier is at top level
- Adds documentation links to the code for reference

Refs: https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html
@ronyblum
Copy link
Contributor

ronyblum commented Dec 9, 2025

@Smartsheet-JB-Brown @hannesrudolph @mrubens PR after updates tested locally and works as expected

@roomote
Copy link
Contributor Author

roomote bot commented Dec 14, 2025

Fixaroo Clock   Follow along on Roo Cloud

Working on the following:

  • Adding AWS Bedrock service tier translations to all locale files

@mrubens mrubens marked this pull request as ready for review December 14, 2025 20:12
@mrubens mrubens requested review from cte and jr as code owners December 14, 2025 20:12
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 14, 2025
@dosubot dosubot bot added Enhancement New feature or request lgtm This PR has been approved by a maintainer labels Dec 14, 2025
@roomote
Copy link
Contributor Author

roomote bot commented Dec 14, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. All previous issues have been addressed and no new issues found.

  • Add tests for service tier functionality in bedrock.spec.ts
  • Add amazon.nova-2-lite-v1:0 to supported models list
  • Move service_tier to top-level request parameter (per AWS docs)
  • Add translations for all 17 locales

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

mrubens and others added 3 commits December 14, 2025 15:17
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
@mrubens mrubens merged commit 9f3122f into main Dec 14, 2025
10 checks passed
@mrubens mrubens deleted the feature/bedrock-service-tiers branch December 14, 2025 20:26
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 14, 2025
@roomote roomote bot mentioned this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] - Add support for bedrock service tiers

5 participants