continuedev/continue · error · Error

Invalid model format

Error message

Invalid model format

What it means

parseProxyModelName splits the model string on '/'; it requires at least owner/package/provider/model structure. If provider or model is empty (fewer than 4 meaningful segments), the format is invalid.

Source

Thrown at packages/config-yaml/src/modelName.ts:15

export interface ProxyModelName {
  ownerSlug: string;
  packageSlug: string;
  provider: string;
  model: string;
}

export function parseProxyModelName(modelName: string): ProxyModelName {
  const parts = modelName.split("/");

  const [ownerSlug, packageSlug, provider, ...modelParts] = parts;
  const model = modelParts.join("/");

  if (!provider || !model) {
    throw new Error("Invalid model format");
  }

  return { provider, model, ownerSlug, packageSlug };
}

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Use the full format: owner/package/provider/model, e.g. my-owner/my-package/openai/gpt-4o
  2. If you only have provider/model, add the correct owner and package slugs
  3. Validate the segment count before calling

Example fix

// before
parseProxyModelName('openai/gpt-4');
// after
parseProxyModelName('my-owner/my-package/openai/gpt-4');
Defensive patterns

Strategy: validation

Validate before calling

function isProxyModelName(s: string): boolean {
  const parts = s.split('/');
  return parts.filter(Boolean).length >= 4;
}

Try / catch

try { parseProxyModelName(m); } catch (e) { if (e.message === 'Invalid model format') { /* prompt for owner/package/provider/model */ } }

Prevention

When it happens

Trigger: parseProxyModelName('gpt-4'), parseProxyModelName('openai/gpt-4'), or any string with fewer than 4 slash-separated parts; also a trailing slash making model empty.

Common situations: Passing a plain model name where the proxy format (owner/package/provider/model) is expected, or omitting the owner/package prefix.

Related errors


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