janhq/jan · error
model.yml not found for
Error message
model.yml not found for ${modelId} What it means
Thrown by the model-configuration read path when models/<modelId>/model.yml cannot be found. This YAML file holds the model's config (context length, mtp/speculative-decoding params, etc.), so without it the extension cannot build or validate the model's runtime settings.
Solutions
- Confirm the modelId is correct and belongs to the llamacpp provider.
- Re-import or re-download the model so model.yml is regenerated.
- Check the provider's models/ directory on disk to see what actually exists.
- Refresh the model list / restart the app to clear stale catalog entries.
Example fix
// before
const cfg = await getModelConfig(modelId)
// after
const models = await extension.listModels()
if (!models.some(m => m.id === modelId)) {
throw new Error(`Model ${modelId} is not registered with the llamacpp provider`)
}
const cfg = await getModelConfig(modelId) Defensive patterns
Strategy: validation
Validate before calling
const settings = await listModelSettings()
if (!settings.some(s => s.modelId === modelId)) {
throw new Error(`No llamacpp settings exist for ${modelId}`)
} Type guard
null
Try / catch
try {
const cfg = await getModelConfig(modelId)
} catch (e) {
if (String(e).includes('model.yml not found')) {
promptUserToReimport(modelId)
return defaultModelConfig
}
throw e
} Prevention
- Import models only through the extension so model.yml is generated.
- Verify the modelId belongs to the llamacpp provider, not another provider.
- Re-download interrupted imports before reading settings.
- Refresh the catalog after any out-of-band file deletion.
When it happens
Trigger: Reading model settings/options for a modelId whose model.yml is missing — model not imported through this extension, import interrupted, files manually deleted, or modelId typo/wrong casing.
Common situations: Opening model settings in Jan UI for a model from another provider; a failed download left the directory without model.yml; the model was deleted while its settings page was open.
Understand the failure class
Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.
Related errors
- Model does not exist
- API request failed with status
- Backend setup was not successful. Please restart the app in…
- Backend update failed
- Backend update failed
AI-assisted analysis of janhq/jan@7205d770c1 (2026-09-17).
Data as JSON: /api/errors/42a74608cd081351.
Report an issue: GitHub.
Appendix: source
Thrown at extensions/llamacpp-extension/src/index.ts:2661
}
async updateMtpSettings(
modelId: string,
patch: {
mtp?: boolean
spec_draft_n_max?: number | null
spec_draft_n_min?: number | null
spec_draft_p_min?: number | null
}
): Promise<void> {
const configPath = await joinPath([
await this.getProviderPath(),
'models',
modelId,
'model.yml',
])
if (!(await fs.existsSync(configPath))) {
throw new Error(`model.yml not found for ${modelId}`)
}
const cfg = (await invoke<ModelConfig>('read_yaml', { path: configPath })) as ModelConfig & {
mtp?: boolean
spec_draft_n_max?: number
spec_draft_n_min?: number
spec_draft_p_min?: number
}
if (typeof patch.mtp === 'boolean') cfg.mtp = patch.mtp
const assignNumeric = (
key: 'spec_draft_n_max' | 'spec_draft_n_min' | 'spec_draft_p_min',
value: number | null | undefined
) => {
if (value === null) {
delete cfg[key]
} else if (typeof value === 'number' && Number.isFinite(value)) {
cfg[key] = value
}View on GitHub (pinned to 7205d770c1)