Mintplex-Labs/anything-llm · error · Error

An error occurred while uninstalling the model

Error message

An error occurred while uninstalling the model

What it means

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'.

Source

Thrown at frontend/src/components/LLMSelection/LemonadeOptions/index.jsx:272

    setFilteredModels(Array.from(filteredModels.values()));
  }, [searchQuery]);

  async function uninstallModel(modelId) {
    try {
      if (
        !window.confirm(
          `Are you sure you want to uninstall this model? You will need to download it again to use it.`
        )
      )
        return;
      const { success, error } = await LemonadeUtils.deleteModel(
        modelId,
        basePath
      );

      if (!success)
        throw new Error(
          error || "An error occurred while uninstalling the model"
        );

      const updatedModels = customModels.map((model) =>
        model.id === modelId ? { ...model, downloaded: false } : model
      );
      setCustomModels(updatedModels);
      setFilteredModels(updatedModels);
      setSearchQuery("");
    } catch (e) {
      console.error("Error uninstalling model:", e);
      showToast(
        e.message || "An error occurred while uninstalling the model",
        "error",
        { clear: true }
      );
    } finally {
      setLoading(false);

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Confirm the Lemonade server is running and reachable, then retry
  2. Refresh the model list — the id may already be gone (treat as success)
  3. Check the browser console/network tab for the DELETE request's status code and body
  4. Update Lemonade to a version whose API supports model deletion
Defensive patterns

Strategy: try-catch

Validate before calling

const serverUp = await LemonadeUtils.healthCheck?.();
const stillInstalled = customModels.some((m) => m.id === modelId && m.downloaded);
if (!serverUp || !stillInstalled) return; // nothing actionable — refresh list instead

Try / catch

catch (e) {
  console.error("Error uninstalling model:", e);
  showToast(e.message, "error", { clear: true });
  if (/not found|404/i.test(e.message)) markModelNotDownloaded(modelId); // idempotent outcome
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/dac546710c4e64e5. Report an issue: GitHub.