{"record":{"id":"4278b4ad48c9d574","repo":"janhq/jan","slug":"mlx-engine-not-found-4278b4","errorCode":null,"errorMessage":"MLX engine not found","messagePattern":"MLX engine not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web-app/src/containers/dialogs/ImportMlxModelDialog.tsx","lineNumber":94,"sourceCode":"      (model) => model.id === modelName\n    )\n\n    if (modelExists) {\n      toast.error('Model already exists', {\n        description: `${modelName} already imported`,\n      })\n      return\n    }\n\n    setImporting(true)\n\n    try {\n      console.log('[MLX Import] Starting import:', { modelName, selectedPath })\n\n      // Get the MLX engine and call its import method\n      const engine = ExtensionManager.getInstance().getEngine('mlx')\n      if (!engine) {\n        throw new Error('MLX engine not found')\n      }\n\n      console.log('[MLX Import] Calling engine.import()...')\n      await engine.import(modelName, {\n        modelPath: selectedPath,\n      })\n      console.log('[MLX Import] Import completed')\n\n      toast.success('Model imported successfully', {\n        description: `${modelName} has been imported`,\n      })\n\n      // Reset form and close dialog\n      setSelectedPath(null)\n      setModelName('')\n      setOpen(false)\n      onSuccess?.(modelName)\n    } catch (error) {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/web-app/src/containers/dialogs/ImportMlxModelDialog.tsx#L76-L112","documentation":"Thrown in the local MLX import dialog when `ExtensionManager.getInstance().getEngine('mlx')` returns null before calling `engine.import(modelName, { modelPath })`. Same root cause as error 124 but in the manual import path (importing a model already on disk) rather than the hub download path.","triggerScenarios":"User opens Import MLX Model dialog, enters a name and picks a local path, clicks Import, but the MLX extension/engine is not registered. Non-Apple-Silicon platform, disabled extension, or engine key mismatch.","commonSituations":"Running on Linux/Windows where MLX is unavailable; MLX extension disabled after a crash; the dialog is reachable even though the engine is missing (no upstream guard).","solutions":["Run on Apple Silicon macOS with the MLX extension enabled.","Re-enable/reinstall the MLX extension and restart.","Hide or disable the Import MLX menu entry when `getEngine('mlx')` is null."],"exampleFix":"// before\nconst engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine) {\n  throw new Error('MLX engine not found')\n}\n\n// after\nconst engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine) {\n  throw new Error(\n    'MLX engine not found. Enable the MLX extension (Apple Silicon required) and retry.'\n  )\n}","handlingStrategy":"type-guard","validationCode":"const engine = ExtensionManager.getInstance().getEngine('mlx')\nif (!engine) {\n  toast.error('MLX unavailable', { description: 'Enable the MLX extension (Apple Silicon) and retry.' })\n  return\n}","typeGuard":"function isMlxImportEngine(e: unknown): e is { import(name: string, opts: { modelPath: string }): Promise<void> } {\n  return !!e && typeof (e as any).import === 'function'\n}","tryCatchPattern":"try {\n  const engine = ExtensionManager.getInstance().getEngine('mlx')\n  if (!isMlxImportEngine(engine)) {\n    toast.error('MLX engine not found', { description: 'Apple Silicon + MLX extension required.' })\n    return\n  }\n  await engine.import(modelName, { modelPath: selectedPath })\n} catch (error) {\n  toast.error('Failed to import model', { description: error instanceof Error ? error.message : String(error) })\n}","preventionTips":["Hide the Import MLX dialog trigger when the engine is absent.","Gate to Apple Silicon at the route/menu level."],"tags":["mlx","engine","extension","import"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}