-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Global Inference for Bedrock models (#8750) #8940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Code Review SummaryI've reviewed the latest changes and found no new issues. The addition of ap-southeast-4 (Melbourne) to the Australia regional inference profile is correctly implemented. Issues Found
Previous ReviewsMention @roomote in a comment to trigger your PR Fixer agent and make changes to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for AWS Bedrock Global Inference profile routing, which enables automatic selection of optimal AWS regions for supported models. The feature is mutually exclusive with cross-region inference.
Key changes:
- Added new configuration option
awsUseGlobalInferencefor enabling Global Inference profiles - Introduced
BEDROCK_GLOBAL_INFERENCE_MODEL_IDSconstant listing supported models (Claude Sonnet 4, 4.5, and Haiku 4.5) - Implemented UI checkbox that appears conditionally for supported models and enforces mutual exclusivity with cross-region inference
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| webview-ui/src/i18n/locales/en/settings.json | Added translation key for Global Inference checkbox label |
| webview-ui/src/components/settings/providers/Bedrock.tsx | Added conditional UI checkbox for Global Inference with one-way mutual exclusion logic |
| src/api/providers/bedrock.ts | Implemented Global Inference prefix (global.) application logic with precedence over cross-region inference |
| packages/types/src/providers/bedrock.ts | Defined list of models supporting Global Inference |
| packages/types/src/provider-settings.ts | Added awsUseGlobalInference boolean field to Bedrock schema |
Comments suppressed due to low confidence (1)
webview-ui/src/components/settings/providers/Bedrock.tsx:167
- The cross-region inference checkbox lacks reciprocal mutual exclusion logic. When enabling cross-region inference, it should also disable Global Inference (similar to how enabling Global Inference disables cross-region inference on lines 157-158). Update the onChange handler to:
onChange={(checked: boolean) => { setApiConfigurationField('awsUseCrossRegionInference', checked); if (checked) setApiConfigurationField('awsUseGlobalInference', false); }}
<Checkbox
checked={apiConfiguration?.awsUseCrossRegionInference || false}
onChange={handleInputChange("awsUseCrossRegionInference", noTransform)}>
{t("settings:providers.awsCrossRegion")}
</Checkbox>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…erence (disable global inference)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mutual exclusion issue has been resolved. However, there is still one open issue regarding the Hindi translation that needs to be addressed before approval.
|
@roomote the jp and au (and potentially others) prefixes are currently missing from AWS_INFERENCE_PROFILE_MAPPING which need to be added as well: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html |
|
Fixed the reported issues. All local checks passed. |
|
@hannesrudolph Apologies - missed that this was a bug due to the addition of new, more specific regions by AWS. |
…an and Australia - Add jp. prefix for ap-northeast- regions (Tokyo/Osaka) - Add au. prefix for ap-southeast-2 region (Sydney) - Reorder mappings by pattern length descending for correct matching - Update tests to reflect new regional mappings - Allow numbers in region pattern validation regex Addresses feedback from XL-Lewis per AWS documentation: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html
|
@roomote The au region covers both ap-southeast-2 and ap-southeast-4, while jp covers 1 and 3 |
|
Fixed the reported issue. All local checks passed. |
Related GitHub Issue
Closes: #8750
Roo Code Task Context (Optional)
No Roo Code task context for this PR
Description
Implements Global Inference support for Amazon Bedrock models that currently support it (Claude Sonnet 4, Claude Sonnet 4.5, Claude Haiku 4.5). Adds:
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
No UI layout changes; adds one checkbox when applicable.
Documentation Updates
Additional Notes
Get in Touch
@your-discord
Important
Adds global inference support for specific Amazon Bedrock models, updating settings, UI, and tests to accommodate the new feature.
bedrock.ts.awsUseGlobalInferencesetting inprovider-settings.tsand UI toggle inBedrock.tsx.AwsBedrockHandlerprefixes model IDs withglobal.for supported models when global inference is enabled.BEDROCK_GLOBAL_INFERENCE_MODEL_IDSinbedrock.tsto list supported models.bedrock-inference-profiles.spec.tsandbedrock.spec.tsto cover new global inference logic.awsGlobalInferencetranslation key in multiple locale files (e.g.,settings.jsonforru,tr,vi,zh-CN,zh-TW).This description was created by
for 598ccac. You can customize this summary. It will automatically update as commits are pushed.