Skip to content

Conversation

@antoineauger
Copy link
Contributor

@antoineauger antoineauger commented Jul 30, 2025

As discussed in #506 (comment), this PR adds support for a YAML config file.

See the updated documentation (or below) for an example of a YAML config file. The content of the YAML config has been aligned with the JSON one for consistency.

service_discovery: static
routing_logic: roundrobin
callbacks: module.custom.callback_handler
static_models:
    facebook/opt-125m:
        static_backends:
            - http://localhost:9001
            - http://localhost:9003
        static_model_type: completion
    meta-llama/Llama-3.1-8B-Instruct:
        static_backends:
            - http://localhost:9002
        static_model_type: chat

FIX #506

🛠️ with ❤️ by Siemens


  • 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.

Copy link
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.

Summary of Changes

Hello @antoineauger, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the router's configuration flexibility by introducing comprehensive support for YAML configuration files. This allows users to define dynamic router settings, including service discovery, routing logic, and static model configurations, using the YAML format, which can be particularly beneficial for managing complex configurations. The changes involve updates to argument parsing, config loading logic, and the addition of a new utility module for YAML-specific processing.

Highlights

  • YAML Configuration Support: Added the ability to load dynamic router configurations from YAML files via a new --dynamic-config-yaml command-line argument, providing an alternative to the existing JSON configuration.
  • Unified Config Loading and Parsing: Refactored the configuration loading mechanism to support both YAML and JSON formats, ensuring mutual exclusivity between the two config file options. New utility functions were implemented to parse structured YAML data (e.g., static_models and static_aliases with nested details) and convert them into the flat string formats expected by the router's internal arguments.
  • Documentation and Testing Updates: The README.md has been updated to reflect the new YAML configuration option, provide an example YAML config, and clarify the mutually exclusive nature of YAML and JSON config file arguments. Corresponding unit tests were added to validate the correct loading and processing of YAML configurations.
  • Dependency Addition: The pyyaml library has been included as a new project dependency to enable YAML parsing capabilities.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 PR adds valuable support for YAML configuration files, enhancing usability. The implementation correctly makes YAML and JSON configurations mutually exclusive.

I've identified a critical issue with a duplicated dataclass attribute that must be addressed. Additionally, the YAML example in the README is misleading due to the use of duplicate keys, which will lead to incorrect configurations. I've also provided suggestions to refactor the new YAML utility functions for better performance and adherence to Python idioms.

Overall, a great addition with a few key areas for improvement.

@antoineauger antoineauger changed the title [Feat][Config]: add extra support for YAML config file [Feat][Router]: add extra support for YAML config file Jul 30, 2025
@antoineauger antoineauger force-pushed the feat/yaml-config-file branch 3 times, most recently from 7513dfb to 582899a Compare July 30, 2025 15:50
@antoineauger
Copy link
Contributor Author

/gemini review

Copy link
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 introduces support for YAML configuration files for dynamic router configuration. I have identified a critical issue in the new YAML utility module that could cause the application to terminate unexpectedly, a high-severity bug where empty YAML files are not handled correctly, and a couple of medium-severity suggestions to improve code clarity and error handling.

@antoineauger
Copy link
Contributor Author

/gemini review

Copy link
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 introduces support for YAML configuration files, which enhances user flexibility. The implementation includes updates to handle both YAML and JSON formats, with corresponding documentation and tests. Review comments address an unused import and a potential issue with inconsistent static_model_type definitions in the YAML configuration.

@antoineauger antoineauger force-pushed the feat/yaml-config-file branch from 5344b6d to b6a956c Compare July 30, 2025 16:28
@antoineauger
Copy link
Contributor Author

/gemini review

Copy link
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 introduces support for YAML configuration files, which is a great addition for user-friendliness. The implementation is solid, with good separation of concerns in a new yaml_utils.py file, updated documentation, and new tests. The use of a mutually exclusive group for the YAML and JSON config file arguments is a nice touch. I have one suggestion to improve the robustness of the YAML parsing by adding type validation. Otherwise, the changes look good to me.

@antoineauger antoineauger force-pushed the feat/yaml-config-file branch from b6a956c to 2e51e9c Compare July 30, 2025 16:43
@antoineauger
Copy link
Contributor Author

@zerofishnoodles @YuhanLiu11 I did some review rounds with the AI, nice experience overall 🤖

Could you please take a look at this PR? Better to review it commit-by-commit, thanks!

/cc @max-wittig @nejch

@antoineauger antoineauger marked this pull request as ready for review July 30, 2025 16:50
Copy link
Collaborator

@zerofishnoodles zerofishnoodles left a comment

Choose a reason for hiding this comment

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

This feature looks super cool! Thanks for contributing! Can you fix the CI check issue, and then I think it is good to go.

@antoineauger antoineauger force-pushed the feat/yaml-config-file branch from c007c48 to fd8a5e0 Compare August 4, 2025 10:58
@antoineauger antoineauger force-pushed the feat/yaml-config-file branch from fd8a5e0 to e551f4d Compare August 4, 2025 11:00
Copy link
Contributor Author

@antoineauger antoineauger left a comment

Choose a reason for hiding this comment

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

@zerofishnoodles I fixed the CI check in e551f4d and also fixed a bug related to the static_aliases that I discovered while doing some more local tests (see 5b2581a)

Copy link
Collaborator

@zerofishnoodles zerofishnoodles left a comment

Choose a reason for hiding this comment

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

LGTM

@YuhanLiu11
Copy link
Collaborator

@antoineauger Can you merge the latest changes from main?

@antoineauger
Copy link
Contributor Author

@antoineauger Can you merge the latest changes from main?

@YuhanLiu11 Sure, done!

@YuhanLiu11 YuhanLiu11 merged commit 16e592e into vllm-project:main Aug 8, 2025
14 checks passed
@antoineauger antoineauger deleted the feat/yaml-config-file branch August 11, 2025 08:01
Senne-Mennes pushed a commit to Senne-Mennes/production-stack that referenced this pull request Oct 22, 2025
)

* feat(vllm-router): add support for --dynamic-config-yaml option

Signed-off-by: Antoine Auger <[email protected]>

* feat(vllm-router): watch dynamic config YAML file

Signed-off-by: Antoine Auger <[email protected]>

* docs(vllm-router): update README with dynamic config YAML file

Signed-off-by: Antoine Auger <[email protected]>

* feat(vllm-router): support callbacks defined in config files

Signed-off-by: Antoine Auger <[email protected]>

* feat(vllm-router): support static_model_types defined in config files

Signed-off-by: Antoine Auger <[email protected]>

* feat(discovery): do not perform health checks on missing info

Signed-off-by: Antoine Auger <[email protected]>

* fix(vllm-router): fix and document static_aliases for dynamic config files

Signed-off-by: Antoine Auger <[email protected]>

* ci: fix ruff check job

Signed-off-by: Antoine Auger <[email protected]>

---------

Signed-off-by: Antoine Auger <[email protected]>
Signed-off-by: [email protected] <[email protected]>
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.

feature(vllm-router): have a more readable config file for dynamic router config

4 participants