library · inferred from evidence
ModelRetryMiddleware
Middleware for retrying model calls with exponential backoff on retryable errors.
- Connection resilience: what LangChain retries automatically and what it does not
Chat models retry failed requests with exponential backoff automatically: up to 6 times for network errors, 429 rate limits, and 5xx server errors. 401 and 404 are never retried. Tune with max_retries and timeout.