Mintplex-Labs/anything-llm · error · RetryError
error.message
Error message
error.message
What it means
Fireworks AI provider's `stream()` classifies OpenAI SDK errors. It logs `console.error(error.message, error)` first, then re-throws AuthenticationError, wraps RateLimitError/InternalServerError/APIError as `RetryError(error.message)`, and re-throws the rest. Fireworks model ids are long and namespaced (e.g. `accounts/fireworks/models/llama-v3p1-70b-instruct`), so a malformed id is a common APIError source.
Source
Thrown at server/utils/agents/aibitat/providers/fireworksai.js:97
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 526360e320)
Solutions
- Inspect the server console — the full error object is logged before rethrow.
- Treat RetryError as transient and let the framework retry.
- Verify FIREWORKS_API_KEY and the full model id (including the `accounts/fireworks/models/...` prefix).
- On repeated 429, raise the Fireworks tier or throttle the request rate.
- Check the Fireworks status page.
Defensive patterns
Strategy: retry
Validate before calling
// Validate the full namespaced Fireworks model id before streaming.
function assertFireworksModel(model) {
if (!/^accounts\/[\w-]+\/models\/[\w.-]+$/.test(model))
throw new Error(`Malformed Fireworks model id (expected accounts/<org>/models/<name>): ${model}`);
} Type guard
function isRetryableProviderError(e) {
return e instanceof OpenAI.RateLimitError || e instanceof OpenAI.InternalServerError || e instanceof OpenAI.APIError;
} Try / catch
// Stream path logs via console.error. Retry on RetryError.
try { return await provider.stream(messages, functions, handler); }
catch (e) {
if (e instanceof OpenAI.AuthenticationError) throw e;
if (e instanceof RetryError) return await backoffAndRetry();
throw e;
} Prevention
- Read server logs — the stream path console.errors the full object.
- Use the full `accounts/<org>/models/<name>` id; truncation causes APIError.
- Raise the Fireworks tier if RPM/TPM limits recur.
- Confirm FIREWORKS_API_KEY is valid; never retry auth.
When it happens
Trigger: Fireworks 429 (per-account RPM/TPM ceiling); 5xx platform incident; APIError from a malformed or unknown model id; stream interrupted mid-reply.
Common situations: FIREWORKS_API_KEY invalid or out of quota; model id truncated or missing the `accounts/fireworks/models/` prefix; peak-load throttling; Fireworks deploying a new model version.
Related errors
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/c383a25065c0a241.
Report an issue: GitHub.