{"record":{"id":"3586982643a3a5df","repo":"Mintplex-Labs/anything-llm","slug":"no-embedding-base-path-was-set","errorCode":null,"errorMessage":"No embedding base path was set.","messagePattern":"No embedding base path was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/EmbeddingEngines/lmstudio/index.js","lineNumber":10,"sourceCode":"const { parseLMStudioBasePath } = require(\"../../AiProviders/lmStudio\");\nconst {\n  maximumChunkLength,\n  reportEmbeddingProgress,\n} = require(\"../../helpers\");\n\nclass LMStudioEmbedder {\n  constructor() {\n    if (!process.env.EMBEDDING_BASE_PATH)\n      throw new Error(\"No embedding base path was set.\");\n    if (!process.env.EMBEDDING_MODEL_PREF)\n      throw new Error(\"No embedding model was set.\");\n\n    const apiKey = process.env.LMSTUDIO_AUTH_TOKEN ?? null;\n    this.className = \"LMStudioEmbedder\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.lmstudio = new OpenAIApi({\n      baseURL: parseLMStudioBasePath(process.env.EMBEDDING_BASE_PATH),\n      apiKey,\n    });\n    this.model = process.env.EMBEDDING_MODEL_PREF;\n\n    // Limit of how many strings we can process in a single pass to stay with resource or network limits\n    this.maxConcurrentChunks = 1;\n    this.embeddingMaxChunkLength = maximumChunkLength();\n  }\n\n  log(text, ...args) {","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/EmbeddingEngines/lmstudio/index.js#L1-L28","documentation":"Thrown by the LMStudioEmbedder constructor when EMBEDDING_BASE_PATH is unset. The path is normalized through parseLMStudioBasePath and handed to the OpenAI SDK as baseURL for LM Studio's local OpenAI-compatible server. Without it the embedder cannot know where your LM Studio instance listens (default http://localhost:1234).","triggerScenarios":"Selecting LMStudio as the embedding engine without filling the base path; EMBEDDING_ENGINE=lmstudio set in env but EMBEDDING_BASE_PATH missing; LM Studio started on a non-default port that was never recorded; variable set only inside the container while the process reads another environment.","commonSituations":"Local-only setups using LM Studio's local server; port changed from 1234 in LM Studio settings and the field left stale or empty.","solutions":["In LM Studio, start the server (Developer tab) and confirm the port (default 1234)","Set EMBEDDING_BASE_PATH to that address, e.g. http://localhost:1234/v1","Also set EMBEDDING_MODEL_PREF — this constructor throws separately if it is missing","Restart the backend after saving"],"exampleFix":"# before\nEMBEDDING_ENGINE=lmstudio\n\n# after\nEMBEDDING_ENGINE=lmstudio\nEMBEDDING_BASE_PATH=http://localhost:1234/v1\nEMBEDDING_MODEL_PREF=text-embedding-nomic-embed-text-v1.5","handlingStrategy":"validation","validationCode":"function assertLMStudioEmbedderConfigured() {\n  const missing = [\"EMBEDDING_BASE_PATH\", \"EMBEDDING_MODEL_PREF\"].filter(\n    (k) => !process.env[k]\n  );\n  if (missing.length) {\n    throw new Error(`LMStudio embedder misconfigured; missing: ${missing.join(\", \")}`);\n  }\n}\nassertLMStudioEmbedderConfigured();","typeGuard":null,"tryCatchPattern":"try {\n  const embedder = new LMStudioEmbedder();\n} catch (e) {\n  if (e.message === \"No embedding base path was set.\") {\n    // default hint: http://localhost:1234/v1 — start LM Studio's server first\n  }\n  throw e;\n}","preventionTips":["Make LM Studio's server startup part of the runbook; its default URL is http://localhost:1234/v1","Save both URL and model in one settings pass — the constructor enforces them in order","If the port changes in LM Studio settings, update EMBEDDING_BASE_PATH in the same sitting"],"tags":["lmstudio","local-server","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"}