{"record":{"id":"51801a99966a3531","repo":"Mintplex-Labs/anything-llm","slug":"no-embedding-model-preference-defined","errorCode":null,"errorMessage":"No Embedding Model preference defined.","messagePattern":"No Embedding Model preference defined\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/EmbeddingEngines/azureOpenAi/index.js","lineNumber":44,"sourceCode":"    this.maxConcurrentChunks = 16;\n\n    // https://learn.microsoft.com/en-us/answers/questions/1188074/text-embedding-ada-002-token-context-length\n    this.embeddingMaxChunkLength = 2048;\n  }\n\n  log(text, ...args) {\n    console.log(`\\x1b[36m[${this.className}]\\x1b[0m ${text}`, ...args);\n  }\n\n  async embedTextInput(textInput) {\n    const result = await this.embedChunks(\n      Array.isArray(textInput) ? textInput : [textInput]\n    );\n    return result?.[0] || [];\n  }\n\n  async embedChunks(textChunks = []) {\n    if (!this.model) throw new Error(\"No Embedding Model preference defined.\");\n\n    this.log(`Embedding ${textChunks.length} chunks...`);\n    // Because there is a limit on how many chunks can be sent at once to Azure OpenAI\n    // we concurrently execute each max batch of text chunks possible.\n    // Refer to constructor maxConcurrentChunks for more info.\n    const embeddingRequests = [];\n    let chunksProcessed = 0;\n    for (const chunk of toChunks(textChunks, this.maxConcurrentChunks)) {\n      embeddingRequests.push(\n        new Promise((resolve) => {\n          this.openai.embeddings\n            .create({\n              model: this.model,\n              input: chunk,\n            })\n            .then((res) => {\n              chunksProcessed += chunk.length;\n              reportEmbeddingProgress(chunksProcessed, textChunks.length);","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/EmbeddingEngines/azureOpenAi/index.js#L26-L62","documentation":"Guard in AzureOpenAiEmbedder.embedChunks: this.model is null because no embedding model preference was configured at construction, so the embedder has no deployment/model name to pass in the embedding request.","triggerScenarios":"Thrown when no embedding model preference is defined.","commonSituations":"Azure embedder selected without a deployment/model preference.","solutions":["Set the embedding model deployment name in embedder settings."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}