continuedev/continue · error · Error
AI SDK provider requires a model in the format '<provider>/<
Error message
AI SDK provider requires a model in the format '<provider>/<model>' (e.g., 'openai/gpt-4o')
What it means
The AiSdk provider adapter (OpenAI-compatible) derives its provider and model by splitting config.model on '/'; a missing/empty model string makes construction impossible, so the constructor throws immediately.
Source
Thrown at packages/openai-adapters/src/apis/AiSdk.ts:60
baseURL: options.baseURL ?? "https://openrouter.ai/api/v1/",
}),
clawrouter: (options) =>
createOpenAI({
...options,
baseURL: options.baseURL ?? "http://localhost:1337/v1/",
}),
};
export class AiSdkApi implements BaseLlmApi {
private provider?: (modelId: string) => any;
private config: AiSdkConfig;
private providerId: string;
private modelId: string;
constructor(config: AiSdkConfig) {
this.config = config;
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}". ` +View on GitHub (pinned to 5522c6f44c)
Solutions
- Set model to '<provider>/<model>' e.g. 'openai/gpt-4o' in the adapter config
- Check the config source (YAML/config file) for a missing or empty model field
- Add a startup validation of model strings before constructing providers
Example fix
// before
new AiSdk({ model: '' });
// after
new AiSdk({ model: 'openai/gpt-4o' }); Defensive patterns
Strategy: validation
Validate before calling
if (!cfg?.model || !/^[^/]+\/.+/.test(cfg.model)) throw new Error('model must be provider/model'); Type guard
function isProviderModelString(s: unknown): s is `${string}/${string}` { return typeof s === 'string' && /^[^/\s]+\/[^/\s]+$/.test(s); } Try / catch
try { new AiSdk(config); } catch (e) { if (/requires a model/.test(e.message)) config.model = 'openai/gpt-4o'; else throw e; } Prevention
- Always configure model as '<provider>/<model>'
- Validate config at startup
- Fail fast on empty model fields in config loaders
When it happens
Trigger: new AiSdk({ model: '' }) or omitting model in the config passed to the adapter (e.g. via a model config without a 'model' field).
Common situations: YAML/JSON model configs where the model name field is missing or blank, or programmatic config built with a typo'd key.
Related errors
- Either streamCompletion or streamChat must be defined in a c
- No models available in assistant configuration
- Model ${modelName} does not have an apiKeyLocation or envSec
- Unknown AI SDK provider: "${this.providerId}". Supported pro
- Profile ${profileId} not found
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/6267c23c75d36e0a.
Report an issue: GitHub.