vn6295337 Claude Opus 4.5 commited on
Commit
6810cb2
·
1 Parent(s): df1355a

Increase exponential backoff from 3s to 5s base

Browse files

Backoffs now: 5s, 10s, 20s (was 3s, 6s, 12s)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (1) hide show
  1. src/llm_client.py +2 -2
src/llm_client.py CHANGED
@@ -11,7 +11,7 @@ from typing import Optional, Tuple
11
 
12
  # Retry configuration for rate limits
13
  MAX_RETRIES = 3
14
- INITIAL_BACKOFF = 3 # seconds (backoffs: 3s, 6s, 12s)
15
 
16
 
17
  class LLMClient:
@@ -112,7 +112,7 @@ class LLMClient:
112
  if e.response is not None and e.response.status_code == 429:
113
  last_error = e
114
  if attempt < MAX_RETRIES - 1:
115
- backoff = INITIAL_BACKOFF * (2 ** attempt) # 2s, 4s, 8s
116
  print(f"Rate limited by {provider_name}, retrying in {backoff}s (attempt {attempt + 1}/{MAX_RETRIES})...")
117
  time.sleep(backoff)
118
  continue
 
11
 
12
  # Retry configuration for rate limits
13
  MAX_RETRIES = 3
14
+ INITIAL_BACKOFF = 5 # seconds (backoffs: 5s, 10s, 20s)
15
 
16
 
17
  class LLMClient:
 
112
  if e.response is not None and e.response.status_code == 429:
113
  last_error = e
114
  if attempt < MAX_RETRIES - 1:
115
+ backoff = INITIAL_BACKOFF * (2 ** attempt) # 5s, 10s, 20s
116
  print(f"Rate limited by {provider_name}, retrying in {backoff}s (attempt {attempt + 1}/{MAX_RETRIES})...")
117
  time.sleep(backoff)
118
  continue