Automatic Retries
Last updated
Was this helpful?
Last updated
Was this helpful?
This feature is available on all Portkey .
LLM APIs often have inexplicable failures. With Portkey, you can rescue a substantial number of your requests with our in-built automatic retries feature.
Automatic retries are triggered up to 5 times
Retries can also be triggered only on specific error codes
And each subsequent retry attempt follows exponential backoff strategy to prevent network overload
To enable retry, just add the retry
param to your .
By default, Portkey triggers retries on the following error codes: [429, 500, 502, 503, 504]
You can change this behaviour by setting the optional on_status_codes
param in your retry config and manually inputting the error codes on which rety will be triggered.
Here's how Portkey triggers retries following exponential backoff:
Initial Call
Immediately
Retry 1st attempt
1 second
Retry 2nd attempt
2 seconds
Retry 3rd attempt
4 seconds
Retry 4th attempt
8 seconds
Retry 5th attempt
16 seconds