{"record":{"id":"96b816fc3cd49362","repo":"Mintplex-Labs/anything-llm","slug":"no-embedding-model-pref-was-set","errorCode":null,"errorMessage":"No Embedding Model Pref was set.","messagePattern":"No Embedding Model Pref was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/utils/EmbeddingEngines/lemonade/index.js","lineNumber":9,"sourceCode":"const { parseLemonadeServerEndpoint } = require(\"../../AiProviders/lemonade\");\nconst { toChunks, reportEmbeddingProgress } = require(\"../../helpers\");\n\nclass LemonadeEmbedder {\n  constructor() {\n    if (!process.env.EMBEDDING_BASE_PATH)\n      throw new Error(\"No Lemonade API Base Path was set.\");\n    if (!process.env.EMBEDDING_MODEL_PREF)\n      throw new Error(\"No Embedding Model Pref was set.\");\n    this.className = \"LemonadeEmbedder\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.lemonade = new OpenAIApi({\n      baseURL: parseLemonadeServerEndpoint(\n        process.env.EMBEDDING_BASE_PATH,\n        \"openai\"\n      ),\n      apiKey: process.env.LEMONADE_LLM_API_KEY || null,\n    });\n    this.model = process.env.EMBEDDING_MODEL_PREF;\n\n    this.maxConcurrentChunks = 50;\n    this.embeddingMaxChunkLength =\n      process.env.EMBEDDING_MODEL_MAX_CHUNK_LENGTH || 8_191;\n  }\n\n  log(text, ...args) {\n    console.log(`\\x1b[36m[${this.className}]\\x1b[0m ${text}`, ...args);","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/utils/EmbeddingEngines/lemonade/index.js#L1-L27","documentation":"Thrown in the LemonadeEmbedder constructor when process.env.EMBEDDING_MODEL_PREF is falsy, immediately after the base-path check. Lemonade requires an explicit model id because the server hosts whatever models were loaded into it; there is no safe default.","triggerScenarios":"Constructing LemonadeEmbedder while EMBEDDING_MODEL_PREF is unset; model id left blank; embedding model not loaded into the Lemonade server.","commonSituations":"Switching to Lemonade without naming an embedding model; model unloaded from the Lemonade server; typo in the model id.","solutions":["Set EMBEDDING_MODEL_PREF to a model loaded in the Lemonade server (verify via its model list).","Load the embedding model into the Lemonade server if it is not present.","Restart the process after setting the var.","Confirm EMBEDDING_BASE_PATH is also set (the prior check)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function assertLemonadeModel() {\n  if (!process.env.EMBEDDING_MODEL_PREF) {\n    throw new Error('Missing env EMBEDDING_MODEL_PREF (Lemonade embedding model id)');\n  }\n}\nassertLemonadeModel();","typeGuard":null,"tryCatchPattern":"try {\n  new LemonadeEmbedder();\n} catch (e) {\n  if (/model pref/i.test(e.message)) { /* prompt for embedding model id */ }\n  throw e;\n}","preventionTips":["Set EMBEDDING_MODEL_PREF to a model actually loaded in the Lemonade server.","Load the embedding model into the server before configuring it.","Restart the process after setting the var."],"tags":["lemonade","amd","embeddings","config","env","model-config"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}