{"record":{"id":"8e99aa574d6f486b","repo":"Mintplex-Labs/anything-llm","slug":"no-lemonade-api-base-path-was-set","errorCode":null,"errorMessage":"No Lemonade API Base Path was set.","messagePattern":"No Lemonade API Base Path was set\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/lemonade/index.js","lineNumber":15,"sourceCode":"const { NativeEmbedder } = require(\"../../EmbeddingEngines/native\");\nconst {\n  handleDefaultStreamResponseV2,\n  formatChatHistory,\n} = require(\"../../helpers/chat/responses\");\nconst {\n  LLMPerformanceMonitor,\n} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\nconst { OpenAI: OpenAIApi } = require(\"openai\");\nconst { humanFileSize } = require(\"../../helpers\");\n\nclass LemonadeLLM {\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.LEMONADE_LLM_BASE_PATH)\n      throw new Error(\"No Lemonade API Base Path was set.\");\n    if (!process.env.LEMONADE_LLM_MODEL_PREF && !modelPreference)\n      throw new Error(\"No Lemonade Model Pref was set.\");\n\n    this.className = \"LemonadeLLM\";\n    this.lemonade = new OpenAIApi({\n      baseURL: parseLemonadeServerEndpoint(\n        process.env.LEMONADE_LLM_BASE_PATH,\n        \"openai\"\n      ),\n      apiKey: process.env.LEMONADE_LLM_API_KEY || null,\n    });\n\n    this.model = modelPreference || process.env.LEMONADE_LLM_MODEL_PREF;\n    this.embedder = embedder ?? new NativeEmbedder();\n    this.defaultTemp = 0.7;\n\n    // We can establish here since we cannot dynamically curl the context window limit from the API.\n    this.limits = {","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/AiProviders/lemonade/index.js#L1-L33","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Start lemonade-server and verify it answers (curl http://127.0.0.1:8000/ or its documented health route).","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.","From Docker, use http://host.docker.internal:8000 or the host's LAN IP.","Optionally set LEMONADE_LLM_API_KEY if the Lemonade server enforces one; then restart AnythingLLM."],"exampleFix":"# before (.env)\nLEMONADE_LLM_MODEL_PREF=Llama-3.2-1B-Instruct-Hybrid\n\n# after (.env)\nLEMONADE_LLM_BASE_PATH=http://127.0.0.1:8000\nLEMONADE_LLM_MODEL_PREF=Llama-3.2-1B-Instruct-Hybrid","handlingStrategy":"validation","validationCode":"if (!process.env.LEMONADE_LLM_BASE_PATH) throw new Error(\"LEMONADE_LLM_BASE_PATH missing\");\ntry { new URL(process.env.LEMONADE_LLM_BASE_PATH); } catch { throw new Error(\"LEMONADE_LLM_BASE_PATH must be a valid URL\"); }","typeGuard":null,"tryCatchPattern":"try {\n  new LemonadeLLM(embedder, model);\n} catch (e) {\n  if (/Lemonade API Base Path/i.test(e.message)) return promptEnvSetup(\"LEMONADE_LLM_BASE_PATH\");\n  throw e;\n}","preventionTips":["Start lemonade-server and curl its endpoint before switching the provider.","Configure LEMONADE_LLM_BASE_PATH and LEMONADE_LLM_MODEL_PREF together in .env.","Docker: reference the host via host.docker.internal, not localhost."],"tags":["lemonade","amd-ryzen-ai","anythingllm","local-llm","env-var","base-url","configuration"],"backgroundTag":"missing-base-url","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"}