{"record":{"id":"5828be3688532a73","repo":"janhq/jan","slug":"no-mlx-model-files-found-in-repository","errorCode":null,"errorMessage":"No MLX model files found in repository","messagePattern":"No MLX model files found in repository","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"web-app/src/containers/MlxModelDownloadAction.tsx","lineNumber":128,"sourceCode":"  const handleDownloadMlxModel = useCallback(async () => {\n    addLocalDownloadingModel(modelId)\n\n    const modelPath = `${model.developer}/${modelName}`\n    try {\n      // Fetch repository info to get all files\n      const repoInfo = await serviceHub\n        .models()\n        .fetchHuggingFaceRepo(modelPath, huggingfaceToken)\n\n      if (!repoInfo || !repoInfo.siblings) {\n        throw new Error('Failed to fetch repository files')\n      }\n\n      // Filter relevant model files for MLX\n      const modelFiles = repoInfo.siblings\n\n      if (modelFiles.length === 0) {\n        throw new Error('No MLX model files found in repository')\n      }\n\n      // Get the MLX engine and import\n      const engine = EngineManager.instance().get(\n        'mlx'\n      )\n      if (!engine) {\n        throw new Error('MLX engine not found')\n      }\n\n      // For MLX, we download the first safetensors file as the main model\n      // and the extension will download all related files\n      const mainSafetensorsFile = modelFiles.find((f) =>\n        f.rfilename.toLowerCase().endsWith('.safetensors')\n      )\n\n      if (!mainSafetensorsFile) {\n        throw new Error('No safetensors file found in repository')","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/web-app/src/containers/MlxModelDownloadAction.tsx#L110-L146","documentation":"Thrown when the Hugging Face repo was fetched successfully but its `siblings` list is empty, meaning the repository contains no files at all. The MLX import flow needs at least one file (a .safetensors) to download, so it aborts.","triggerScenarios":"fetchHuggingFaceRepo returns a repo object whose siblings array has length 0 — typically an empty repository, or an API response where file listings were filtered out.","commonSituations":"Pointing the import at an empty placeholder repo on Hugging Face, or a repo where the API listing returned no entries due to a malformed/edge-case repo state.","solutions":["Confirm the repository actually contains model files by opening it on huggingface.co","Use a different, non-empty repo id for the MLX import","Re-check the modelPath for typos that might resolve to a different (empty) repo"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (Array.isArray(repoInfo?.siblings) && repoInfo.siblings.length === 0) {\n  showToast('This repository is empty; pick a repo containing model files.')\n  return\n}","typeGuard":"const isNonEmptyRepo = (r: unknown): r is { siblings: unknown[] } =>\n  !!r && typeof r === 'object' && Array.isArray((r as any).siblings) && (r as any).siblings.length > 0","tryCatchPattern":"try {\n  await startMlxImport(modelPath)\n} catch (e) {\n  if (e.message === 'No MLX model files found in repository') {\n    showToast('Repository has no files. Choose a repo with model weights.')\n  }\n}","preventionTips":["Preview the repo on huggingface.co before importing","Reject empty repos early in the import UI","Distinguish empty-repo errors from fetch failures in user messaging"],"tags":["huggingface","validation","empty-result"],"backgroundTag":"empty-result-set","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"}