Mintplex-Labs/anything-llm · critical · Error

No Lemonade image generation base path was set.

Error message

No Lemonade image generation base path was set.

What it means

Thrown synchronously in the LemonadeImageGenerator constructor before building the OpenAI client. IMAGE_GEN_LEMONADE_BASE_PATH is required because parseLemonadeServerEndpoint needs it to derive the OpenAI-compatible baseURL. It is a hard config precondition: without a base path there is no endpoint to talk to.

Source

Thrown at server/utils/ImageGenerators/lemonade/index.js:7

const { parseLemonadeServerEndpoint } = require("../../AiProviders/lemonade");
const { BaseImageGenerator } = require("../base");

class LemonadeImageGenerator extends BaseImageGenerator {
  constructor() {
    if (!process.env.IMAGE_GEN_LEMONADE_BASE_PATH)
      throw new Error("No Lemonade image generation base path was set.");
    if (!process.env.IMAGE_GEN_MODEL_PREF)
      throw new Error("No Lemonade image generation model was set.");
    const { OpenAI: OpenAIApi } = require("openai");
    super({
      client: new OpenAIApi({
        baseURL: parseLemonadeServerEndpoint(
          process.env.IMAGE_GEN_LEMONADE_BASE_PATH,
          "openai"
        ),
        apiKey: process.env.IMAGE_GEN_LEMONADE_API_KEY || null,
      }),
      model: process.env.IMAGE_GEN_MODEL_PREF,
      className: "LemonadeImageGenerator",
    });
  }
}

module.exports = { LemonadeImageGenerator };

View on GitHub (pinned to 526360e320)

Solutions

  1. Set IMAGE_GEN_LEMONADE_BASE_PATH to your Lemonade server URL (e.g. http://localhost:8000) in .env.
  2. Restart the server after setting the variable.
  3. If containerized, pass the variable via -e IMAGE_GEN_LEMONADE_BASE_PATH=... or compose env_file.
  4. Use the exact variable name IMAGE_GEN_LEMONADE_BASE_PATH.

Example fix

# before
IMAGE_GEN_PROVIDER=lemonade
# (no base path)

# after
IMAGE_GEN_PROVIDER=lemonade
IMAGE_GEN_LEMONADE_BASE_PATH=http://localhost:8000
Defensive patterns

Strategy: validation

Validate before calling

function hasLemonadeBasePath() {
  return typeof process.env.IMAGE_GEN_LEMONADE_BASE_PATH === 'string'
    && process.env.IMAGE_GEN_LEMONADE_BASE_PATH.trim().length > 0;
}
if (!hasLemonadeBasePath()) {
  throw new Error('Set IMAGE_GEN_LEMONADE_BASE_PATH before using Lemonade image generation.');
}

Type guard

function isLemonadeConfigured() {
  return !!process.env.IMAGE_GEN_LEMONADE_BASE_PATH && process.env.IMAGE_GEN_LEMONADE_BASE_PATH.trim().length > 0;
}

Try / catch

let generator;
try {
  generator = new LemonadeImageGenerator();
} catch (e) {
  if (/No Lemonade image generation base path/.test(e.message)) {
    throw new Error('Configure IMAGE_GEN_LEMONADE_BASE_PATH in .env and restart.');
  }
  throw e;
}

Prevention

When it happens

Trigger: Instantiating new LemonadeImageGenerator() (selecting Lemonade as the image provider) when process.env.IMAGE_GEN_LEMONADE_BASE_PATH is unset or empty.

Common situations: Selecting Lemonade as the image-generation engine without configuring its server address; .env missing the variable after a provider switch; running in a container without passing the env var; typo in the variable name (e.g. LEMONADE_BASE_PATH).

Related errors


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