{"record":{"id":"3bae477508e039c5","repo":"Mintplex-Labs/anything-llm","slug":"no-lemonade-image-generation-base-path-was-set","errorCode":null,"errorMessage":"No Lemonade image generation base path was set.","messagePattern":"No Lemonade image generation base path was set\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/ImageGenerators/lemonade/index.js","lineNumber":7,"sourceCode":"const { parseLemonadeServerEndpoint } = require(\"../../AiProviders/lemonade\");\nconst { BaseImageGenerator } = require(\"../base\");\n\nclass LemonadeImageGenerator extends BaseImageGenerator {\n  constructor() {\n    if (!process.env.IMAGE_GEN_LEMONADE_BASE_PATH)\n      throw new Error(\"No Lemonade image generation base path was set.\");\n    if (!process.env.IMAGE_GEN_MODEL_PREF)\n      throw new Error(\"No Lemonade image generation model was set.\");\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    super({\n      client: new OpenAIApi({\n        baseURL: parseLemonadeServerEndpoint(\n          process.env.IMAGE_GEN_LEMONADE_BASE_PATH,\n          \"openai\"\n        ),\n        apiKey: process.env.IMAGE_GEN_LEMONADE_API_KEY || null,\n      }),\n      model: process.env.IMAGE_GEN_MODEL_PREF,\n      className: \"LemonadeImageGenerator\",\n    });\n  }\n}\n\nmodule.exports = { LemonadeImageGenerator };","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/ImageGenerators/lemonade/index.js#L1-L25","documentation":"The LemonadeImageGenerator constructor throws immediately when IMAGE_GEN_LEMONADE_BASE_PATH is unset or empty. The value is required to build the OpenAI SDK client: it is passed through parseLemonadeServerEndpoint(..., \"openai\") to derive the Lemonade server's OpenAI-compatible endpoint. Selection fails fast before any request is made.","triggerScenarios":"Choosing Lemonade as the image engine without setting IMAGE_GEN_LEMONADE_BASE_PATH; adding the env after the process started without a restart; a typo in the variable name; docker env not propagated to the container.","commonSituations":"Setting up Lemonade (AMD/NPU local server) image generation for the first time; forgetting that the image-gen base path is a separate variable from the LLM provider's base path.","solutions":["Set IMAGE_GEN_LEMONADE_BASE_PATH in .env to the Lemonade server endpoint, e.g. http://localhost:8000.","Confirm the Lemonade server is running and reachable from AnythingLLM.","Restart the server / recreate the container after saving.","Check the variable spelling and that the URL includes the scheme (http://)."],"exampleFix":"# .env — before\nIMAGE_GEN_ENGINE=lemonade\n\n# .env — after\nIMAGE_GEN_ENGINE=lemonade\nIMAGE_GEN_LEMONADE_BASE_PATH=http://localhost:8000","handlingStrategy":"validation","validationCode":"if (!process.env.IMAGE_GEN_LEMONADE_BASE_PATH) {\n  throw new Error(\n    \"Lemonade image engine selected but IMAGE_GEN_LEMONADE_BASE_PATH is missing.\"\n  );\n}\nconst { LemonadeImageGenerator } = require(\"server/utils/ImageGenerators/lemonade\");\nconst generator = new LemonadeImageGenerator();","typeGuard":"function isLemonadeImageConfigValid(env = process.env) {\n  return (\n    typeof env.IMAGE_GEN_LEMONADE_BASE_PATH === \"string\" &&\n    env.IMAGE_GEN_LEMONADE_BASE_PATH.length > 0\n  );\n}","tryCatchPattern":"try {\n  new LemonadeImageGenerator();\n} catch (err) {\n  if (err.message.includes(\"Lemonade image generation base path\")) {\n    // surface a settings error for IMAGE_GEN_LEMONADE_BASE_PATH\n  }\n}","preventionTips":["Env-check the active image engine's variables at boot.","Keep Lemonade server URL (scheme + host + port) in one place and reuse it for LLM and image settings.","Restart after every .env change."],"tags":["lemonade","image-generation","configuration","environment-variables"],"backgroundTag":"missing-env-var","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}