continuedev/continue · error · Error
Unknown AI SDK provider: "${this.providerId}". Supported pro
Error message
Unknown AI SDK provider: "${this.providerId}". Supported providers: ${supportedProviders}. To use a different provider, install the @ai-sdk/* package and add it to the provider map. What it means
AiSdk looks up the provider prefix of 'provider/model' in PROVIDER_MAP; an unknown providerId means the required @ai-sdk/* package isn't in the map, and initializeProvider throws listing supported options.
Source
Thrown at packages/openai-adapters/src/apis/AiSdk.ts:77
if (!config.model) {
throw new Error(
"AI SDK provider requires a model in the format '<provider>/<model>' (e.g., 'openai/gpt-4o')",
);
}
const [providerId, ...modelParts] = config.model.split("/");
this.providerId = providerId;
this.modelId = modelParts.join("/");
}
private initializeProvider() {
if (this.provider) {
return;
}
const createFn = PROVIDER_MAP[this.providerId];
if (!createFn) {
const supportedProviders = Object.keys(PROVIDER_MAP).join(", ");
throw new Error(
`Unknown AI SDK provider: "${this.providerId}". ` +
`Supported providers: ${supportedProviders}. ` +
`To use a different provider, install the @ai-sdk/* package and add it to the provider map.`,
);
}
const hasRequestOptions =
this.config.requestOptions &&
(this.config.requestOptions.headers ||
this.config.requestOptions.proxy ||
this.config.requestOptions.caBundlePath ||
this.config.requestOptions.clientCertificate ||
this.config.requestOptions.extraBodyProperties);
this.provider = createFn({
apiKey: this.config.apiKey ?? "",
baseURL: this.config.apiBase,
fetch: hasRequestOptionsView on GitHub (pinned to 5522c6f44c)
Solutions
- Use one of the providers listed in the error message
- npm install the matching @ai-sdk/<provider> package and add it to PROVIDER_MAP as the message instructs
- Fix typos in the provider prefix
- Check package version for which providers ship in the map
Example fix
// before
new AiSdk({ model: 'mistakelabs/mistral-large' });
// after
new AiSdk({ model: 'mistral/mistral-large' }); // after ensuring @ai-sdk/mistral is in PROVIDER_MAP Defensive patterns
Strategy: validation
Validate before calling
const provider = cfg.model.split('/')[0]; if (!PROVIDER_IDS.includes(provider)) throw new Error(`unsupported provider ${provider}`); Type guard
function isKnownProvider(model: string, known: readonly string[]): boolean { return known.includes(model.split('/')[0]); } Try / catch
try { await llm.chatCompletionStream(...) } catch (e) { if (/Unknown AI SDK provider/.test(e.message)) { /* install @ai-sdk pkg and register, or switch model */ } throw e; } Prevention
- Check the supported provider list before selecting model strings
- Install and register the @ai-sdk/* package for custom providers
- Verify provider map contents on package upgrade
When it happens
Trigger: model like 'foobar/gpt-4o' where 'foobar' isn't a key of PROVIDER_MAP — called lazily on first chatCompletionNonStream/chatCompletionStream/embed.
Common situations: Using a provider whose @ai-sdk/* package isn't installed/registered, typos in the provider prefix, or upgrading removed a provider from the map.
Related errors
- AI SDK provider requires a model in the format '<provider>/<
- Tool ${toolName} not found
- Tool ${toolCall.function.name} not found
- Failed to fetch models for ${provider}: ${error?.message ??
- Either streamCompletion or streamChat must be defined in a c
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/818589c2766a2377.
Report an issue: GitHub.