Mintplex-Labs/anything-llm · error

No Lemonade API Base Path was set.

Error message

No Lemonade API Base Path was set.

What it means

LemonadeLLM's constructor throws when LEMONADE_LLM_BASE_PATH is unset. Lemonade (AMD's local LLM server) is a self-hosted OpenAI-compatible endpoint with no default address; the value is normalized by parseLemonadeServerEndpoint(base, "openai") into the OpenAI-compatible route before being handed to the OpenAI SDK. The check runs eagerly at provider construction.

Solutions

  1. Start lemonade-server and verify it answers (curl http://127.0.0.1:8000/ or its documented health route).
  2. Set LEMONADE_LLM_BASE_PATH in backend .env to the server base URL, e.g. LEMONADE_LLM_BASE_PATH=http://127.0.0.1:8000.
  3. From Docker, use http://host.docker.internal:8000 or the host's LAN IP.
  4. Optionally set LEMONADE_LLM_API_KEY if the Lemonade server enforces one; then restart AnythingLLM.

Example fix

# before (.env)
LEMONADE_LLM_MODEL_PREF=Llama-3.2-1B-Instruct-Hybrid

# after (.env)
LEMONADE_LLM_BASE_PATH=http://127.0.0.1:8000
LEMONADE_LLM_MODEL_PREF=Llama-3.2-1B-Instruct-Hybrid
Defensive patterns

Strategy: validation

Validate before calling

if (!process.env.LEMONADE_LLM_BASE_PATH) throw new Error("LEMONADE_LLM_BASE_PATH missing");
try { new URL(process.env.LEMONADE_LLM_BASE_PATH); } catch { throw new Error("LEMONADE_LLM_BASE_PATH must be a valid URL"); }

Try / catch

try {
  new LemonadeLLM(embedder, model);
} catch (e) {
  if (/Lemonade API Base Path/i.test(e.message)) return promptEnvSetup("LEMONADE_LLM_BASE_PATH");
  throw e;
}

Prevention

When it happens

Trigger: Selecting Lemonade as the LLM provider while LEMONADE_LLM_BASE_PATH is missing from the server env. Typical when the lemonade-server process is not running, the port is wrong, or a Docker container tries localhost instead of host.docker.internal for the host-run Lemonade instance.

Common situations: New Lemonade/Ryzen AI installs where the user set only the model pref; Lemonade served on a non-default http://localhost:8000 variant and the var omitted anyway; Docker networking (localhost inside container ≠ host); trailing /v1 confusion — parseLemonadeServerEndpoint rewrites the path to the openai route, so supply the server root URL it expects (check its docs) rather than guessing sub-paths.

Related errors


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

Appendix: source

Thrown at server/utils/AiProviders/lemonade/index.js:15

const { NativeEmbedder } = require("../../EmbeddingEngines/native");
const {
  handleDefaultStreamResponseV2,
  formatChatHistory,
} = require("../../helpers/chat/responses");
const {
  LLMPerformanceMonitor,
} = require("../../helpers/chat/LLMPerformanceMonitor");
const { OpenAI: OpenAIApi } = require("openai");
const { humanFileSize } = require("../../helpers");

class LemonadeLLM {
  constructor(embedder = null, modelPreference = null) {
    if (!process.env.LEMONADE_LLM_BASE_PATH)
      throw new Error("No Lemonade API Base Path was set.");
    if (!process.env.LEMONADE_LLM_MODEL_PREF && !modelPreference)
      throw new Error("No Lemonade Model Pref was set.");

    this.className = "LemonadeLLM";
    this.lemonade = new OpenAIApi({
      baseURL: parseLemonadeServerEndpoint(
        process.env.LEMONADE_LLM_BASE_PATH,
        "openai"
      ),
      apiKey: process.env.LEMONADE_LLM_API_KEY || null,
    });

    this.model = modelPreference || process.env.LEMONADE_LLM_MODEL_PREF;
    this.embedder = embedder ?? new NativeEmbedder();
    this.defaultTemp = 0.7;

    // We can establish here since we cannot dynamically curl the context window limit from the API.
    this.limits = {

View on GitHub (pinned to 3aec848f28)