Skip to content

feat(bedrock): add support for service tier for model inference#13242

Merged
aayush-kapoor merged 3 commits intovercel:mainfrom
heiwen:bedrock-service-tier
Apr 1, 2026
Merged

feat(bedrock): add support for service tier for model inference#13242
aayush-kapoor merged 3 commits intovercel:mainfrom
heiwen:bedrock-service-tier

Conversation

@heiwen
Copy link
Copy Markdown
Contributor

@heiwen heiwen commented Mar 9, 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:

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

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixes #13241

@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label documentation Improvements or additions to documentation feature New feature or request provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider labels Mar 9, 2026
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor left a comment

Choose a reason for hiding this comment

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

needs an example and a changeset - will add

@aayush-kapoor aayush-kapoor changed the title feat(bedrock): support service tier feat(bedrock): add support for service tier for model inference Apr 1, 2026
@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 1, 2026
@aayush-kapoor aayush-kapoor merged commit 6d8716c into vercel:main Apr 1, 2026
19 of 20 checks passed
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>
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 1, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 1, 2026

✅ Backport PR created: #14024

vercel-ai-sdk bot added a commit that referenced this pull request Apr 1, 2026
…ence (#14024)

This is an automated backport of #13242 to the release-v6.0 branch. FYI
@heiwen

Co-authored-by: Heinrich Wendel <heinrich.wendel@gmail.com>
Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 1, 2026

🚀 Published in:

Package Version
@ai-sdk/amazon-bedrock 5.0.0-beta.16

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label documentation Improvements or additions to documentation feature New feature or request provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ai-sdk/amazon-bedrock: missing support for serviceTier

2 participants