{"record":{"id":"dac546710c4e64e5","repo":"Mintplex-Labs/anything-llm","slug":"an-error-occurred-while-uninstalling-the-model","errorCode":null,"errorMessage":"An error occurred while uninstalling the model","messagePattern":"An error occurred while uninstalling the model","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/components/LLMSelection/LemonadeOptions/index.jsx","lineNumber":272,"sourceCode":"\n    setFilteredModels(Array.from(filteredModels.values()));\n  }, [searchQuery]);\n\n  async function uninstallModel(modelId) {\n    try {\n      if (\n        !window.confirm(\n          `Are you sure you want to uninstall this model? You will need to download it again to use it.`\n        )\n      )\n        return;\n      const { success, error } = await LemonadeUtils.deleteModel(\n        modelId,\n        basePath\n      );\n\n      if (!success)\n        throw new Error(\n          error || \"An error occurred while uninstalling the model\"\n        );\n\n      const updatedModels = customModels.map((model) =>\n        model.id === modelId ? { ...model, downloaded: false } : model\n      );\n      setCustomModels(updatedModels);\n      setFilteredModels(updatedModels);\n      setSearchQuery(\"\");\n    } catch (e) {\n      console.error(\"Error uninstalling model:\", e);\n      showToast(\n        e.message || \"An error occurred while uninstalling the model\",\n        \"error\",\n        { clear: true }\n      );\n    } finally {\n      setLoading(false);","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/components/LLMSelection/LemonadeOptions/index.jsx#L254-L290","documentation":"Lemonade (AMD local LLM server) model uninstall UI. After a confirm dialog, LemonadeUtils.deleteModel(modelId, basePath) is called; a success:false result throws the util's error text or this generic fallback, and the catch toasts 'Error uninstalling model'.","triggerScenarios":"Lemonade server not running (default local port unreachable); modelId not actually downloaded locally; basePath invalid; the delete API returned an error status; Lemonade version lacking the delete endpoint.","commonSituations":"Lemonade stopped between listing and uninstalling; model already removed manually via CLI so the id is stale; version mismatch between the UI expectations and the installed Lemonade server; localhost server blocked by browser mixed-content rules.","solutions":["Confirm the Lemonade server is running and reachable, then retry","Refresh the model list — the id may already be gone (treat as success)","Check the browser console/network tab for the DELETE request's status code and body","Update Lemonade to a version whose API supports model deletion"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const serverUp = await LemonadeUtils.healthCheck?.();\nconst stillInstalled = customModels.some((m) => m.id === modelId && m.downloaded);\nif (!serverUp || !stillInstalled) return; // nothing actionable — refresh list instead","typeGuard":null,"tryCatchPattern":"catch (e) {\n  console.error(\"Error uninstalling model:\", e);\n  showToast(e.message, \"error\", { clear: true });\n  if (/not found|404/i.test(e.message)) markModelNotDownloaded(modelId); // idempotent outcome\n}","preventionTips":["Treat 'model not found' during uninstall as success and refresh the list — deletes should be idempotent","Confirm the Lemonade server is reachable before rendering uninstall actions","Refresh the model list on modal open so stale ids are not acted upon"],"tags":["lemonade","llm","model-management","uninstall","frontend"],"backgroundTag":"model-delete-failed","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T11:17:13.642Z"}