{"record":{"id":"a3458c8c790ea53f","repo":"janhq/jan","slug":"mlx-engine-not-found","errorCode":null,"errorMessage":"MLX engine not found","messagePattern":"MLX engine not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"web-app/src/containers/MlxModelDownloadAction.tsx","lineNumber":136,"sourceCode":"        .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')\n      }\n\n      const modelUrl = `https://huggingface.co/${modelPath}/resolve/main/${mainSafetensorsFile.rfilename}`\n\n      // Prepare additional files to download (all model files except main safetensors)\n      // Don't pass sha256/size to skip verification for MLX models\n      const extraFiles = modelFiles\n        .filter((f) => f.rfilename !== mainSafetensorsFile.rfilename)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/web-app/src/containers/MlxModelDownloadAction.tsx#L118-L154","documentation":"Thrown when EngineManager.instance().get('mlx') returns no engine, meaning the MLX extension is not installed, not registered, or not yet initialized. The MLX download/import flow requires the engine to hand off file downloads, so it fails fast.","triggerScenarios":"Calling the MLX model download action while the 'mlx' engine is absent from the EngineManager — e.g. the MLX extension is disabled, failed to load, is still initializing, or the app build does not bundle it.","commonSituations":"User uninstalled or disabled the MLX extension; the extension crashed during startup; attempting MLX import on a platform where MLX is not supported; calling the action before engine registration completes.","solutions":["Install or re-enable the MLX extension (jan-mlx-extension) in Settings > Extensions","Restart the app so engines re-register with the EngineManager","Wait for extension initialization to finish before retrying the import","Confirm your platform supports MLX (Apple Silicon / macOS) or use the llama.cpp provider instead"],"exampleFix":"// before\nconst engine = EngineManager.instance().get('mlx')\nif (!engine) throw new Error('MLX engine not found')\n// after\nconst engine = EngineManager.instance().get('mlx')\nif (!engine) {\n  window.toast?.error('The MLX extension is not active. Enable it in Settings > Extensions and retry.')\n  return\n}","handlingStrategy":"fallback","validationCode":"const mlxEngine = EngineManager.instance().get('mlx')\nif (!mlxEngine) {\n  showToast('The MLX extension is not active. Enable it in Settings > Extensions.')\n  return\n}","typeGuard":"const isMlxEngineAvailable = (): boolean =>\n  !!EngineManager.instance().get('mlx')","tryCatchPattern":"try {\n  await runMlxDownload(modelPath)\n} catch (e) {\n  if (e.message === 'MLX engine not found') {\n    openExtensionsSettings('mlx')\n  }\n}","preventionTips":["Gate MLX-specific UI behind engine availability checks","Show extension install prompts when the engine is missing","Verify extension health after app startup","Hide MLX import options on unsupported platforms"],"tags":["extension","engine","dependency"],"backgroundTag":"missing-dependency","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"}