Add new or remove obsolete model IDs for existing AI SDK providers. Use when adding a model to a provider, removing an obsolete model, or processing a list of model changes from an issue. Triggers on "add model", "remove model", "new model ID", "obsolete model", "update model IDs".
This skill covers adding new model IDs and removing obsolete ones across the AI SDK codebase. Each workflow uses search to discover all locations that need changes.
You may be asked to add or remove a single model ID, or to process a list of multiple model ID changes from an issue. For each model ID, follow the appropriate workflow:
<adding-new-model> workflow.<removing-obsolete-model> workflow.grok-3 vs grok-3-mini). Always verify each search result is the exact model, not a substring match.gpt-5.4-codexgpt-5-4-codex.tsCHANGELOG.md files of packages/codemod: Changelog files are historical records, codemods are migration scripts. Do not edit either when updating model IDs.Determine:
anthropic, openai, google, xai)claude-haiku-4-5-20260218, gemini-3.1-pro, gpt-5.4-codex)Search for a similar existing model from the same provider (e.g. a lower version, or the preview version being replaced) across packages/, content/, and examples/. This reveals all locations that need updates.
# Search quoted occurrences to find all reference locations
grep -r "'<similar-model-id>'" packages/ content/ examples/ --include='*.ts' --include='*.mdx' --include='*.md'
grep -r '"<similar-model-id>"' packages/ content/ examples/ --include='*.ts' --include='*.mdx' --include='*.md'
For each relevant packages file found, add the new model ID to the type union (and const arrays if present), respecting existing sort order.
Examples of common locations for model ID type definitions:
packages/<provider>/src/*-options.ts — the primary provider packagepackages/gateway/src/gateway-language-model-settings.ts — the AI Gateway packagepackages/amazon-bedrock/src/**/*-options.ts — if the model is available on Amazon Bedrockpackages/google-vertex/src/*-options.ts — if the model is available on Google VertexThis is NOT an exhaustive list — the search in Step 2 may reveal other files with model ID references that need updating as well.
Never replace a model ID here. Only add the new model ID. Replacing references to an older or preview model ID is only relevant in documentation and examples.
Example type union addition:
export type SomeModelId =
| 'existing-model-a'
| 'new-model-id' // ← add in sorted position
| 'existing-model-b'
| (string & {});
Example const array addition:
export const reasoningModelIds = [
'existing-model-a',
'new-model-id', // ← add in sorted position
'existing-model-b',
] as const;
For each .mdx file found in content/, add or update entries:
<Check size={18} /> or <Cross size={18} />).const model = provider('old-model') to use the new model.If you found the similar model ID referenced in a specific package's README.md file, update the model ID in those code examples as well.
If the new model replaces an older one: Find existing examples using the old model and update them to use the new model ID.
If purely new with no predecessor: Create new example files, one file per top-level function that is relevant for the new model (e.g. generateText, streamText, generateImage). For example, if it's a new language model, you would create files like:
examples/ai-functions/src/generate-text/<provider>/<model-kebab>.tsexamples/ai-functions/src/stream-text/<provider>/<model-kebab>.tsOr if it's a new image model, you might create:
examples/ai-functions/src/generate-image/<provider>/<model-kebab>.tsLook for existing example files for the provider in the same folder, to use as a reference for your new example files.
In your search for the similar model ID, you may have found examples in which the model ID is part of a list of models (e.g. in an array of options for a test or example). In that case, add the new model ID to the same list in the example file, respecting sort order.
Where reasonable, replace references to the older or preview model with the new model in test files, especially if the new model is now the recommended one.
Exception: Do not replace model IDs in fixtures or snapshots, or tests that use those fixtures or snapshots, as those are meant to be stable and reflect actual API responses captured.
pnpm --filter @ai-sdk/<provider> test
pnpm --filter @ai-sdk/gateway test
Also run tests for any other affected packages:
pnpm --filter @ai-sdk/openai-compatible test # if snapshots/tests were updated
pnpm --filter @ai-sdk/amazon-bedrock test # if Bedrock options were updated
pnpm --filter @ai-sdk/google-vertex test # if Vertex options were updated
Determine which model replaces the removed one in examples, tests, and docs. This is relevant for updating references.
If there is no obvious successor, you should leave old references in place in examples, docs, and tests.
Search for the model ID with quotes to avoid substring false positives:
# Single-quoted (TypeScript source, type unions)
grep -r "'<model-id>'" packages/ content/ examples/ --include='*.ts' --include='*.mdx' --include='*.md' --include='*.snap'
# Double-quoted (JSON in snapshots, test fixtures with embedded JSON, docs)
grep -r '"<model-id>"' packages/ content/ examples/ --include='*.ts' --include='*.mdx' --include='*.md' --include='*.snap'
Manually verify each result is the exact model and not a substring match (e.g. searching 'grok-3' must not match 'grok-3-mini').
Remove the | 'model-id' line from union types and entries from const arrays in *-options.ts files.
.mdx files.content/providers/03-community-providers/.*.test.ts files.__snapshots__/*.snap files — model IDs appear in serialized JSON strings."model":"old-model" → "model":"new-model").examples/ai-functions/src/e2e/*.test.ts — remove from model arrays or replace.packages/<provider>/README.md if it contains code examples.pnpm --filter @ai-sdk/<provider> test
Also run tests for any other affected packages (same as Workflow A Step 7).