Mintplex-Labs/anything-llm · error · Error
Privatemode chat: is not valid or defined model for chat…
Error message
Privatemode chat: ${this.model} is not valid or defined model for chat completion! What it means
Sentinel guard in PrivatemodeLLM.getChatCompletion: this.model is falsy, meaning the Privatemode model preference never resolved to an identifier, so a non-streaming completion cannot name a target model and is rejected.
Solutions
- Set a valid Privatemode model for chat completion.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown when the configured Privatemode model is invalid.
Common situations: Model preference set to an unavailable model.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/78674e91102bb7f0.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/AiProviders/privatemode/index.js:145
attachments = [],
}) {
const prompt = {
role: "system",
content: `${systemPrompt}${this.#appendContext(contextTexts)}`,
};
return [
prompt,
...formatChatHistory(chatHistory, this.#generateContent),
{
role: "user",
content: this.#generateContent({ userPrompt, attachments }),
},
];
}
async getChatCompletion(messages = null, { temperature = 0.7 }) {
if (!this.model)
throw new Error(
`Privatemode chat: ${this.model} is not valid or defined model for chat completion!`
);
const result = await LLMPerformanceMonitor.measureAsyncFunction(
this.client.chat.completions.create({
model: this.model,
messages,
temperature,
})
);
if (
!result.output.hasOwnProperty("choices") ||
result.output.choices.length === 0
)
return null;
return {View on GitHub (pinned to 3aec848f28)