Mintplex-Labs/anything-llm · critical · Error
Ollama base path must be provided to use agents.
Error message
Ollama base path must be provided to use agents.
What it means
checkSetup() (index.js:142-145) throws for provider === "ollama" when process.env.OLLAMA_BASE_PATH is falsy. Ollama runs locally, so the agent layer requires its base URL before proceeding.
Source
Thrown at server/utils/agents/index.js:144
}
checkSetup() {
switch (this.provider) {
case "openai":
if (!process.env.OPEN_AI_KEY)
throw new Error("OpenAI API key must be provided to use agents.");
break;
case "anthropic":
if (!process.env.ANTHROPIC_API_KEY)
throw new Error("Anthropic API key must be provided to use agents.");
break;
case "lmstudio":
if (!process.env.LMSTUDIO_BASE_PATH)
throw new Error("LMStudio base path must be provided to use agents.");
break;
case "ollama":
if (!process.env.OLLAMA_BASE_PATH)
throw new Error("Ollama base path must be provided to use agents.");
break;
case "groq":
if (!process.env.GROQ_API_KEY)
throw new Error("Groq API key must be provided to use agents.");
break;
case "togetherai":
if (!process.env.TOGETHER_AI_API_KEY)
throw new Error("TogetherAI API key must be provided to use agents.");
break;
case "azure":
if (!process.env.AZURE_OPENAI_ENDPOINT || !process.env.AZURE_OPENAI_KEY)
throw new Error(
"Azure OpenAI API endpoint and key must be provided to use agents."
);
break;
case "koboldcpp":
if (!process.env.KOBOLD_CPP_BASE_PATH)
throw new Error(View on GitHub (pinned to 526360e320)
Solutions
- Set OLLAMA_BASE_PATH in .env (e.g. http://127.0.0.1:11434, or http://host.docker.internal:11434 inside Docker).
- Ensure Ollama is installed, running, and has pulled a model.
- Restart the server after saving .env.
- Confirm network reachability from the server process to Ollama.
Example fix
# before (.env) # OLLAMA_BASE_PATH= # after (.env) OLLAMA_BASE_PATH=http://127.0.0.1:11434
Defensive patterns
Strategy: validation
Validate before calling
function ollamaAgentReady() {
return Boolean(process.env.OLLAMA_BASE_PATH && process.env.OLLAMA_BASE_PATH.trim());
}
if (provider === "ollama" && !ollamaAgentReady())
throw new Error("Set OLLAMA_BASE_PATH (e.g. http://127.0.0.1:11434) before enabling the ollama agent."); Try / catch
try {
agent.checkSetup();
} catch (e) {
if (/OLLAMA_BASE_PATH|base path must be provided/i.test(e.message)) {
throw new Error("Ollama agent is not configured: set OLLAMA_BASE_PATH in .env and restart.");
}
throw e;
} Prevention
- Run checkSetup() at boot to validate the URL early.
- In Docker use http://host.docker.internal:11434 (or the host IP), not 127.0.0.1.
- Confirm Ollama is installed, running, and has a pulled model.
- Restart the server after changing .env.
When it happens
Trigger: Selecting the ollama agent provider while OLLAMA_BASE_PATH is unset, typically because the local Ollama server URL was never configured.
Common situations: Local-only provider chosen without setting the URL, Ollama not yet running, or a Docker deployment where the host URL wasn't passed (e.g. forgot http://host.docker.internal:11434).
Related errors
- LMStudio base path must be provided to use agents.
- Docker Model Runner base path must be provided to use agents
- Privatemode base path must be provided to use agents.
- Lemonade base path must be provided to use agents.
- OMLX base path must be provided to use agents.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/5b130c99378de24a.
Report an issue: GitHub.