continuedev/continue · error · Error

Model ${modelName} not found in assistant configuration

Error message

Model ${modelName} not found in assistant configuration

What it means

Inside createOpenAIClient's fetch override, when a request specifies a model that does not match any model in the assistant's models list (exact match or endsWith), this error is thrown before the request is proxied to Continue.

Source

Thrown at packages/continue-sdk/typescript/src/createOpenAIClient.ts:69

    apiKey,
    baseURL: new URL("model-proxy/v1/", baseURL).toString(),
    fetch: async (url, init) => {
      // Clone the init object to avoid modifying the original
      const modifiedInit = init ? { ...init } : {};

      if (init?.method === "POST" && init?.body) {
        try {
          const body = JSON.parse(init.body as string);

          const modelName = body.model;

          // Look up the model in the assistant's models
          const modelConfig = assistantModels?.find(
            (m) => m?.model === modelName || m?.model.endsWith(modelName),
          );

          if (!modelConfig) {
            throw new Error(
              `Model ${modelName} not found in assistant configuration`,
            );
          }

          if (
            !("apiKeyLocation" in modelConfig) &&
            !("envSecretLocations" in modelConfig)
          ) {
            throw new Error(
              `Model ${modelName} does not have an apiKeyLocation or envSecretLocations defined`,
            );
          }

          const continueProperties: ContinueProperties = {
            apiKeyLocation: modelConfig.apiKeyLocation,
            envSecretLocations: modelConfig.envSecretLocations,
            orgScopeId: organizationId ?? null,
          };

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Set the OpenAI client's model to one listed in assistant config models (or the first model's name)
  2. Update the assistant config to include the model you're requesting
  3. Use exact model strings; matching is exact or suffix-based
  4. Construct the client with a full models list including the one you'll request

Example fix

// before
const completion = await client.chat.completions.create({ model: 'gpt-4-turbo', messages });

// after
const completion = await client.chat.completions.create({ model: 'gpt-4o', messages });
Defensive patterns

Strategy: validation

Validate before calling

const ok = assistantModels?.some(m => m.model === requested || m.model.endsWith(requested));

Type guard

function modelAvailable(models: { model: string }[] | undefined, name: string): boolean { return !!models?.some(m => m.model === name || m.model.endsWith(name)); }

Try / catch

try { await client.chat.completions.create({ model, messages }); } catch (e) { if (/not found in assistant configuration/.test(e.message)) model = firstModel; /* retry */ else throw e; }

Prevention

When it happens

Trigger: Chat completion via the OpenAI-compatible client with body.model set to a name not present in the assistant config's models (e.g. 'gpt-4-turbo' when only 'gpt-4o' is configured).

Common situations: Hardcoded model names in existing OpenAI SDK code, model renamed/removed in the assistant config, or passing a fully-qualified name when config uses a short one (or vice versa).

Related errors


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