Retry connection errors but never re-bill timeouts
num_retries=2 (retries transient connection errors), retry_policy with TimeoutErrorRetries=0 (a timed-out generation is already billed by Tinfoil, so re-hitting it re-bills). Combined with timeout=180, this hedges connection errors without the silent re-billing that caused the Tinfoil spend gap.
This commit is contained in:
1 parent
576885ed21
commit
d1f57c45d5
1 file changed
+8
-5
+8
-5
@@ -49,13 +49,16 @@ model_list:
|
|||||||
# NOTE: DeepSeek V4.1 Flash is a reasoning model — generations routinely run
|
# NOTE: DeepSeek V4.1 Flash is a reasoning model — generations routinely run
|
||||||
# longer than 30s. A 30s timeout caused LiteLLM to abandon in-flight DeepSeek
|
# longer than 30s. A 30s timeout caused LiteLLM to abandon in-flight DeepSeek
|
||||||
# requests (falling back to GPT-OSS), while Tinfoil still completed and billed
|
# requests (falling back to GPT-OSS), while Tinfoil still completed and billed
|
||||||
# the abandoned generation. num_retries amplified this by re-hitting Tinfoil up
|
# the abandoned generation. Result: Tinfoil billed ~2x the tokens LiteLLM logged.
|
||||||
# to 3x per request. Result: Tinfoil billed ~2x the tokens LiteLLM logged.
|
# Fix: a generous timeout (180s) so generations complete inside LiteLLM and get
|
||||||
# Fix: a generous timeout so generations complete inside LiteLLM (and get
|
# logged; and a retry_policy that retries transient connection errors (base
|
||||||
# logged), and zero retries so a slow/failed request is never re-billed.
|
# num_retries) but NEVER retries timeouts (TimeoutErrorRetries: 0) — a timed-out
|
||||||
|
# generation is already billed by Tinfoil, so re-hitting it re-bills.
|
||||||
router_settings:
|
router_settings:
|
||||||
num_retries: 0
|
num_retries: 2
|
||||||
timeout: 180
|
timeout: 180
|
||||||
|
retry_policy:
|
||||||
|
TimeoutErrorRetries: 0
|
||||||
fallbacks:
|
fallbacks:
|
||||||
- deepseek-v4-1-flash:
|
- deepseek-v4-1-flash:
|
||||||
- gpt-oss-120b
|
- gpt-oss-120b
|
||||||
|
|||||||
Reference in new issue
Block a user