BerriAI/litellm · error · BlackForestLabsError
Polling timed out after {max_wait} seconds
Error message
Polling timed out after {max_wait} seconds What it means
Error "Polling timed out after {max_wait} seconds" thrown in BerriAI/litellm.
Source
Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:379
verbose_logger.debug("BFL poll status: %s", status)
if status == "Ready":
return response
elif status in [
"Error",
"Failed",
"Content Moderated",
"Request Moderated",
]:
raise BlackForestLabsError(
status_code=400,
message=f"Image generation failed: {status}",
)
time.sleep(interval)
raise BlackForestLabsError(
status_code=408,
message=f"Polling timed out after {max_wait} seconds",
)
async def _poll_for_result_async(
self,
initial_response: httpx.Response,
headers: dict,
async_client: AsyncHTTPHandler,
max_wait: float = DEFAULT_MAX_POLLING_TIME,
interval: float = DEFAULT_POLLING_INTERVAL,
timeout: float | httpx.Timeout | None = None,
) -> httpx.Response:
"""
Poll BFL API until result is ready (async version).
"""
# Validate initial response status code
if initial_response.status_code >= 400:View on GitHub (pinned to 6c2dcb801b)
Solutions
- Increase max_wait or check the BFL job status manually.
When it happens
Trigger: Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:379 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15).
Data as JSON: /api/errors/a845f48c7345cdc2.
Report an issue: GitHub.