Mintplex-Labs/anything-llm · critical · Error

No Lemonade API Base Path was set.

Error message

No Lemonade API Base Path was set.

What it means

Thrown by the LemonadeLLM constructor when the LEMONADE_LLM_BASE_PATH environment variable is not set. Unlike some providers, the base path has no constructor-parameter fallback — it must come from the environment. The Lemonade server URL is then parsed through parseLemonadeServerEndpoint to construct the OpenAI-compatible /api/v1 endpoint.

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 526360e320)

Solutions

  1. Set LEMONADE_LLM_BASE_PATH in .env to your Lemonade server's root URL (e.g. 'http://127.0.0.1:8000') and restart.
  2. Verify the Lemonade server is running at that address by hitting its /live or /api/v1/models endpoint.
  3. Ensure the .env file is in the correct location (server root or project root depending on deployment) and is loaded by the process.

Example fix

// before: .env
# LEMONADE_LLM_BASE_PATH='http://127.0.0.1:8000'

// after
LEMONADE_LLM_BASE_PATH='http://127.0.0.1:8000'
Defensive patterns

Strategy: validation

Validate before calling

function validateLemonadeConfig() {
  if (!process.env.LEMONADE_LLM_BASE_PATH) {
    throw new Error(
      'LEMONADE_LLM_BASE_PATH is not set. Configure it in .env (e.g. http://127.0.0.1:8000).'
    );
  }
  return process.env.LEMONADE_LLM_BASE_PATH;
}

// Call at startup or before provider instantiation:
validateLemonadeConfig();

Try / catch

try {
  const llm = new LemonadeLLM(embedder, model);
} catch (e) {
  if (e.message.includes('Base Path')) {
    console.error('Configure LEMONADE_LLM_BASE_PATH in .env before using the Lemonade provider.');
    return null;
  }
  throw e;
}

Prevention

When it happens

Trigger: Instantiating `new LemonadeLLM(embedder, model)` (via getLLMProvider('lemonade')) when process.env.LEMONADE_LLM_BASE_PATH is undefined or empty. The check is `if (!process.env.LEMONADE_LLM_BASE_PATH)`, so an empty string also triggers it.

Common situations: The 'lemonade' provider was selected in system or workspace LLM settings but the .env file was never configured with LEMONADE_LLM_BASE_PATH. A fresh deployment that copied .env.example (where the variable is commented out) without uncommenting and filling it.

Related errors


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