Mintplex-Labs/anything-llm · error · Error

TextWebGenUI API base path must be provided to use agents.

Error message

TextWebGenUI API base path must be provided to use agents.

What it means

Setup guard in checkSetup(): provider is 'textgenwebui' but TEXT_GEN_WEB_UI_BASE_PATH is unset, so no Text generation WebUI API endpoint is configured. Fail-fast configuration check on the local server URL.

Solutions

  1. Set the TEXT_GEN_WEB_UI_BASE_PATH environment variable.
  2. Ensure text-generation-webui is running with its API enabled.
Defensive patterns

Strategy: validation

When it happens

Trigger: TextWebGenUI was selected as the agent provider but no base path is configured.

Common situations: 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.


AI-assisted analysis of Mintplex-Labs/anything-llm@20f6d3546c (2026-08-18). Data as JSON: /api/errors/2b6a61a0f412c9ff. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/agents/index.js:190

      case "openrouter":
        if (!process.env.OPENROUTER_API_KEY)
          throw new Error("OpenRouter API key must be provided to use agents.");
        break;
      case "mistral":
        if (!process.env.MISTRAL_API_KEY)
          throw new Error("Mistral API key must be provided to use agents.");
        break;
      case "generic-openai":
        if (!process.env.GENERIC_OPEN_AI_BASE_PATH)
          throw new Error("API base path must be provided to use agents.");
        break;
      case "perplexity":
        if (!process.env.PERPLEXITY_API_KEY)
          throw new Error("Perplexity API key must be provided to use agents.");
        break;
      case "textgenwebui":
        if (!process.env.TEXT_GEN_WEB_UI_BASE_PATH)
          throw new Error(
            "TextWebGenUI API base path must be provided to use agents."
          );
        break;
      case "bedrock":
        // No validations since there are many possible authentication methods
        break;
      case "fireworksai":
        if (!process.env.FIREWORKS_AI_LLM_API_KEY)
          throw new Error(
            "FireworksAI API Key must be provided to use agents."
          );
        break;
      case "deepseek":
        if (!process.env.DEEPSEEK_API_KEY)
          throw new Error("DeepSeek API Key must be provided to use agents.");
        break;
      case "litellm":
        if (!process.env.LITE_LLM_BASE_PATH)

View on GitHub (pinned to 20f6d3546c)