{"record":{"id":"dacdf1818f9cfca4","repo":"Mintplex-Labs/anything-llm","slug":"no-lemonade-api-base-path-was-set-dacdf1","errorCode":null,"errorMessage":"No Lemonade API Base Path was set.","messagePattern":"No Lemonade API Base Path was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/EmbeddingEngines/lemonade/index.js","lineNumber":7,"sourceCode":"const { parseLemonadeServerEndpoint } = require(\"../../AiProviders/lemonade\");\nconst { toChunks, reportEmbeddingProgress } = require(\"../../helpers\");\n\nclass LemonadeEmbedder {\n  constructor() {\n    if (!process.env.EMBEDDING_BASE_PATH)\n      throw new Error(\"No Lemonade API Base Path was set.\");\n    if (!process.env.EMBEDDING_MODEL_PREF)\n      throw new Error(\"No Embedding Model Pref was set.\");\n    this.className = \"LemonadeEmbedder\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.lemonade = new OpenAIApi({\n      baseURL: parseLemonadeServerEndpoint(\n        process.env.EMBEDDING_BASE_PATH,\n        \"openai\"\n      ),\n      apiKey: process.env.LEMONADE_LLM_API_KEY || null,\n    });\n    this.model = process.env.EMBEDDING_MODEL_PREF;\n\n    this.maxConcurrentChunks = 50;\n    this.embeddingMaxChunkLength =\n      process.env.EMBEDDING_MODEL_MAX_CHUNK_LENGTH || 8_191;\n  }\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/EmbeddingEngines/lemonade/index.js#L1-L25","documentation":"Thrown by the LemonadeEmbedder constructor when EMBEDDING_BASE_PATH is unset. Lemonade (AMD's local Ryzen AI server) is addressed through its OpenAI-compatible route, which this class derives by parsing EMBEDDING_BASE_PATH with parseLemonadeServerEndpoint(..., 'openai'). Without a base path there is no server to talk to, so construction fails immediately.","triggerScenarios":"Selecting the Lemonade embedding engine in settings without providing the server URL; starting the backend with EMBEDDING_ENGINE=lemonade but no EMBEDDING_BASE_PATH; Lemonade installed but its server URL never entered; env var misspelled or set after process start.","commonSituations":"Setting up AMD Ryzen AI / Lemonade laptop workflows where the LLM provider was configured but the embedding provider was not; the Lemonade server was started later and the URL was never recorded in settings.","solutions":["Start your Lemonade server first and note its URL (default is typically http://localhost:8080 or as printed by lemonade serve)","Set EMBEDDING_BASE_PATH to that URL in the embedding settings or .env","Also set EMBEDDING_MODEL_PREF (this constructor throws separately if it is missing)","Restart the server so the constructor re-reads the environment"],"exampleFix":"# before\nEMBEDDING_ENGINE=lemonade\n\n# after\nEMBEDDING_ENGINE=lemonade\nEMBEDDING_BASE_PATH=http://localhost:8080\nEMBEDDING_MODEL_PREF=lmstudio-community/gemma-3-1b","handlingStrategy":"validation","validationCode":"function assertLemonadeEmbedderConfigured() {\n  const missing = [\"EMBEDDING_BASE_PATH\", \"EMBEDDING_MODEL_PREF\"].filter(\n    (k) => !process.env[k]\n  );\n  if (missing.length) {\n    throw new Error(`Lemonade embedder misconfigured; missing: ${missing.join(\", \")}`);\n  }\n}\nassertLemonadeEmbedderConfigured();","typeGuard":null,"tryCatchPattern":"try {\n  const embedder = new LemonadeEmbedder();\n} catch (e) {\n  if (e.message === \"No Lemonade API Base Path was set.\") {\n    // prompt for the lemonade serve URL; construction is deterministic, no retry\n  }\n  throw e;\n}","preventionTips":["Start the Lemonade server first and paste its printed URL into the embedding settings","Validate both required variables together — the constructor checks base path and model in sequence","Keep the Lemonade URL in one shared config so LLM and embedding providers never diverge"],"tags":["lemonade","amd","env-var","configuration","base-url","constructor"],"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"}