Skip to content

feat: normalize provider specific model options type names and ensure they are exported#12443

Merged
felixarntz merged 17 commits intomainfrom
fa-12269-normalize-provider-options-types
Feb 11, 2026
Merged

feat: normalize provider specific model options type names and ensure they are exported#12443
felixarntz merged 17 commits intomainfrom
fa-12269-normalize-provider-options-types

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

@felixarntz felixarntz commented Feb 11, 2026

Background

Provider-specific model options types had inconsistent naming (*ProviderOptions, *CallOptions, *ChatOptions, etc.) and many were not exported from their packages, making it impossible for consumers to use satisfies for type-safe providerOptions. This needs to be normalized before the v7 beta release, especially in preparation for renaming providerOptions to options.

Summary

Normalizes all provider-specific model options type names across 31 packages to follow a consistent *ModelOptions convention and ensures they are all exported:

  • Renamed types to follow {Provider}{ModelType}{OptionalModelSuffix}Options pattern, e.g.:
    • AnthropicProviderOptionsAnthropicLanguageModelOptions
    • OpenAIResponsesProviderOptionsOpenAILanguageModelResponsesOptions
  • Renamed Zod schemas to match
    • e.g. anthropicProviderOptionsanthropicLanguageModelOptions
  • Exported 13 types from 8 packages that were previously internal-only, e.g.
    • GroqTranscriptionModelOptions
    • OpenAITranscriptionModelOptions
    • FalSpeechModelOptions
  • Added deprecated aliases for all previously exported names across 23 packages to maintain backward compatibility
  • Fixed @ai-sdk/groq: Already had a transcription model options type, but in the wrong file and under the wrong name and not exported
  • Updated ~190 example files to use satisfies *Options on providerOptions inner objects
  • Updates examples across documentation to use the new type names and include the types on examples where they were missing but relevant
  • Added the new naming convention and export requirements to contributing/providers.md

All changes are fully backward compatible — no breaking changes.

Manual Verification

  • pnpm type-check:full passes with no errors
  • pnpm build succeeds for all packages
  • pnpm prettier-check passes

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)

Future Work

Consider adding options types for providers that don't have them yet, and add satisfies to those examples accordingly. For example:

Related Issues

Fixes #12269

@vercel-ai-sdk vercel-ai-sdk bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider provider/anthropic Issues related to the @ai-sdk/anthropic provider labels Feb 11, 2026
Copy link
Copy Markdown
Collaborator

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Looks good, just remove the changes to the migration guides.

I've seen that happen in the past, I wonder if we can somehow skill-ify the best-practice of not touching migration guides and codemods when doing bigger updates across the codebase

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

revert the change in migration guides

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

reverted. also pushed fccfe5d as an attempt to teach agents

Comment on lines +18 to +24
## Provider-Specific Model Options Types

Types and Zod schemas for the provider specific model options follow the pattern `{Provider}{ModelType}Options`, e.g. `AnthropicLanguageModelOptions`.
If a provider has multiple implementations for the same model type, add a qualifier: `{Provider}{ModelType}{Qualifier}Options`, e.g. `OpenAILanguageModelChatOptions` and `OpenAILanguageModelResponsesOptions`.

- types are PascalCase, Zod schemas are camelCase (e.g. `openaiLanguageModelChatOptions`)
- types must be exported from the provider package, Zod schemas must not
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice

@gr2m gr2m marked this pull request as draft February 11, 2026 21:01
@gr2m gr2m marked this pull request as ready for review February 11, 2026 21:04
@gr2m
Copy link
Copy Markdown
Collaborator

gr2m commented Feb 11, 2026

shortly put the PR to draft mode to confirm that CI fails when a type error is introduced to examples/ai-functions/src/deprecated-options-types.test-d.ts.

Confirmed locally that the type-check:full script fails and that we run it as part of our CI, so good to go 👍🏼

run: pnpm run type-check:full

@felixarntz felixarntz merged commit 99fbed8 into main Feb 11, 2026
18 checks passed
@felixarntz felixarntz deleted the fa-12269-normalize-provider-options-types branch February 11, 2026 21:27
felixarntz added a commit that referenced this pull request Feb 12, 2026
… for existing schemas (#12457)

## Background

Follow-up to #12443: six providers still had internal providerOptions
schemas that weren't renamed to the normalized naming convention or
exported. This PR addresses those remaining gaps tracked in #12269.

## Summary

Renames and exports provider-specific model options types for 6
providers that already had Zod schemas internally but weren't following
the normalized naming convention:

- `@ai-sdk/amazon-bedrock`: `AmazonBedrockEmbeddingModelOptions`
- `@ai-sdk/lmnt`: `LMNTSpeechModelOptions`
- `@ai-sdk/hume`: `HumeSpeechModelOptions`
- `@ai-sdk/revai`: `RevaiTranscriptionModelOptions`
- `@ai-sdk/assemblyai`: `AssemblyAITranscriptionModelOptions`
- `@ai-sdk/gladia`: `GladiaTranscriptionModelOptions`

Also updates documentation code snippets and examples to use `satisfies`
with the newly exported types.

## 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)

## Future Work

Other categories of providers from #12269 still need attention:
- Providers using raw passthrough without schemas (e.g. elevenlabs, fal,
sarvam)
- Providers extending OpenAI-compatible that inherit options
- Providers without embedding providerOptions support

These will require separate follow up issues for consideration.

## Related Issues

Fixes #12269
felixarntz added a commit that referenced this pull request Mar 26, 2026
…atewayProviderOptions (#13855)

## Background

When provider options types were recently renamed from
`{Provider}ProviderOptions` to `{Provider}{ModelType}Options` across all
providers (see #12443), the AI Gateway's type was renamed from
`GatewayProviderOptions` to `GatewayLanguageModelOptions`. However,
unlike other providers, the gateway's options are truly provider-wide
(routing, fallbacks, tags, BYOK, etc.) — not specific to any model type.
The original name was more accurate.

## Summary

- Renamed `GatewayLanguageModelOptions` back to `GatewayProviderOptions`
as the primary export, with `GatewayLanguageModelOptions` kept as a
deprecated alias
- Updated all examples, docs, and type tests to use
`GatewayProviderOptions`
- Added a note to `contributing/providers.md` documenting when
`{Provider}ProviderOptions` should be used instead of
`{Provider}{ModelType}Options`

## 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)
vercel-ai-sdk bot pushed a commit that referenced this pull request Mar 26, 2026
…atewayProviderOptions (#13855)

## Background

When provider options types were recently renamed from
`{Provider}ProviderOptions` to `{Provider}{ModelType}Options` across all
providers (see #12443), the AI Gateway's type was renamed from
`GatewayProviderOptions` to `GatewayLanguageModelOptions`. However,
unlike other providers, the gateway's options are truly provider-wide
(routing, fallbacks, tags, BYOK, etc.) — not specific to any model type.
The original name was more accurate.

## Summary

- Renamed `GatewayLanguageModelOptions` back to `GatewayProviderOptions`
as the primary export, with `GatewayLanguageModelOptions` kept as a
deprecated alias
- Updated all examples, docs, and type tests to use
`GatewayProviderOptions`
- Added a note to `contributing/providers.md` documenting when
`{Provider}ProviderOptions` should be used instead of
`{Provider}{ModelType}Options`

## 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)
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 provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider provider/anthropic Issues related to the @ai-sdk/anthropic provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize *ProviderOptions type names and export from all packages

2 participants