Skip to content

Add an override inner field to support override extra config#2605

Merged
maobaolong merged 2 commits intoLMCache:devfrom
maobaolong:extra_config_override
Feb 18, 2026
Merged

Add an override inner field to support override extra config#2605
maobaolong merged 2 commits intoLMCache:devfrom
maobaolong:extra_config_override

Conversation

@maobaolong
Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

This PR introduce a way to reset Prometheus metrics. It introduces dedicated methods within the PrometheusLogger to clear and re-register counters and histograms, and exposes this functionality through a new API endpoint. This allows for easier management and debugging of metric data, particularly in environments where metrics need to be reset periodically or on demand.

Special notes for your reviewers:

If applicable:

  • this PR contains user facing changes - docs added
  • this PR contains unit tests

…equest !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @maobaolong, 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 refines the configuration management logic within the lmcache system, specifically enhancing how extra_config values are processed. It introduces more granular control over configuration updates, allowing for explicit overriding or merging of extra_config based on the override parameter. This change improves the predictability and flexibility of applying configuration settings, particularly when integrating with external systems like vLLM.

Highlights

  • Enhanced Configuration Handling: Refactored the validate_and_set_config_value function to provide more explicit and robust handling for extra_config values, differentiating between full overrides and merge operations.
  • Granular extra_config Control: Introduced distinct logic paths for extra_config based on the override parameter: override=True now performs a complete replacement, while override=False intelligently merges dictionary values or sets the value if the current one is not a dictionary.
  • Improved Logging: Updated logging messages across configuration updates for better clarity, including a new log entry when a configuration item is successfully set.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • lmcache/integration/vllm/vllm_v1_adapter.py
    • Simplified the log message when updating config from vLLM extra config.
  • lmcache/v1/config_base.py
    • Updated the docstring for the override parameter in validate_and_set_config_value to clarify its behavior for extra_config and other keys.
    • Rewrote the logic for handling extra_config within validate_and_set_config_value to clearly differentiate between full override (when override is True) and merge behavior (when override is False).
    • Added a new log message when a configuration item is successfully set.
Activity
  • No human activity has been recorded on this pull request yet.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

The pull request description seems to be from a different PR, as it mentions Prometheus metrics, while the changes are focused on improving the configuration override logic. The changes refactor how extra_config is handled, making the logic clearer and more robust, especially with the new override behavior. I've provided a couple of suggestions to further improve the code's readability and observability.

Comment thread lmcache/v1/config_base.py
Comment thread lmcache/v1/config_base.py
Copy link
Copy Markdown
Contributor

@sammshen sammshen left a comment

Choose a reason for hiding this comment

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

LGTM!

@maobaolong
Copy link
Copy Markdown
Collaborator Author

@chunxiaozheng Would you like to take a look at this PR? Thanks!

@maobaolong maobaolong added the full Run comprehensive tests on this PR label Feb 16, 2026
@maobaolong maobaolong enabled auto-merge (squash) February 16, 2026 14:39
Copy link
Copy Markdown
Collaborator

@chunxiaozheng chunxiaozheng left a comment

Choose a reason for hiding this comment

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

lgtm

@maobaolong maobaolong merged commit d6798cc into LMCache:dev Feb 18, 2026
73 checks passed
DongDongJu pushed a commit to DongDongJu/LMCache that referenced this pull request Feb 22, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: DongDongJu <commisori28@gmail.com>
DongDongJu pushed a commit to DongDongJu/LMCache that referenced this pull request Feb 22, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
sammshen pushed a commit to sammshen/LMCache that referenced this pull request Mar 1, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
hlin99 pushed a commit to hlin99/LMCache that referenced this pull request Mar 2, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
…#2605)

* Add an override inner field to support override extra config (merge request !23)

Squash merge branch 'merge_extra_config' into 'remote-backend-0120'

* Add an override inner field to support override extra config

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

* Fix validate_and_set_config_value override logic

- Fixed extra_config handling: now respects the override parameter correctly
  * When override=True: completely replaces the config value
  * When override=False: merges dict values, keeps current if new is None/empty
- Fixed basic config handling: return True (not False) when skipping user-set keys
  with override=False
- All 46 test_config.py tests now pass

Signed-off-by: baoloongmao <baoloongmao@tencent.com>

---------

Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants