Mintplex-Labs/anything-llm · error · Error

Your Ollama instance could not be reached or is not…

Error message

Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM.

What it means

Error "Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM." thrown in Mintplex-Labs/anything-llm.

Solutions

  1. Start the Ollama server (ollama serve).
  2. Verify the base path and port in AnythingLLM settings.
  3. Check firewall rules blocking the Ollama port.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown when a request to the Ollama API fails to connect.

Common situations: Ollama not running or wrong connection information.


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

Appendix: source

Thrown at server/utils/AiProviders/ollama/index.js:236

   * @param {{userPrompt:string, attachments: import("../../helpers").Attachment[]}}
   * @returns {{content: string, images: string[]}}
   */
  #generateContent({ userPrompt, attachments = [] }) {
    if (!attachments.length) return { content: userPrompt };
    const images = attachments.map(
      (attachment) => attachment.contentString.split("base64,").slice(-1)[0]
    );
    return { content: userPrompt, images };
  }

  /**
   * Handles errors from the Ollama API to make them more user friendly.
   * @param {Error} e
   */
  #errorHandler(e) {
    switch (e.message) {
      case "fetch failed":
        throw new Error(
          "Your Ollama instance could not be reached or is not responding. Please make sure it is running the API server and your connection information is correct in AnythingLLM."
        );
      default:
        return e;
    }
  }

  /**
   * Construct the user prompt for this model.
   * @param {{attachments: import("../../helpers").Attachment[]}} param0
   * @returns
   */
  constructPrompt({
    systemPrompt = "",
    contextTexts = [],
    chatHistory = [],
    userPrompt = "",
    attachments = [],

View on GitHub (pinned to 3aec848f28)