[Feat] Implement VSR CLI tool for better user experience#824
Conversation
✅ Deploy Preview for vllm-semantic-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁
|
263f97f to
c0b0f07
Compare
|
@srini-abhiram Thanks for the work! Can you record a demo so we can use it for the code review? You can use https://asciinema.org/ or youtube. |
|
Test-and-build failing due to cuda errors I believe.
Yes, I will create a walkthrough. Here's the link to it: https://asciinema.org/a/0Ve0r8qqsJssUuLmUuESL0PsK . |
|
@srini-abhiram this looks so cool! @Xunzhuo @yuluo-yx @samzong @JaredforReal this could be a nice CLI option in addition to dashboard, especially for automation. WDYT? |
|
@srini-abhiram @rootfs a solid and great work! Thanks! The CI error should disappear after "Update branch". |
|
@srini-abhiram current CI errors come from new test file in this PR, can u fix it~? |
|
@JaredforReal for sure, I will fix those CI errors. And also update the docs in upcoming PR. |
|
@JaredforReal the cli tests have a dependency on |
|
@srini-abhiram yes, maybe we can do something like: # cli tests
CGO_ENABLED=0 go test ./cmd/vsr/...
# semantic-router core test
CGO_ENABLED=1 go test ./pkg/extproc/...this may get things more clear~ |
This commit fixes CI test-and-build failures for PR vllm-project#824 by addressing two root causes: 1. **CGO Dependency Chain**: CLI tests have transitive CGO dependencies through pkg/cli/model → pkg/classification → candle-binding, requiring the Rust shared library (libcandle_semantic_router.so) at compile time. 2. **Test Execution Strategy**: Split test targets to avoid duplication and ensure proper build dependencies are met. Changes: - tools/make/build-run-test.mk: * Added test-cli target that depends on build-router and sets LD_LIBRARY_PATH * Modified test-semantic-router to exclude CLI tests using grep -v '/cmd/vsr' * Updated main test target to run both test-cli and test-semantic-router * Enhanced build-cli to inject version, commit hash, and build date - Fixed 6 CLI test bugs found during validation: * model.go: Fixed Short description text mismatch * model_test.go: Added missing output flag initialization * completion.go: Added OnlyValidArgs validator for shell argument * config_test.go: Use Name() instead of Use for subcommand matching * debug.go: Fixed Short description text * signal_handling_test.go: Added cmd.Wait() after Process.Kill() All CLI tests now pass successfully with proper CGO setup. Local CI validation confirms critical tests pass. Resolves vllm-project#234 Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
b2196dc
This PR introduces the VSR (vLLM Semantic Router) CLI tool - a comprehensive command-line interface that reduces setup time from hours to minutes and provides a unified interface for deployment, monitoring, and troubleshooting across multiple environments. ## Key Features ### Core Commands - **deploy**: Multi-environment deployment (Local, Docker Compose, Kubernetes, Helm) - **config**: Configuration management with validation and templates - **model**: Model lifecycle management (download, list, validate, remove, inspect) - **status**: Health monitoring and status checks - **debug**: Interactive debugging and diagnostic tools - **dashboard**: Dashboard management and access - **test**: Prompt testing and validation - **upgrade**: Seamless version upgrades - **get**: Resource inspection (logs, pods, services) ### Implementation Details - Built with Go and Cobra framework for robust CLI experience - Comprehensive test coverage with 3,400+ lines of test code - Support for multiple deployment targets with environment detection - Process lifecycle management with orphan process prevention - Integrated health checking and diagnostics - Shell completion support (bash, zsh, fish, powershell) ### Documentation - Complete CLI documentation with quickstart guide - Command reference with examples - Troubleshooting guide - Integration with existing semantic-router documentation ### Files Changed - 49 files changed, 11,531 insertions(+), 16 deletions(-) - New CLI implementation in src/semantic-router/cmd/vsr/ - New CLI packages in src/semantic-router/pkg/cli/ - Documentation in website/docs/cli/ - Build system integration in tools/make/build-run-test.mk Resolves vllm-project#234 Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
This commit fixes CI test-and-build failures for PR vllm-project#824 by addressing two root causes: 1. **CGO Dependency Chain**: CLI tests have transitive CGO dependencies through pkg/cli/model → pkg/classification → candle-binding, requiring the Rust shared library (libcandle_semantic_router.so) at compile time. 2. **Test Execution Strategy**: Split test targets to avoid duplication and ensure proper build dependencies are met. Changes: - tools/make/build-run-test.mk: * Added test-cli target that depends on build-router and sets LD_LIBRARY_PATH * Modified test-semantic-router to exclude CLI tests using grep -v '/cmd/vsr' * Updated main test target to run both test-cli and test-semantic-router * Enhanced build-cli to inject version, commit hash, and build date - Fixed 6 CLI test bugs found during validation: * model.go: Fixed Short description text mismatch * model_test.go: Added missing output flag initialization * completion.go: Added OnlyValidArgs validator for shell argument * config_test.go: Use Name() instead of Use for subcommand matching * debug.go: Fixed Short description text * signal_handling_test.go: Added cmd.Wait() after Process.Kill() All CLI tests now pass successfully with proper CGO setup. Local CI validation confirms critical tests pass. Resolves vllm-project#234 Signed-off-by: Srinivas A <56465971+srini-abhiram@users.noreply.github.com>
cd6f33d to
4719518
Compare
|
@JaredforReal ,The current CI errors are unrelated to the PR, can we re-run them? |
|
@srini-abhiram trying! |
|
@srini-abhiram all green! ready to merge? |
@JaredforReal Thanks for re running, please proceed i'm done with the changes. |
|
@srini-abhiram This is great. This is a big progress. Can you contact me on slack? or join slack: https://join.slack.com/t/vllm-dev/shared_invite/zt-3lrh7gw29-MPJdxpIdGnWsFji5qu24ow |
…t#824) Signed-off-by: Wilson Wu <iwilsonwu@gmail.com>

Close #234
-swhen doinggit commit[Bugfix],[Feat], and[CI].Detailed Checklist (Click to Expand)
Thank you for your contribution to semantic-router! 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 thevllm_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:
pre-committo format your code. SeeREADME.mdfor installation.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
-swithgit commitwill automatically add this header.What to Expect for the Reviews