Skip to content

feat: support fallback_models list for multi-provider cascade - #3815

Closed
zero-agent wants to merge 1 commit into
NousResearch:mainfrom
zero-agent:feat/fallback-model-chain
Closed

feat: support fallback_models list for multi-provider cascade#3815
zero-agent wants to merge 1 commit into
NousResearch:mainfrom
zero-agent:feat/fallback-model-chain

Conversation

@zero-agent

Copy link
Copy Markdown

Adds fallback_models (list) config support so multiple backup providers are tried in order when earlier ones fail.

Config:

fallback_models:
  - provider: openai-codex
    model: gpt-5.4
  - provider: custom
    model: local-model
    base_url: http://localhost:8080/v1

Behavior: primary fails → try fallback 1 → if that also fails → try fallback 2 → … → give up.

Changes:

  • gateway/run.py: _load_fallback_model() reads fallback_models list, falls back to legacy fallback_model dict
  • run_agent.py: _try_activate_fallback() cycles through chain instead of one-shot
  • tests/test_fallback_chain.py: 27 new tests

Backward compatible — existing fallback_model config still works unchanged.

Add support for a `fallback_models` list in config.yaml so multiple
backup providers are tried in order when earlier ones fail:

    fallback_models:
      - provider: openai-codex
        model: gpt-5.4
      - provider: custom
        model: local-model
        base_url: http://localhost:8080/v1

When the primary fails after retries, the agent tries each fallback in
sequence. If the first fallback also fails (e.g. rate-limited), it
cascades to the next until all are exhausted.

Backward compatible: existing single `fallback_model` config still works.
@zero-agent

Copy link
Copy Markdown
Author

Closing — superseded by #3813 which was merged with the same feature (ordered fallback provider chain). Our implementation overlapped.

@zero-agent zero-agent closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant