{"record":{"id":"1ca94495a16b4a0d","repo":"Mintplex-Labs/anything-llm","slug":"lmstudio-base-path-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"LMStudio base path must be provided to use agents.","messagePattern":"LMStudio base path must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":140,"sourceCode":"    } catch (e) {\n      this.log(\"Error loading chat history\", e.message);\n      return [];\n    }\n  }\n\n  checkSetup() {\n    switch (this.provider) {\n      case \"openai\":\n        if (!process.env.OPEN_AI_KEY)\n          throw new Error(\"OpenAI API key must be provided to use agents.\");\n        break;\n      case \"anthropic\":\n        if (!process.env.ANTHROPIC_API_KEY)\n          throw new Error(\"Anthropic API key must be provided to use agents.\");\n        break;\n      case \"lmstudio\":\n        if (!process.env.LMSTUDIO_BASE_PATH)\n          throw new Error(\"LMStudio base path must be provided to use agents.\");\n        break;\n      case \"ollama\":\n        if (!process.env.OLLAMA_BASE_PATH)\n          throw new Error(\"Ollama base path must be provided to use agents.\");\n        break;\n      case \"groq\":\n        if (!process.env.GROQ_API_KEY)\n          throw new Error(\"Groq API key must be provided to use agents.\");\n        break;\n      case \"togetherai\":\n        if (!process.env.TOGETHER_AI_API_KEY)\n          throw new Error(\"TogetherAI API key must be provided to use agents.\");\n        break;\n      case \"azure\":\n        if (!process.env.AZURE_OPENAI_ENDPOINT || !process.env.AZURE_OPENAI_KEY)\n          throw new Error(\n            \"Azure OpenAI API endpoint and key must be provided to use agents.\"\n          );","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/20f6d3546c1938bfea1ad304f58a592dddcc5948/server/utils/agents/index.js#L122-L158","documentation":"Setup guard in checkSetup(): provider is 'lmstudio' but LMSTUDIO_BASE_PATH is unset, so there is no local LMStudio server endpoint to send completions to. Fail-fast configuration check — no network call has been made yet.","triggerScenarios":"LMStudio was selected as the agent provider but no base path is configured.","commonSituations":"This error is raised at runtime in server/utils/agents/index.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.","solutions":["Set the LMSTUDIO_BASE_PATH environment variable to the LMStudio server URL.","Start LMStudio with its local server enabled."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"20f6d3546c1938bfea1ad304f58a592dddcc5948","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}