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
- Use the full format: owner/package/provider/model, e.g. my-owner/my-package/openai/gpt-4o
- If you only have provider/model, add the correct owner and package slugs
- 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
- Always write models as owner/package/provider/model
- Validate model strings at config load time
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
- Invalid FQSN format: package slug must have two parts
- Table name must be in format schema.table_name, got ${tableN
- Only rule files can be deleted
- FindAndReplaceMissingOldString
- FindAndReplaceMissingNewString
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/28e01aaf4826c9d7.
Report an issue: GitHub.