{"record":{"id":"5b130c99378de24a","repo":"Mintplex-Labs/anything-llm","slug":"ollama-base-path-must-be-provided-to-use-agents","errorCode":null,"errorMessage":"Ollama base path must be provided to use agents.","messagePattern":"Ollama base path must be provided to use agents\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/agents/index.js","lineNumber":144,"sourceCode":"  }\n\n  checkSetup() {\n    switch (this.provider) {\n      case \"openai\":\n        if (!process.env.OPEN_AI_KEY)\n          throw new Error(\"OpenAI API key must be provided to use agents.\");\n        break;\n      case \"anthropic\":\n        if (!process.env.ANTHROPIC_API_KEY)\n          throw new Error(\"Anthropic API key must be provided to use agents.\");\n        break;\n      case \"lmstudio\":\n        if (!process.env.LMSTUDIO_BASE_PATH)\n          throw new Error(\"LMStudio base path must be provided to use agents.\");\n        break;\n      case \"ollama\":\n        if (!process.env.OLLAMA_BASE_PATH)\n          throw new Error(\"Ollama base path must be provided to use agents.\");\n        break;\n      case \"groq\":\n        if (!process.env.GROQ_API_KEY)\n          throw new Error(\"Groq API key must be provided to use agents.\");\n        break;\n      case \"togetherai\":\n        if (!process.env.TOGETHER_AI_API_KEY)\n          throw new Error(\"TogetherAI API key must be provided to use agents.\");\n        break;\n      case \"azure\":\n        if (!process.env.AZURE_OPENAI_ENDPOINT || !process.env.AZURE_OPENAI_KEY)\n          throw new Error(\n            \"Azure OpenAI API endpoint and key must be provided to use agents.\"\n          );\n        break;\n      case \"koboldcpp\":\n        if (!process.env.KOBOLD_CPP_BASE_PATH)\n          throw new Error(","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/agents/index.js#L126-L162","documentation":"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.","triggerScenarios":"Selecting the ollama agent provider while OLLAMA_BASE_PATH is unset, typically because the local Ollama server URL was never configured.","commonSituations":"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).","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."],"exampleFix":"# before (.env)\n# OLLAMA_BASE_PATH=\n\n# after (.env)\nOLLAMA_BASE_PATH=http://127.0.0.1:11434","handlingStrategy":"validation","validationCode":"function ollamaAgentReady() {\n  return Boolean(process.env.OLLAMA_BASE_PATH && process.env.OLLAMA_BASE_PATH.trim());\n}\nif (provider === \"ollama\" && !ollamaAgentReady())\n  throw new Error(\"Set OLLAMA_BASE_PATH (e.g. http://127.0.0.1:11434) before enabling the ollama agent.\");","typeGuard":null,"tryCatchPattern":"try {\n  agent.checkSetup();\n} catch (e) {\n  if (/OLLAMA_BASE_PATH|base path must be provided/i.test(e.message)) {\n    throw new Error(\"Ollama agent is not configured: set OLLAMA_BASE_PATH in .env and restart.\");\n  }\n  throw e;\n}","preventionTips":["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."],"tags":["ollama","config","env","agents","local-llm"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}