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

  1. Set EMBEDDING_BASE_PATH to the Ollama daemon URL, e.g. http://localhost:11434
  2. Verify Ollama is running: curl http://<host>:11434/api/tags
  3. In Docker, use host.docker.internal or run with --network host
  4. 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

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


AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13). Data as JSON: /api/errors/11cd01d1eab4dbb7. Report an issue: GitHub.