{"record":{"id":"ff2e6dab5a876fc7","repo":"Mintplex-Labs/anything-llm","slug":"no-deepseek-api-key-was-set","errorCode":null,"errorMessage":"No DeepSeek API key was set.","messagePattern":"No DeepSeek API key was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/deepseek/index.js","lineNumber":13,"sourceCode":"const { NativeEmbedder } = require(\"../../EmbeddingEngines/native\");\nconst {\n  LLMPerformanceMonitor,\n} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\nconst { MODEL_MAP } = require(\"../modelMap\");\nconst {\n  handleDefaultStreamResponseV2,\n} = require(\"../../helpers/chat/responses\");\n\nclass DeepSeekLLM {\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.DEEPSEEK_API_KEY)\n      throw new Error(\"No DeepSeek API key was set.\");\n    this.className = \"DeepSeekLLM\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n\n    this.openai = new OpenAIApi({\n      apiKey: process.env.DEEPSEEK_API_KEY,\n      baseURL: \"https://api.deepseek.com/v1\",\n    });\n    this.model =\n      modelPreference || process.env.DEEPSEEK_MODEL_PREF || \"deepseek-chat\";\n    this.limits = {\n      history: this.promptWindowLimit() * 0.15,\n      system: this.promptWindowLimit() * 0.15,\n      user: this.promptWindowLimit() * 0.7,\n    };\n\n    this.embedder = embedder ?? new NativeEmbedder();\n    this.defaultTemp = 0.7;\n    this.log(","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/AiProviders/deepseek/index.js#L1-L31","documentation":"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.","triggerScenarios":"Thrown at provider construction when no DeepSeek API key is configured.","commonSituations":"DeepSeek selected as LLM provider without an API key.","solutions":["Set the DeepSeek API key in provider settings or env."],"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"}