{"record":{"id":"71cb439610c4b141","repo":"Mintplex-Labs/anything-llm","slug":"error-message-71cb43","errorCode":null,"errorMessage":"error.message","messagePattern":"error\\.message","errorType":"exception","errorClass":"RetryError","httpStatus":null,"severity":"error","filePath":"server/utils/agents/aibitat/providers/ppio.js","lineNumber":100,"sourceCode":"\n    try {\n      return await tooledStream(\n        this.client,\n        this.model,\n        messages,\n        functions,\n        eventHandler,\n        { provider: this }\n      );\n    } catch (error) {\n      console.error(error.message, error);\n      if (error instanceof OpenAI.AuthenticationError) throw error;\n      if (\n        error instanceof OpenAI.RateLimitError ||\n        error instanceof OpenAI.InternalServerError ||\n        error instanceof OpenAI.APIError\n      ) {\n        throw new RetryError(error.message);\n      }\n      throw error;\n    }\n  }\n\n  async complete(messages, functions = []) {\n    const useNative = this.supportsNativeToolCalling();\n\n    if (!useNative) {\n      return await UnTooled.prototype.complete.call(\n        this,\n        messages,\n        functions,\n        this.#handleFunctionCallChat.bind(this)\n      );\n    }\n\n    try {","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/agents/aibitat/providers/ppio.js#L82-L118","documentation":"PPIOProvider.stream() catches failures from the streaming tool-call request to https://api.ppinfra.com/v3/openai and rethrows OpenAI RateLimitError, InternalServerError, or any APIError as aibitat's RetryError with the original message; AuthenticationError is rethrown unwrapped; other errors pass through. The raw error object is logged with console.error first, so the console carries the true cause. Note this provider reports supportsAgentStreaming() === false, so reaching stream() usually means internal use; the common statuses are PPIO quota 429s, invalid slug 404/400s, and 5xx backend failures.","triggerScenarios":"Streaming chat.completions.create with PPIO_API_KEY returning 429 (PPIO rate/concurrency or balance-linked throttle), 404/400 when this.model (default \"qwen/qwen2.5-32b-instruct\") is not a valid PPIO deployment slug, 5xx on PPIO infrastructure, or non-401 auth rejections (e.g. 403) wrapped as APIError.","commonSituations":"Slug typo'd or vendor prefix missing; PPIO balance exhausted so requests throttle/fail; concurrent chats exceeding the plan's concurrency; regional endpoint changes invalidating old slugs.","solutions":["Check the console log for the raw status: 429 -> quota/concurrency, 404/400 -> fix slug, 5xx -> retry later","List valid models via GET https://api.ppinfra.com/v3/openai/models and align this.model exactly","Confirm PPIO_API_KEY is active and the account has balance","Reduce parallel agent sessions for concurrency-capped plans"],"exampleFix":"// before\nnew PPIOProvider({ model: \"qwen2.5-32b\" }); // missing vendor prefix -> 404 -> RetryError\n\n// after\nnew PPIOProvider({ model: \"qwen/qwen2.5-32b-instruct\" }); // slug from /models","handlingStrategy":"try-catch","validationCode":"const models = await fetch(\"https://api.ppinfra.com/v3/openai/models\", {\n  headers: { Authorization: `Bearer ${process.env.PPIO_API_KEY}` },\n}).then(r => r.json());\nif (!models.data?.some((m) => m.id === provider.model)) throw new Error(`'${provider.model}' is not a PPIO deployment slug`);","typeGuard":"const { RetryError } = require(\"./server/utils/agents/aibitat/error.js\");\nconst isRetryError = (e) => e instanceof RetryError;\nconst isPpioTransient = (e) => isRetryError(e) && /429|5\\d\\d/.test(String(e.message));","tryCatchPattern":"try {\n  return await provider.stream(messages, functions, eventHandler);\n} catch (error) {\n  if (error instanceof OpenAI.AuthenticationError) throw error;\n  if (isPpioTransient(error)) { await sleep(15_000); return provider.stream(messages, functions, eventHandler); }\n  throw error; // 404/400: slug or key — fix config\n}","preventionTips":["Use exact slugs from GET /v3/openai/models (vendor-prefixed)","Watch account balance — PPIO throttles/fails when credit runs out","Use the console log; the raw error object is printed at this site","Keep concurrency at or below the plan's cap"],"tags":["llm-provider","ppio","openai-sdk","retry-error","rate-limit","streaming"],"backgroundTag":"openai-api-error","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}