{"record":{"id":"2b6a61a0f412c9ff","repo":"Mintplex-Labs/anything-llm","slug":"textwebgenui-api-base-path-must-be-provided-to-use","errorCode":null,"errorMessage":"TextWebGenUI API base path must be provided to use agents.","messagePattern":"TextWebGenUI API base path must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/agents/index.js","lineNumber":190,"sourceCode":"      case \"openrouter\":\n        if (!process.env.OPENROUTER_API_KEY)\n          throw new Error(\"OpenRouter API key must be provided to use agents.\");\n        break;\n      case \"mistral\":\n        if (!process.env.MISTRAL_API_KEY)\n          throw new Error(\"Mistral API key must be provided to use agents.\");\n        break;\n      case \"generic-openai\":\n        if (!process.env.GENERIC_OPEN_AI_BASE_PATH)\n          throw new Error(\"API base path must be provided to use agents.\");\n        break;\n      case \"perplexity\":\n        if (!process.env.PERPLEXITY_API_KEY)\n          throw new Error(\"Perplexity API key must be provided to use agents.\");\n        break;\n      case \"textgenwebui\":\n        if (!process.env.TEXT_GEN_WEB_UI_BASE_PATH)\n          throw new Error(\n            \"TextWebGenUI API base path must be provided to use agents.\"\n          );\n        break;\n      case \"bedrock\":\n        // No validations since there are many possible authentication methods\n        break;\n      case \"fireworksai\":\n        if (!process.env.FIREWORKS_AI_LLM_API_KEY)\n          throw new Error(\n            \"FireworksAI API Key must be provided to use agents.\"\n          );\n        break;\n      case \"deepseek\":\n        if (!process.env.DEEPSEEK_API_KEY)\n          throw new Error(\"DeepSeek API Key must be provided to use agents.\");\n        break;\n      case \"litellm\":\n        if (!process.env.LITE_LLM_BASE_PATH)","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L172-L208","documentation":"Thrown by AgentHandler.checkSetup() (server/utils/agents/index.js:189) when the workspace agent provider is 'textgenwebui' but TEXT_GEN_WEB_UI_BASE_PATH is unset/empty. text-generation-webui exposes an OpenAI-compatible extension server; AnythingLLM only needs its base URL, which this guard validates. (The message string 'TextWebGenUI' is a cosmetic typo for text-generation-webui but the check itself is correct.)","triggerScenarios":"An agent invocation runs with workspace.agentProvider === 'textgenwebui' while TEXT_GEN_WEB_UI_BASE_PATH is absent from process.env. Path: #providerSetupAndCheck() -> checkSetup() at index.js:476.","commonSituations":"text-generation-webui provider chosen in System > LLM Preference without entering the server URL; the OpenAI/worker extension not started in the webui so the URL is unreachable even after being set; .env present but Node not restarted; the extension listens on 127.0.0.1:5000 while AnythingLLM runs in a container where that resolves to itself.","solutions":["Start the text-generation-webui OpenAI extension (or worker) and set TEXT_GEN_WEB_UI_BASE_PATH in .env to its URL (e.g. http://127.0.0.1:5000/v1).","Restart AnythingLLM so process.env reloads.","curl <base path>/models from the AnythingLLM host to confirm the extension is serving.","If AnythingLLM is containerized, point at the host IP or docker network address rather than 127.0.0.1."],"exampleFix":"// before (.env)\n// TEXT_GEN_WEB_UI_BASE_PATH=\n\n// after (.env)\nTEXT_GEN_WEB_UI_BASE_PATH=http://127.0.0.1:5000/v1","handlingStrategy":"validation","validationCode":"const base = process.env.TEXT_GEN_WEB_UI_BASE_PATH;\nif (!base) {\n  throw new Error(\n    'Cannot start text-generation-webui agent: set TEXT_GEN_WEB_UI_BASE_PATH (e.g. http://127.0.0.1:5000/v1) in .env.'\n  );\n}\ntry { new URL(base); } catch { throw new Error('TEXT_GEN_WEB_UI_BASE_PATH is not a valid URL'); }","typeGuard":null,"tryCatchPattern":"try {\n  await agentHandler.start();\n} catch (e) {\n  if (/TextWebGenUI API base path/.test(e.message)) {\n    return respondConfigError('textgenwebui', ['TEXT_GEN_WEB_UI_BASE_PATH']);\n  }\n  throw e;\n}","preventionTips":["Start the text-generation-webui OpenAI extension before selecting the provider.","Use a host/docker-network address, not 127.0.0.1, when AnythingLLM is containerized.","Restart AnythingLLM after .env changes.","Add a boot reachability check for the configured base path."],"tags":["agents","llm-provider","textgenwebui","local-llm","environment-variables","config"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}