Mintplex-Labs/anything-llm · error · Error
Foundry base path must be provided to use agents.
Error message
Foundry base path must be provided to use agents.
What it means
Provider setup guard in AgentHandler.checkSetup: the selected agent provider is 'foundry' but FOUNDRY_BASE_PATH is empty/unset, so the agent has no endpoint URL for the Foundry service and initialization aborts.
Solutions
- Set the FOUNDRY_BASE_PATH environment variable.
- Ensure the Foundry Local service is running.
Defensive patterns
Strategy: validation
When it happens
Trigger: Foundry Local 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/e49a83d964dea3ba.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/agents/index.js:253
case "ppio":
if (!process.env.PPIO_API_KEY)
throw new Error("PPIO API Key must be provided to use agents.");
break;
case "gemini":
if (!process.env.GEMINI_API_KEY)
throw new Error("Gemini API key must be provided to use agents.");
break;
case "moonshotai":
if (!process.env.MOONSHOT_AI_MODEL_PREF)
throw new Error("Moonshot AI model must be set to use agents.");
break;
case "cometapi":
if (!process.env.COMETAPI_LLM_API_KEY)
throw new Error("CometAPI API Key must be provided to use agents.");
break;
case "foundry":
if (!process.env.FOUNDRY_BASE_PATH)
throw new Error("Foundry base path must be provided to use agents.");
break;
case "giteeai":
if (!process.env.GITEE_AI_API_KEY)
throw new Error("GiteeAI API Key must be provided to use agents.");
break;
case "cohere":
if (!process.env.COHERE_API_KEY)
throw new Error("Cohere API key must be provided to use agents.");
break;
case "llmman":
if (!process.env.LLMMAN_BASE_PATH)
throw new Error("llmman base path must be provided to use agents.");
break;
case "privatemode":
if (!process.env.PRIVATEMODE_LLM_BASE_PATH)
throw new Error(
"Privatemode base path must be provided to use agents."
);View on GitHub (pinned to 20f6d3546c)