{"record":{"id":"bf580ff8c21fca31","repo":"Mintplex-Labs/anything-llm","slug":"no-lemonade-base-path-was-set","errorCode":null,"errorMessage":"No Lemonade base path was set.","messagePattern":"No Lemonade base path was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/SpeechToText/lemonade/index.js","lineNumber":8,"sourceCode":"const path = require(\"path\");\nconst { parseLemonadeServerEndpoint } = require(\"../../AiProviders/lemonade\");\nconst { convertAudioBufferToWav } = require(\"../helpers\");\n\nclass LemonadeSTT {\n  constructor() {\n    if (!process.env.STT_LEMONADE_BASE_PATH)\n      throw new Error(\"No Lemonade base path was set.\");\n\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.openai = new OpenAIApi({\n      baseURL: parseLemonadeServerEndpoint(\n        process.env.STT_LEMONADE_BASE_PATH,\n        \"openai\"\n      ),\n      apiKey: process.env.LEMONADE_LLM_API_KEY || null,\n    });\n    this.model = process.env.STT_LEMONADE_MODEL_PREF ?? \"whisper-1\";\n    this.#log(\n      `Service (${process.env.STT_LEMONADE_BASE_PATH}) with model: ${this.model}`\n    );\n  }\n\n  #log(text, ...args) {\n    console.log(`\\x1b[32m[LemonadeSTT]\\x1b[0m ${text}`, ...args);\n  }","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/SpeechToText/lemonade/index.js#L1-L26","documentation":"LemonadeSTT's constructor throws when process.env.STT_LEMONADE_BASE_PATH is unset or empty. The base path is needed to derive the OpenAI-compatible endpoint (via parseLemonadeServerEndpoint(..., 'openai')) for the local Lemonade server that runs the whisper.cpp-backed STT model (default whisper-1).","triggerScenarios":"STT_PROVIDER=lemonade configured but STT_LEMONADE_BASE_PATH never set; variable present only on the machine running the Lemonade server, not the AnythingLLM server; .env edited after process start.","commonSituations":"Lemonade installed and running locally (e.g. http://localhost:8000) but the integration env never added; Docker deployments where localhost would point inside the container instead of the host; values missing the scheme so later endpoint parsing misbehaves.","solutions":["Add STT_LEMONADE_BASE_PATH=<lemonade-url> (e.g. http://localhost:8000) to .env and restart","Optionally set STT_LEMONADE_MODEL_PREF (defaults to whisper-1) and LEMONADE_LLM_API_KEY if the server requires auth","In Docker, point at the host running Lemonade (host.docker.internal or the service name), not localhost","Verify the Lemonade server is up before restarting the app"],"exampleFix":"# before (.env)\nSTT_PROVIDER=lemonade\n\n# after (.env)\nSTT_PROVIDER=lemonade\nSTT_LEMONADE_BASE_PATH=http://localhost:8000","handlingStrategy":"validation","validationCode":"if (process.env.STT_PROVIDER === 'lemonade' && !process.env.STT_LEMONADE_BASE_PATH) {\n  throw new Error('STT_PROVIDER=lemonade requires STT_LEMONADE_BASE_PATH (e.g. http://localhost:8000)');\n}","typeGuard":null,"tryCatchPattern":"try {\n  stt = new LemonadeSTT();\n} catch (err) {\n  if (err.message === 'No Lemonade base path was set.') {\n    // prompt for the Lemonade server URL before retrying\n  }\n  throw err;\n}","preventionTips":["Set STT_LEMONADE_BASE_PATH whenever STT_PROVIDER=lemonade is enabled","In Docker, target the host/service running Lemonade, not localhost inside the container","Validate provider env pairs in a boot-time dependency check"],"tags":["lemonade","speech-to-text","environment-variable","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"}