{"record":{"id":"8c462bc14eafe14f","repo":"janhq/jan","slug":"catalog-not-supported-for-provider-provider","errorCode":null,"errorMessage":"Catalog not supported for ${provider.provider}","messagePattern":"Catalog not supported for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"web-app/src/lib/remoteModelCatalog.ts","lineNumber":202,"sourceCode":"    body = await response.json()\n  } catch {\n    body = null\n  }\n  return {\n    ok: response.ok,\n    status: response.status,\n    statusText: response.statusText,\n    body,\n  }\n}\n\nexport async function fetchTopRemoteModels(\n  provider: ProviderLike,\n  fetchImpl: FetchImpl\n): Promise<RemoteCatalogModel[]> {\n  const kind = resolveCatalogKind(provider)\n  if (!kind) {\n    throw new Error(`Catalog not supported for ${provider.provider}`)\n  }\n  if (!provider.base_url) {\n    throw new Error('Provider must have base_url configured')\n  }\n\n  const keyChain = providerRemoteApiKeyChain(provider)\n  const attempts: (string | undefined)[] = keyChain.length > 0 ? keyChain : [undefined]\n\n  let lastStatus = 0\n  let lastStatusText = ''\n  for (let i = 0; i < attempts.length; i++) {\n    const result = await getJson(\n      fetchImpl,\n      `${provider.base_url}/models`,\n      buildHeaders(provider, attempts[i])\n    )\n    lastStatus = result.status\n    lastStatusText = result.statusText","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/web-app/src/lib/remoteModelCatalog.ts#L184-L220","documentation":"fetchTopRemoteModels throws this when resolveCatalogKind(provider) returns null, i.e. the provider's type is not one of the supported remote catalog kinds (e.g. only OpenAI/Anthropic-style providers have model list catalogs). It signals that 'list top models' is not implemented for this provider rather than a network failure.","triggerScenarios":"Calling fetchTopRemoteModels with an Ollama/llama.cpp/local provider or a custom remote provider whose kind isn't mapped; provider misconfigured so its discriminator no longer resolves.","commonSituations":"Showing a model catalog for every provider in settings without gating on supported kinds; custom OpenAI-compatible proxies not registered as a catalog kind; new provider type added without extending resolveCatalogKind.","solutions":["Only call fetchTopRemoteModels for providers where resolveCatalogKind(provider) is non-null; show manual model entry otherwise.","Extend resolveCatalogKind to map the new provider kind if the upstream API actually supports /models.","Catch the error in UI and fall back to a user-supplied model id input."],"exampleFix":"// before\nconst models = await fetchTopRemoteModels(provider, fetch)\n// after\nif (resolveCatalogKind(provider)) {\n  const models = await fetchTopRemoteModels(provider, fetch)\n} else {\n  showManualModelInput(provider)\n}","handlingStrategy":"fallback","validationCode":"if (!resolveCatalogKind(provider)) { showManualModelInput(provider); return }","typeGuard":"const supportsCatalog = (p) => resolveCatalogKind(p) !== null","tryCatchPattern":"try { models = await fetchTopRemoteModels(provider, fetch) } catch (e) { if (e.message.startsWith('Catalog not supported')) { models = [] } else throw e }","preventionTips":["Only offer 'Fetch models' for providers with a known catalog kind.","Keep resolveCatalogKind mappings in sync with new provider types.","Always provide a manual model-id fallback in the UI."],"tags":["catalog","provider","unsupported","configuration"],"backgroundTag":"unsupported-operation","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}