{"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":"Error","httpStatus":null,"severity":"warning","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/fad3f12a147d138388a66f0d92a02b2675f65294/web-app/src/containers/MlxModelDownloadAction.tsx#L110-L146","documentation":"Thrown when the HuggingFace repo resolved successfully but `repoInfo.siblings` is an empty array. The repo exists and the API call succeeded, but it contains zero files. This is the data-level counterpart to error 122 (which is the transport/null counterpart).","triggerScenarios":"`fetchHuggingFaceRepo` returns `{ siblings: [] }` — a freshly created empty model repo, a repo whose files were all LFS-pointer-only and filtered, or a repo that only contains `.gitattributes`/README at the API level.","commonSituations":"Selecting a stub/placeholder repo from the hub; a repo where all weights live under a path the API metadata excluded; the model was deleted but the card remained; typo led to a near-empty mirror repo.","solutions":["Open the repo on huggingface.co and confirm it has actual model files (`.safetensors`/`.gguf`).","If the repo is genuinely empty, surface a clearer message naming the repo so the user can pick another.","Treat siblings length 0 the same as 'not an MLX repo' and filter the hub listing upstream."],"exampleFix":"// before\nif (modelFiles.length === 0) {\n  throw new Error('No MLX model files found in repository')\n}\n\n// after\nif (modelFiles.length === 0) {\n  throw new Error(`Repository ${modelPath} has no files. It may be empty or not an MLX model.`)\n}","handlingStrategy":"validation","validationCode":"const repoInfo = await serviceHub.models().fetchHuggingFaceRepo(modelPath, huggingfaceToken)\nif (!repoInfo?.siblings || repoInfo.siblings.length === 0) {\n  toast.error('Repository has no files', { description: `${modelPath} may be empty or not an MLX model.` })\n  return\n}","typeGuard":"function repoHasFiles(repo: unknown): repo is { siblings: { rfilename: string }[] } {\n  return Array.isArray((repo as any)?.siblings) && (repo as any).siblings.length > 0\n}","tryCatchPattern":"if (!repoHasFiles(repoInfo)) {\n  toast.error('No MLX model files found', {\n    description: `Repository ${modelPath} is empty. Pick an MLX-tagged repo.`,\n  })\n  return\n}","preventionTips":["Filter the hub listing upstream to repos that actually contain files.","Surface the repo name in the empty-files message so the user can choose another."],"tags":["huggingface","mlx","validation","download"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}