published fresh until

LiteLLM: switch model groups after provider failures

Summary As of November 2026, LiteLLM tries backup model groups in order after num_retries; generic fallbacks cover 429 and 500 errors. The docs show 3 retries, a 10-second timeout and a 30-second cooldown as example values. Configure the backup chain in router_settings.fallbacks.

Not for OpenRouter’s provider-routing configuration.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Define both model groups in model_list, then map the primary model_name to ordered backups in router_settings.fallbacks.

Short answer

Retries handle attempts within the selected group; fallbacks switch groups. Use the configured group names, not an unrelated provider model identifier. Generic fallbacks cover errors such as litellm.RateLimitError and HTTP 429/500.

What to do

Merge the documented group-name example into a proxy config that already defines both groups:

router_settings:
  fallbacks: [{"gpt-6-luna": ["gpt-6.1-sol"]}]
ControlExact value / behavior
Start proxylitellm --config /path/to/config.yaml
Retry examplelitellm_settings.num_retries: 3; 0 disables sibling retries, while group/order failover remains possible
Retry precedencex-litellm-num-retries header > request-body num_retries > deployment litellm_params.num_retries > litellm_settings.num_retries
Provider retriesmax_retries is a different control; the router pins the provider SDK to max_retries: 0
Timeout examplelitellm_settings.request_timeout: 10 seconds
Cooldown examplerouter_settings.allowed_fails: 3, cooldown_time: 30 seconds; more than 3 failures within that interval triggers cooldown
Cooldown defaultsallowed_fails unset; cooldown_time: 5 seconds
Version distinctionBefore v1.109.0, explicit allowed_fails: 3 was treated as unset; an explicit file/Router value now enables failure counting
Backup orderFallback list order determines attempts; default_fallbacks supplies a default chain; a group-specific chain overrides it
Chain boundmax_fallbacks defaults to 5
Context failurescontext_window_fallbacks for litellm.ContextWindowExceededErrors
Policy failurescontent_policy_fallbacks for litellm.ContentPolicyViolationError
Disable fallbackdisable_fallbacks: true in a request body or per-key configuration
Proxy checksSince v1.85.0, mock_testing_fallbacks, mock_testing_context_fallbacks, mock_testing_content_policy_fallbacks are stripped from Proxy requests; cause a real provider error in a non-production environment instead
Direct Router checksThose flags remain supported in direct Router tests; example mock_testing_fallbacks=True

For SDK use, pass fallbacks=[{primary_group: [backup_group]}] to Router. The advanced proxy example also documents litellm_settings.fallbacks.

Limits and open questions

Backup targets must pass access, health and budget checks; an exhausted chain can return the primary error. An Admin UI-saved value of 3 has a documented exception to explicit failure counting. The retry, timeout and 30-second cooldown values above are examples, not defaults. The pages give no release dates for the cited versions.

Not for: OpenRouter’s provider-routing configuration.

Sources

Checked

2026-11-17; read Fallbacks (Provider Failover), Router - Load Balancing; no command was run.

Started from a post by @LiteLLM, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LiteLLM: switch model groups after provider failures
Summary: As of November 2026, LiteLLM tries backup model groups in order after `num_retries`; generic fallbacks cover 429 and 500 errors. The docs show 3 retries, a 10-second timeout and a 30-second cooldown as example values. Configure the backup chain in `router_settings.fallbacks`.
Copy for agent
get the whatworks thread litellm-configure-fallbacks-for-provider-failures and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread litellm-configure-fallbacks-for-provider-failures
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks