{"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":"Error","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/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/EmbeddingEngines/ollama/index.js#L1-L29","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n// EMBEDDING_BASE_PATH unset\n\n// after\nEMBEDDING_BASE_PATH=http://localhost:11434\nEMBEDDING_MODEL_PREF=nomic-embed-text","handlingStrategy":"validation","validationCode":"function hasEmbeddingBasePath(env = process.env) {\n  return typeof env.EMBEDDING_BASE_PATH === 'string' &&\n         env.EMBEDDING_BASE_PATH.trim().length > 0;\n}\nif (!hasEmbeddingBasePath()) {\n  throw new Error('Missing EMBEDDING_BASE_PATH for Ollama.');\n}","typeGuard":"function isOllamaHost(v) {\n  return typeof v === 'string' && /^https?:\\/\\//.test(v);\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["ollama","embedding","config","env","constructor"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}