continuedev/continue · error · Error
Model ${modelName} not found in assistant configuration
Error message
Model ${modelName} not found in assistant configuration What it means
Assistant.getModel(modelName) throws when no entry in config.models matches by exact model string, substring inclusion, or '/'+name suffix.
Source
Thrown at packages/continue-sdk/typescript/src/Assistant.ts:49
if (!this.config.models || !firstModel) {
throw new Error("No models available in assistant configuration");
}
if (!modelName) {
return firstModel.model;
}
// Look for a model matching the provided name
const model = this.config.models.find(
(m) =>
m?.model === modelName ||
m?.model.includes(modelName) ||
m?.model.endsWith(`/${modelName}`),
);
if (!model) {
throw new Error(
`Model ${modelName} not found in assistant configuration`,
);
}
return model.model;
}
/**
* Get the system message from the assistant rules
*
* @returns The concatenated rules as a single string
*/
get systemMessage(): string {
if (!this.config.rules || !Array.isArray(this.config.rules)) {
return "";
}
return this.config.rulesView on GitHub (pinned to 5522c6f44c)
Solutions
- List assistant.config.models and use an exact 'model' value from it
- Fix typos/case in the requested name
- Use the bare model name without provider prefix (or vice versa) since matching is exact/substring/suffix
- Call getModel() with no argument to use the first configured model
Example fix
// before
const m = assistant.getModel('gpt4o');
// after
const m = assistant.getModel('gpt-4o'); Defensive patterns
Strategy: validation
Validate before calling
const names = assistant.config.models.map(m => m.model); const ok = names.some(n => n === q || n.includes(q) || n.endsWith('/' + q)); Type guard
function modelExists(models: { model: string }[], name: string): boolean { return models.some(m => m.model === name || m.model.includes(name) || m.model.endsWith(`/${name}`)); } Try / catch
try { return assistant.getModel(name); } catch (e) { if (/not found/.test(e.message)) throw new Error(`Available: ${assistant.config.models.map(m=>m.model).join(', ')}`); throw e; } Prevention
- Source model names from assistant.config.models
- Avoid hand-typed model strings
- Handle empty-name case with getModel() for the default
When it happens
Trigger: Calling getModel('gpt-4o') when config.models contains no model whose 'model' field equals, includes, or ends with '/gpt-4o'.
Common situations: Typos or wrong casing in the model name, referencing a model the assistant doesn't bundle, or version drift where the assistant config renamed models.
Related errors
- No models available in assistant configuration
- Assistant ${options.assistant} not found
- Model ${modelName} not found in assistant configuration
- Invalid assistant identifier: ${options.assistant}. Expected
- Model ${modelName} does not have an apiKeyLocation or envSec
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/fde8b916202ff0ce.
Report an issue: GitHub.