{"record":{"id":"e3bc824115df2cb1","repo":"Mintplex-Labs/anything-llm","slug":"textgenwebui-must-have-a-valid-base-path-to-use-fo","errorCode":null,"errorMessage":"TextGenWebUI must have a valid base path to use for the api.","messagePattern":"TextGenWebUI must have a valid base path to use for the api\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/textGenWebUI/index.js","lineNumber":14,"sourceCode":"const { NativeEmbedder } = require(\"../../EmbeddingEngines/native\");\nconst {\n  handleDefaultStreamResponseV2,\n  formatChatHistory,\n} = require(\"../../helpers/chat/responses\");\nconst {\n  LLMPerformanceMonitor,\n} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\n\nclass TextGenWebUILLM {\n  constructor(embedder = null) {\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    if (!process.env.TEXT_GEN_WEB_UI_BASE_PATH)\n      throw new Error(\n        \"TextGenWebUI must have a valid base path to use for the api.\"\n      );\n\n    this.className = \"TextGenWebUILLM\";\n    this.basePath = process.env.TEXT_GEN_WEB_UI_BASE_PATH;\n    this.openai = new OpenAIApi({\n      baseURL: this.basePath,\n      apiKey: process.env.TEXT_GEN_WEB_UI_API_KEY ?? null,\n    });\n    this.model = null;\n    this.limits = {\n      history: this.promptWindowLimit() * 0.15,\n      system: this.promptWindowLimit() * 0.15,\n      user: this.promptWindowLimit() * 0.7,\n    };\n\n    this.embedder = embedder ?? new NativeEmbedder();\n    this.defaultTemp = 0.7;","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/AiProviders/textGenWebUI/index.js#L1-L32","documentation":"Configuration guard thrown by the TextGenWebUILLM constructor: TEXT_GEN_WEB_UI_BASE_PATH is empty/unset, so the adapter has no URL for the local text-generation-webui API server and the OpenAI-compatible client cannot be initialized.","triggerScenarios":"Thrown at provider construction when no base path is configured.","commonSituations":"TextGenWebUI selected without a base path.","solutions":["Set the TextGenWebUI base path in provider settings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}