[CLI] Implement initial framework of LMCache CLI#2775
Conversation
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Summary of ChangesHello, 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 lays the foundational framework for the LMCache command-line interface, enabling a structured and extensible approach to managing LMCache components. It introduces a clear mechanism for defining and registering new subcommands, along with a sophisticated, yet lightweight, system for collecting and presenting operational metrics in both human-friendly and machine-parseable formats. This significantly streamlines the process of adding future CLI functionalities and provides users with consistent, informative feedback. Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-designed and robust framework for the LMCache CLI. The move to explicit command registration via BaseCommand improves maintainability, and the hierarchical Metrics system provides a flexible way to handle both human-readable terminal output and machine-readable JSON output. The new lmcache mock command serves as a great reference for adding new subcommands. The overall implementation is clean and well-documented. I have one suggestion to improve the consistency of the mock command's output.
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
…ior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu> Signed-off-by: Aaron Wu <aaron.wu@dell.com>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
* initial commit --- implemented the CLI system Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add sphinx doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make linting happy Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix linter and clarify that url must be http Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * add formatter-handler separation, and make handler registration behavior aligned Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * update design doc Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * fix comments from Yihua Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * make sure that --format and --output are independent Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * clean up logic on getting the handler Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * avoid letting people add output args by themselves Signed-off-by: KuntaiDu <kuntai@uchicago.edu> * use logging.exception Signed-off-by: KuntaiDu <kuntai@uchicago.edu> --------- Signed-off-by: KuntaiDu <kuntai@uchicago.edu>
What this PR does / why we need it:
This PR implements LMCache CLI described in #2748 .
Summary
explicit registration via ALL_COMMANDS in commands/init.py
(for terminal), with pluggable rendering styles (defaulting to vLLM-style output), configurable via
LMCACHE_CLI_METRICS_STYLE env var through the centralized config system
Example usage
How to add a new subcommand
Special notes for your reviewers:
If applicable: