{"record":{"id":"d9dc50596624904c","repo":"Mintplex-Labs/anything-llm","slug":"no-ppio-api-key-was-set","errorCode":null,"errorMessage":"No PPIO API key was set.","messagePattern":"No PPIO API key was set\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/utils/AiProviders/ppio/index.js","lineNumber":28,"sourceCode":"} = require(\"../../helpers/chat/LLMPerformanceMonitor\");\nconst cacheFolder = path.resolve(\n  process.env.STORAGE_DIR\n    ? path.resolve(process.env.STORAGE_DIR, \"models\", \"ppio\")\n    : path.resolve(__dirname, `../../../storage/models/ppio`)\n);\n\nfunction cachedPPIOModels() {\n  const cacheModelPath = path.resolve(cacheFolder, \"models.json\");\n  if (!fs.existsSync(cacheModelPath)) return {};\n  return safeJsonParse(\n    fs.readFileSync(cacheModelPath, { encoding: \"utf-8\" }),\n    {}\n  );\n}\n\nclass PPIOLLM {\n  constructor(embedder = null, modelPreference = null) {\n    if (!process.env.PPIO_API_KEY) throw new Error(\"No PPIO API key was set.\");\n\n    this.className = \"PPIOLLM\";\n    const { OpenAI: OpenAIApi } = require(\"openai\");\n    this.basePath = \"https://api.ppinfra.com/v3/openai/\";\n    this.openai = new OpenAIApi({\n      baseURL: this.basePath,\n      apiKey: process.env.PPIO_API_KEY ?? null,\n      defaultHeaders: {\n        \"HTTP-Referer\": \"https://anythingllm.com\",\n        \"X-API-Source\": \"anythingllm\",\n      },\n    });\n    this.model =\n      modelPreference ||\n      process.env.PPIO_MODEL_PREF ||\n      \"qwen/qwen2.5-32b-instruct\";\n    this.limits = {\n      history: this.promptWindowLimit() * 0.15,","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/f92433b4ea0598492a1e6645ea22addbb4dd1287/server/utils/AiProviders/ppio/index.js#L10-L46","documentation":"Configuration guard thrown by the PPIOLLM constructor: the PPIO provider was selected but the PPIO_API_KEY environment variable is empty/unset, so the PPIO inference endpoint cannot be authenticated against.","triggerScenarios":"Thrown at provider construction when no PPIO API key is configured.","commonSituations":"PPIO selected as LLM provider without an API key.","solutions":["Set the PPIO API key in provider settings or env."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f92433b4ea0598492a1e6645ea22addbb4dd1287","analyzedAt":"2026-09-22T02:13:38.154Z","contentChangedAt":"2026-09-22T02:13:38.154Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}