Skip to content

Commit 135da0e

Browse files
authored
increase the default retries for LLM (#2986)
1 parent f689d5d commit 135da0e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

opendevin/core/config.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class LLMConfig:
3333
aws_secret_access_key: The AWS secret access key.
3434
aws_region_name: The AWS region name.
3535
num_retries: The number of retries to attempt.
36+
retry_multiplier: The multiplier for the exponential backoff.
3637
retry_min_wait: The minimum time to wait between retries, in seconds. This is exponential backoff minimum. For models with very low limits, this can be set to 15-20.
3738
retry_max_wait: The maximum time to wait between retries, in seconds. This is exponential backoff maximum.
3839
timeout: The timeout for the API.
@@ -57,9 +58,10 @@ class LLMConfig:
5758
aws_access_key_id: str | None = None
5859
aws_secret_access_key: str | None = None
5960
aws_region_name: str | None = None
60-
num_retries: int = 5
61+
num_retries: int = 10
62+
retry_multiplier: float = 2
6163
retry_min_wait: int = 3
62-
retry_max_wait: int = 60
64+
retry_max_wait: int = 300
6365
timeout: int | None = None
6466
max_message_chars: int = 10_000 # maximum number of characters in an observation's content when sent to the llm
6567
temperature: float = 0

opendevin/llm/llm.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ def attempt_on_error(retry_state):
117117
reraise=True,
118118
stop=stop_after_attempt(config.num_retries),
119119
wait=wait_random_exponential(
120-
min=config.retry_min_wait, max=config.retry_max_wait
120+
multiplier=config.retry_multiplier,
121+
min=config.retry_min_wait,
122+
max=config.retry_max_wait,
121123
),
122124
retry=retry_if_exception_type(
123125
(

0 commit comments

Comments
 (0)