Mintplex-Labs/anything-llm · error · Error
No DeepSeek API key was set.
Error message
No DeepSeek API key was set.
What it means
Constructor guard for DeepSeekLLM: the DEEPSEEK_API_KEY environment variable is unset, so no DeepSeek client can be constructed. Instantiating this provider without configuring the key aborts immediately.
Solutions
- Set the DeepSeek API key in provider settings or env.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at provider construction when no DeepSeek API key is configured.
Common situations: DeepSeek selected as LLM provider without an API key.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/ff2e6dab5a876fc7.
Report an issue: GitHub.
Appendix: source
Thrown at server/utils/AiProviders/deepseek/index.js:13
const { NativeEmbedder } = require("../../EmbeddingEngines/native");
const {
LLMPerformanceMonitor,
} = require("../../helpers/chat/LLMPerformanceMonitor");
const { MODEL_MAP } = require("../modelMap");
const {
handleDefaultStreamResponseV2,
} = require("../../helpers/chat/responses");
class DeepSeekLLM {
constructor(embedder = null, modelPreference = null) {
if (!process.env.DEEPSEEK_API_KEY)
throw new Error("No DeepSeek API key was set.");
this.className = "DeepSeekLLM";
const { OpenAI: OpenAIApi } = require("openai");
this.openai = new OpenAIApi({
apiKey: process.env.DEEPSEEK_API_KEY,
baseURL: "https://api.deepseek.com/v1",
});
this.model =
modelPreference || process.env.DEEPSEEK_MODEL_PREF || "deepseek-chat";
this.limits = {
history: this.promptWindowLimit() * 0.15,
system: this.promptWindowLimit() * 0.15,
user: this.promptWindowLimit() * 0.7,
};
this.embedder = embedder ?? new NativeEmbedder();
this.defaultTemp = 0.7;
this.log(View on GitHub (pinned to 3aec848f28)