vercel/ai · error

Fireworks image generation timed out after ${pollTimeoutMill

Error message

Fireworks image generation timed out after ${pollTimeoutMillis}ms

What it means

The Fireworks image model polls with a bounded total wait (pollTimeoutMillis). If the request never reaches a terminal state within that budget, the loop exits and throws this timeout Error. It reflects Fireworks-side processing taking longer than the client is willing to wait.

Source

Thrown at packages/fireworks/src/fireworks-image-model.ts:382

        if (typeof imageUrl === 'string') {
          return imageUrl;
        }
        throw new Error(
          'Fireworks poll response is Ready but missing result.sample',
        );
      }

      if (status === 'Error' || status === 'Failed') {
        throw new Error(
          `Fireworks image generation failed with status: ${status}`,
        );
      }

      // Wait before next poll attempt
      await delay(pollIntervalMillis);
    }

    throw new Error(
      `Fireworks image generation timed out after ${pollTimeoutMillis}ms`,
    );
  }
}

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Increase the image model's timeout configuration (maxPollTimeoutMillis / pollTimeoutMillis option)
  2. Retry the request, ideally with fewer concurrent generations
  3. Reduce image size/steps to shorten generation time
  4. Check Fireworks status for capacity incidents

Example fix

// before
const model = fireworks.image('accounts/fireworks/models/flux1-dev-fp8');
// after
const model = fireworks.image('accounts/fireworks/models/flux1-dev-fp8', {
  maxPollTimeoutMillis: 120_000,
});
Defensive patterns

Strategy: retry

Validate before calling

// configure a timeout proportional to generation cost before calling
const isExpensive = (opts.steps ?? 28) > 28 || opts.size?.includes('2048');
const timeoutMs = isExpensive ? 180_000 : 60_000;

Type guard

function isFireworksPollTimeout(e: unknown): boolean {
  return e instanceof Error && e.message.startsWith('Fireworks image generation timed out after');
}

Try / catch

try {
  return await generateImage({ model, prompt });
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Fireworks image generation timed out after')) {
    return retryWithLargerTimeout(() => generateImage({ model, prompt }));
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling `fireworks.image(...).doGenerate` where the generation request stays queued/InFlight longer than pollTimeoutMillis (default configured in the model) — overloaded Fireworks queue or very large/expensive generation.

Common situations: Generating many images concurrently causing queue delays; very high resolution or many-step generations; Fireworks capacity issues; too-short timeout configured for the chosen model.

Understand the failure class

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/c871f538738c058a. Report an issue: GitHub.