Mintplex-Labs/anything-llm · error · RetryError

error.message

Error message

error.message

What it means

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.

Source

Thrown at server/utils/agents/aibitat/providers/ppio.js:100

    try {
      return await tooledStream(
        this.client,
        this.model,
        messages,
        functions,
        eventHandler,
        { provider: this }
      );
    } catch (error) {
      console.error(error.message, error);
      if (error instanceof OpenAI.AuthenticationError) throw error;
      if (
        error instanceof OpenAI.RateLimitError ||
        error instanceof OpenAI.InternalServerError ||
        error instanceof OpenAI.APIError
      ) {
        throw new RetryError(error.message);
      }
      throw error;
    }
  }

  async complete(messages, functions = []) {
    const useNative = this.supportsNativeToolCalling();

    if (!useNative) {
      return await UnTooled.prototype.complete.call(
        this,
        messages,
        functions,
        this.#handleFunctionCallChat.bind(this)
      );
    }

    try {

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Check the console log for the raw status: 429 -> quota/concurrency, 404/400 -> fix slug, 5xx -> retry later
  2. List valid models via GET https://api.ppinfra.com/v3/openai/models and align this.model exactly
  3. Confirm PPIO_API_KEY is active and the account has balance
  4. Reduce parallel agent sessions for concurrency-capped plans

Example fix

// before
new PPIOProvider({ model: "qwen2.5-32b" }); // missing vendor prefix -> 404 -> RetryError

// after
new PPIOProvider({ model: "qwen/qwen2.5-32b-instruct" }); // slug from /models
Defensive patterns

Strategy: try-catch

Validate before calling

const models = await fetch("https://api.ppinfra.com/v3/openai/models", {
  headers: { Authorization: `Bearer ${process.env.PPIO_API_KEY}` },
}).then(r => r.json());
if (!models.data?.some((m) => m.id === provider.model)) throw new Error(`'${provider.model}' is not a PPIO deployment slug`);

Type guard

const { RetryError } = require("./server/utils/agents/aibitat/error.js");
const isRetryError = (e) => e instanceof RetryError;
const isPpioTransient = (e) => isRetryError(e) && /429|5\d\d/.test(String(e.message));

Try / catch

try {
  return await provider.stream(messages, functions, eventHandler);
} catch (error) {
  if (error instanceof OpenAI.AuthenticationError) throw error;
  if (isPpioTransient(error)) { await sleep(15_000); return provider.stream(messages, functions, eventHandler); }
  throw error; // 404/400: slug or key — fix config
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/71cb439610c4b141. Report an issue: GitHub.