{"record":{"id":"f326b48cbd372edb","repo":"Mintplex-Labs/anything-llm","slug":"no-sambanova-api-key-was-set","errorCode":null,"errorMessage":"No SambaNova API key was set.","messagePattern":"No SambaNova API key was set\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/sambanova/index.js","lineNumber":17,"sourceCode":"const { NativeEmbedder } = require(\"../../EmbeddingEngines/native\");\nconst { isAbortError } = require(\"../../helpers/abortSignals\");\nconst {\n  LLMPerformanceMonitor,\n} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\nconst { v4: uuidv4 } = require(\"uuid\");\nconst {\n  writeResponseChunk,\n  clientAbortedHandler,\n  formatChatHistory,\n} = require(\"../../helpers/chat/responses\");\nconst { MODEL_MAP } = require(\"../modelMap\");\n\nclass SambaNovaLLM {\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.SAMBANOVA_LLM_API_KEY)\n      throw new Error(\"No SambaNova API key was set.\");\n    this.className = \"SambaNovaLLM\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n\n    this.openai = new OpenAIApi({\n      baseURL: \"https://api.sambanova.ai/v1\",\n      apiKey: process.env.SAMBANOVA_LLM_API_KEY,\n    });\n    this.model = modelPreference || process.env.SAMBANOVA_LLM_MODEL_PREF;\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(\n      `Initialized ${this.model} with context window ${this.promptWindowLimit()}`","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/a145d4d87d086bdb31d50f9bf9cd9c46d311780c/server/utils/AiProviders/sambanova/index.js#L1-L35","documentation":"Configuration guard thrown by the SambaNovaLLM constructor: the SambaNova provider was selected but the SAMBANOVA_LLM_API_KEY environment variable is empty/unset, so requests to SambaNova's inference API cannot be authenticated.","triggerScenarios":"Thrown at provider construction when no SambaNova API key is configured.","commonSituations":"SambaNova selected as LLM provider without an API key.","solutions":["Set the SambaNova API key in provider settings or env."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a145d4d87d086bdb31d50f9bf9cd9c46d311780c","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}