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.rules

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. List assistant.config.models and use an exact 'model' value from it
  2. Fix typos/case in the requested name
  3. Use the bare model name without provider prefix (or vice versa) since matching is exact/substring/suffix
  4. 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

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


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/fde8b916202ff0ce. Report an issue: GitHub.