feat(bedrock): add support for service tier for model inference#13242
Merged
aayush-kapoor merged 3 commits intovercel:mainfrom Apr 1, 2026
Merged
feat(bedrock): add support for service tier for model inference#13242aayush-kapoor merged 3 commits intovercel:mainfrom
aayush-kapoor merged 3 commits intovercel:mainfrom
Conversation
Collaborator
aayush-kapoor
left a comment
There was a problem hiding this comment.
needs an example and a changeset - will add
aayush-kapoor
approved these changes
Apr 1, 2026
vercel-ai-sdk bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
## Background https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html `@ai-sdk/amazon-bedrock` was missing request-side support for Bedrock inference service tiers, despite Amazon Bedrock supporting them natively for `Converse` / `ConverseStream` requests. This created a feature gap relative to other AI SDK providers such as Groq, which already expose request-level service tier controls. Without this, Bedrock users could observe service tier information in provider metadata, but could not select a tier through `providerOptions`, even though the underlying Bedrock API supports it. ## Summary This PR adds request-level Bedrock service tier support via `providerOptions.bedrock.serviceTier`. Changes included: - Added `serviceTier` to `AmazonBedrockLanguageModelOptions` - Validated supported values: `reserved`, `priority`, `default`, `flex` - Serialized the option into Bedrock request bodies as top-level `serviceTier: { type: ... }` - Added generate and stream tests covering request serialization - Added schema tests for accepted and rejected values - Updated the Bedrock provider docs with a usage example - Added a patch changeset for `@ai-sdk/amazon-bedrock` ## Manual Verification Manually verified by exercising both `doGenerate` and `doStream` request construction in the Bedrock provider tests and confirming the outgoing request body includes: ```ts serviceTier: { type: 'priority', } ``` Also verified that: - the value is sent as a top-level Bedrock request field, not under `additionalModelRequestFields` - invalid values are rejected by provider option validation - existing request behavior remains unchanged when `serviceTier` is omitted ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes #13241 --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com> Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
Contributor
|
✅ Backport PR created: #14024 |
Contributor
|
🚀 Published in:
|
Ghitahouir
pushed a commit
to Ghitahouir/ai
that referenced
this pull request
Apr 2, 2026
…el#13242) ## Background https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html `@ai-sdk/amazon-bedrock` was missing request-side support for Bedrock inference service tiers, despite Amazon Bedrock supporting them natively for `Converse` / `ConverseStream` requests. This created a feature gap relative to other AI SDK providers such as Groq, which already expose request-level service tier controls. Without this, Bedrock users could observe service tier information in provider metadata, but could not select a tier through `providerOptions`, even though the underlying Bedrock API supports it. ## Summary This PR adds request-level Bedrock service tier support via `providerOptions.bedrock.serviceTier`. Changes included: - Added `serviceTier` to `AmazonBedrockLanguageModelOptions` - Validated supported values: `reserved`, `priority`, `default`, `flex` - Serialized the option into Bedrock request bodies as top-level `serviceTier: { type: ... }` - Added generate and stream tests covering request serialization - Added schema tests for accepted and rejected values - Updated the Bedrock provider docs with a usage example - Added a patch changeset for `@ai-sdk/amazon-bedrock` ## Manual Verification Manually verified by exercising both `doGenerate` and `doStream` request construction in the Bedrock provider tests and confirming the outgoing request body includes: ```ts serviceTier: { type: 'priority', } ``` Also verified that: - the value is sent as a top-level Bedrock request field, not under `additionalModelRequestFields` - invalid values are rejected by provider option validation - existing request behavior remains unchanged when `serviceTier` is omitted ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes vercel#13241 --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com> Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
https://docs.aws.amazon.com/bedrock/latest/userguide/service-tiers-inference.html
@ai-sdk/amazon-bedrockwas missing request-side support for Bedrock inference service tiers, despite Amazon Bedrock supporting them natively forConverse/ConverseStreamrequests. This created a feature gap relative to other AI SDK providers such as Groq, which already expose request-level service tier controls.Without this, Bedrock users could observe service tier information in provider metadata, but could not select a tier through
providerOptions, even though the underlying Bedrock API supports it.Summary
This PR adds request-level Bedrock service tier support via
providerOptions.bedrock.serviceTier.Changes included:
serviceTiertoAmazonBedrockLanguageModelOptionsreserved,priority,default,flexserviceTier: { type: ... }@ai-sdk/amazon-bedrockManual Verification
Manually verified by exercising both
doGenerateanddoStreamrequest construction in the Bedrock provider tests and confirming the outgoing request body includes:Also verified that:
additionalModelRequestFieldsserviceTieris omittedChecklist
pnpm changesetin the project root)Related Issues
Fixes #13241