{"record":{"id":"11cd01d1eab4dbb7","repo":"Mintplex-Labs/anything-llm","slug":"no-embedding-base-path-was-set-11cd01","errorCode":null,"errorMessage":"No embedding base path was set.","messagePattern":"No embedding base path was set\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"server/utils/EmbeddingEngines/ollama/index.js","lineNumber":11,"sourceCode":"const {\n  maximumChunkLength,\n  reportEmbeddingProgress,\n} = require(\"../../helpers\");\nconst { Ollama } = require(\"ollama\");\nconst { OllamaAILLM } = require(\"../../AiProviders/ollama\");\n\nclass OllamaEmbedder {\n  constructor() {\n    if (!process.env.EMBEDDING_BASE_PATH)\n      throw new Error(\"No embedding base path was set.\");\n    if (!process.env.EMBEDDING_MODEL_PREF)\n      throw new Error(\"No embedding model was set.\");\n\n    this.className = \"OllamaEmbedder\";\n    this.basePath = process.env.EMBEDDING_BASE_PATH;\n    this.model = process.env.EMBEDDING_MODEL_PREF;\n    this.maxConcurrentChunks = process.env.OLLAMA_EMBEDDING_BATCH_SIZE\n      ? Number(process.env.OLLAMA_EMBEDDING_BATCH_SIZE)\n      : 1;\n    this.embeddingMaxChunkLength = maximumChunkLength();\n    this.authToken = process.env.OLLAMA_AUTH_TOKEN;\n\n    const headers = this.authToken\n      ? { Authorization: `Bearer ${this.authToken}` }\n      : {};\n    this.client = new Ollama({\n      host: this.basePath,\n      headers,","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/EmbeddingEngines/ollama/index.js#L1-L29","documentation":"Thrown by the OllamaEmbedder constructor when EMBEDDING_BASE_PATH is unset. Unlike the OpenAI-SDK engines, this class talks to Ollama natively (the 'ollama' package) using that URL, requires an explicit model (EMBEDDING_MODEL_PREF is checked next), and sizes batches from OLLAMA_EMBEDDING_BATCH_SIZE (default 1). Without the base path it cannot locate your Ollama daemon (typically http://127.0.0.1:11434).","triggerScenarios":"Selecting Ollama as the embedding engine without a base path; Ollama bound to a custom host/port (OLLAMA_HOST) that was never entered; remote Ollama instances where the URL field was skipped; env var set but the process not restarted.","commonSituations":"Docker deployments where 'localhost' points inside the container — the fix requires host.docker.internal; Ollama behind HTTPS reverse proxies with the wrong URL recorded.","solutions":["Set EMBEDDING_BASE_PATH to your Ollama URL, e.g. http://127.0.0.1:11434","If AnythingLLM runs in Docker and Ollama on the host, use http://host.docker.internal:11434 (add extra_hosts on Linux)","Also set EMBEDDING_MODEL_PREF to a pulled embedding model (e.g. nomic-embed-text) — checked by the next guard","Optionally set OLLAMA_EMBEDDING_BATCH_SIZE above 1 for throughput once it works","Restart the server after saving"],"exampleFix":"# before\nEMBEDDING_ENGINE=ollama\n\n# after (docker -> host ollama)\nEMBEDDING_ENGINE=ollama\nEMBEDDING_BASE_PATH=http://host.docker.internal:11434\nEMBEDDING_MODEL_PREF=nomic-embed-text\nOLLAMA_EMBEDDING_BATCH_SIZE=32","handlingStrategy":"validation","validationCode":"function assertOllamaEmbedderConfigured() {\n  const missing = [\"EMBEDDING_BASE_PATH\", \"EMBEDDING_MODEL_PREF\"].filter(\n    (k) => !process.env[k]\n  );\n  if (missing.length) {\n    throw new Error(`Ollama embedder misconfigured; missing: ${missing.join(\", \")}`);\n  }\n  try { new URL(process.env.EMBEDDING_BASE_PATH); }\n  catch { throw new Error(\"EMBEDDING_BASE_PATH must be a valid URL, e.g. http://127.0.0.1:11434\"); }\n}\nassertOllamaEmbedderConfigured();","typeGuard":null,"tryCatchPattern":"try {\n  const { OllamaEmbedder } = require(\"./server/utils/EmbeddingEngines/ollama\");\n  const embedder = new OllamaEmbedder();\n} catch (e) {\n  if (e.message === \"No embedding base path was set.\") {\n    // set EMBEDDING_BASE_PATH (docker->host: http://host.docker.internal:11434); no retry\n  }\n  throw e;\n}","preventionTips":["In Docker, point EMBEDDING_BASE_PATH at host.docker.internal (not localhost) when Ollama runs on the host","Ensure `ollama pull nomic-embed-text` (or your embedding model) finished before configuring","Set OLLAMA_EMBEDDING_BATCH_SIZE > 1 deliberately — the conservative default is 1"],"tags":["ollama","local-server","env-var","configuration","base-url","constructor"],"backgroundTag":"missing-env-var","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}