Skip to content

[Feat][Router]: add fallback model support#921

Draft
max-wittig wants to merge 1 commit intovllm-project:mainfrom
max-wittig:feat/fallback-model-support
Draft

[Feat][Router]: add fallback model support#921
max-wittig wants to merge 1 commit intovllm-project:mainfrom
max-wittig:feat/fallback-model-support

Conversation

@max-wittig
Copy link
Copy Markdown
Contributor

@max-wittig max-wittig commented Apr 16, 2026

When all backends for a model are unavailable (either health-checked away or all attempts errored out), requests automatically fall through to a configured fallback model. The model name in the request body is rewritten so downstream gateways (e.g. Envoy AI Gateway routing to Bedrock) receive the correct model identifier.

Config: per-model fallback_model in YAML, or --static-fallback-models CLI flag.


  • Make sure the code changes pass the pre-commit checks.
  • Sign-off your commit by using -s when doing git commit
  • Try to classify PRs for easy understanding of the type of changes, such as [Bugfix], [Feat], and [CI].
Detailed Checklist (Click to Expand)

Thank you for your contribution to production-stack! Before submitting the pull request, please ensure the PR meets the following criteria. This helps us maintain the code quality and improve the efficiency of the review process.

PR Title and Classification

Please try to classify PRs for easy understanding of the type of changes. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:

  • [Bugfix] for bug fixes.
  • [CI/Build] for build or continuous integration improvements.
  • [Doc] for documentation fixes and improvements.
  • [Feat] for new features in the cluster (e.g., autoscaling, disaggregated prefill, etc.).
  • [Router] for changes to the vllm_router (e.g., routing algorithm, router observability, etc.).
  • [Misc] for PRs that do not fit the above categories. Please use this sparingly.

Note: If the PR spans more than one category, please include all relevant prefixes.

Code Quality

The PR need to meet the following code quality standards:

  • Pass all linter checks. Please use pre-commit to format your code. See README.md for installation.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Please include sufficient tests to ensure the change is stay correct and robust. This includes both unit tests and integration tests.

DCO and Signed-off-by

When contributing changes to this project, you must agree to the DCO. Commits must include a Signed-off-by: header which certifies agreement with the terms of the DCO.

Using -s with git commit will automatically add this header.

What to Expect for the Reviews

We aim to address all PRs in a timely manner. If no one reviews your PR within 5 days, please @-mention one of YuhanLiu11
, Shaoting-Feng or ApostaC.

@max-wittig max-wittig force-pushed the feat/fallback-model-support branch from 72719ea to f7e182f Compare April 16, 2026 15:33
@max-wittig max-wittig changed the title feat(vllm-router): add fallback model support [Feat][Router]: add fallback model support Apr 16, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements fallback model support, enabling the router to redirect requests to an alternative model when primary backends are unhealthy or fail after multiple attempts. The implementation includes updates to documentation, configuration parsing for CLI and YAML, and the core routing logic. Review feedback highlights opportunities to improve the request rewriting process by updating the request body in-place to avoid synchronization issues with stale data. Additionally, it is recommended to refactor the fallback execution logic to reduce code duplication and ensure that fallback models utilize the same robust retry mechanisms as primary models.

Comment thread src/vllm_router/services/request_service/request.py Outdated
Comment thread src/vllm_router/services/request_service/request.py Outdated
Comment thread src/vllm_router/services/request_service/request.py Outdated
Comment thread src/vllm_router/services/request_service/request.py Outdated
Comment thread src/vllm_router/services/request_service/request.py
@max-wittig max-wittig force-pushed the feat/fallback-model-support branch 6 times, most recently from 397d57b to 2361c30 Compare April 17, 2026 13:40
…ode reboots

When all backends for a model are unavailable (either health-checked away
or all attempts errored out), requests automatically fall through to a
configured fallback model. The model name in the request body is rewritten
so downstream gateways (e.g. Envoy AI Gateway routing to Bedrock) receive
the correct model identifier.

Config: per-model fallback_model in YAML, or --static-fallback-models CLI flag.
Signed-off-by: Max Wittig <max.wittig@siemens.com>
@max-wittig max-wittig force-pushed the feat/fallback-model-support branch from 2361c30 to fd97ff7 Compare April 17, 2026 13:47
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