Spaces:
Sleeping
Sleeping
Increase exponential backoff from 3s to 5s base
Browse filesBackoffs now: 5s, 10s, 20s (was 3s, 6s, 12s)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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 =
|
| 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) #
|
| 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
|