Mintplex-Labs/anything-llm · error · Error

TextGenWebUI must have a valid base path to use for the api.

Error message

TextGenWebUI must have a valid base path to use for the api.

What it means

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.

Solutions

  1. Set the TextGenWebUI base path in provider settings.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at provider construction when no base path is configured.

Common situations: TextGenWebUI selected without a base path.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/e3bc824115df2cb1. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/AiProviders/textGenWebUI/index.js:14

const { NativeEmbedder } = require("../../EmbeddingEngines/native");
const {
  handleDefaultStreamResponseV2,
  formatChatHistory,
} = require("../../helpers/chat/responses");
const {
  LLMPerformanceMonitor,
} = require("../../helpers/chat/LLMPerformanceMonitor");

class TextGenWebUILLM {
  constructor(embedder = null) {
    const { OpenAI: OpenAIApi } = require("openai");
    if (!process.env.TEXT_GEN_WEB_UI_BASE_PATH)
      throw new Error(
        "TextGenWebUI must have a valid base path to use for the api."
      );

    this.className = "TextGenWebUILLM";
    this.basePath = process.env.TEXT_GEN_WEB_UI_BASE_PATH;
    this.openai = new OpenAIApi({
      baseURL: this.basePath,
      apiKey: process.env.TEXT_GEN_WEB_UI_API_KEY ?? null,
    });
    this.model = null;
    this.limits = {
      history: this.promptWindowLimit() * 0.15,
      system: this.promptWindowLimit() * 0.15,
      user: this.promptWindowLimit() * 0.7,
    };

    this.embedder = embedder ?? new NativeEmbedder();
    this.defaultTemp = 0.7;

View on GitHub (pinned to 3aec848f28)