Mintplex-Labs/anything-llm · critical · Error
No embedding base path was set.
Error message
No embedding base path was set.
What it means
Thrown by the OllamaEmbedder constructor when process.env.EMBEDDING_BASE_PATH is falsy. The value becomes the `host` passed to the Ollama client (line 28) and the URL the #isAlive fetch pings. Without it the client cannot locate the Ollama daemon, so construction aborts immediately.
Source
Thrown at server/utils/EmbeddingEngines/ollama/index.js:11
const {
maximumChunkLength,
reportEmbeddingProgress,
} = require("../../helpers");
const { Ollama } = require("ollama");
const { OllamaAILLM } = require("../../AiProviders/ollama");
class OllamaEmbedder {
constructor() {
if (!process.env.EMBEDDING_BASE_PATH)
throw new Error("No embedding base path was set.");
if (!process.env.EMBEDDING_MODEL_PREF)
throw new Error("No embedding model was set.");
this.className = "OllamaEmbedder";
this.basePath = process.env.EMBEDDING_BASE_PATH;
this.model = process.env.EMBEDDING_MODEL_PREF;
this.maxConcurrentChunks = process.env.OLLAMA_EMBEDDING_BATCH_SIZE
? Number(process.env.OLLAMA_EMBEDDING_BATCH_SIZE)
: 1;
this.embeddingMaxChunkLength = maximumChunkLength();
this.authToken = process.env.OLLAMA_AUTH_TOKEN;
const headers = this.authToken
? { Authorization: `Bearer ${this.authToken}` }
: {};
this.client = new Ollama({
host: this.basePath,
headers,View on GitHub (pinned to 526360e320)
Solutions
- Set EMBEDDING_BASE_PATH to the Ollama daemon URL, e.g. http://localhost:11434
- Verify Ollama is running: curl http://<host>:11434/api/tags
- In Docker, use host.docker.internal or run with --network host
- Reload AnythingLLM env after the edit
Example fix
// before // EMBEDDING_BASE_PATH unset // after EMBEDDING_BASE_PATH=http://localhost:11434 EMBEDDING_MODEL_PREF=nomic-embed-text
Defensive patterns
Strategy: validation
Validate before calling
function hasEmbeddingBasePath(env = process.env) {
return typeof env.EMBEDDING_BASE_PATH === 'string' &&
env.EMBEDDING_BASE_PATH.trim().length > 0;
}
if (!hasEmbeddingBasePath()) {
throw new Error('Missing EMBEDDING_BASE_PATH for Ollama.');
} Type guard
function isOllamaHost(v) {
return typeof v === 'string' && /^https?:\/\//.test(v);
} Prevention
- Set EMBEDDING_BASE_PATH to the reachable Ollama daemon (default :11434).
- In Docker use host.docker.internal:11434.
- Validate env at boot for the selected engine.
When it happens
Trigger: Selecting the Ollama embedding engine with EMBEDDING_BASE_PATH unset/empty; constructing `new OllamaEmbedder()` before env load. The guard on line 10 precedes client creation.
Common situations: Fresh Ollama setup; Ollama bound to a non-default port (11434 is default); Docker where localhost must become host.docker.internal; remote Ollama host not yet configured; env var typo.
Related errors
- No embedding model was set.
- LiteLLM must have a valid base path to use for the api.
- No embedding base path was set.
- No embedding model was set.
- No embedding base path was set.
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/11cd01d1eab4dbb7.
Report an issue: GitHub.