Skip to content

[Feat] Implement VSR CLI tool for better user experience#824

Merged
JaredforReal merged 2 commits into
vllm-project:mainfrom
srini-abhiram:issue-234
Dec 19, 2025
Merged

[Feat] Implement VSR CLI tool for better user experience#824
JaredforReal merged 2 commits into
vllm-project:mainfrom
srini-abhiram:issue-234

Conversation

@srini-abhiram
Copy link
Copy Markdown
Contributor

Close #234

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Dec 14, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 4719518
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/69441a5f1afe540008e4141d
😎 Deploy Preview https://deploy-preview-824--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 14, 2025

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned:

📁 Root Directory

Owners: @rootfs, @Xunzhuo
Files changed:

  • README.md

📁 src

Owners: @rootfs, @Xunzhuo, @wangchen615
Files changed:

  • src/semantic-router/cmd/vsr/QUICKSTART.md
  • src/semantic-router/cmd/vsr/README.md
  • src/semantic-router/cmd/vsr/commands/completion.go
  • src/semantic-router/cmd/vsr/commands/completion_test.go
  • src/semantic-router/cmd/vsr/commands/config.go
  • src/semantic-router/cmd/vsr/commands/config_test.go
  • src/semantic-router/cmd/vsr/commands/dashboard.go
  • src/semantic-router/cmd/vsr/commands/dashboard_test.go
  • src/semantic-router/cmd/vsr/commands/debug.go
  • src/semantic-router/cmd/vsr/commands/debug_test.go
  • src/semantic-router/cmd/vsr/commands/deploy.go
  • src/semantic-router/cmd/vsr/commands/deploy_test.go
  • src/semantic-router/cmd/vsr/commands/get.go
  • src/semantic-router/cmd/vsr/commands/get_test.go
  • src/semantic-router/cmd/vsr/commands/http_timeout_test.go
  • src/semantic-router/cmd/vsr/commands/install.go
  • src/semantic-router/cmd/vsr/commands/install_test.go
  • src/semantic-router/cmd/vsr/commands/model.go
  • src/semantic-router/cmd/vsr/commands/model_test.go
  • src/semantic-router/cmd/vsr/commands/signal_handling_test.go
  • src/semantic-router/cmd/vsr/commands/status.go
  • src/semantic-router/cmd/vsr/commands/status_test.go
  • src/semantic-router/cmd/vsr/commands/test.go
  • src/semantic-router/cmd/vsr/commands/test_test.go
  • src/semantic-router/cmd/vsr/commands/upgrade.go
  • src/semantic-router/cmd/vsr/commands/upgrade_test.go
  • src/semantic-router/cmd/vsr/config/config.yaml
  • src/semantic-router/cmd/vsr/main.go
  • src/semantic-router/go.mod
  • src/semantic-router/go.sum
  • src/semantic-router/pkg/cli/debug/checker.go
  • src/semantic-router/pkg/cli/debug/checker_test.go
  • src/semantic-router/pkg/cli/deployment/deployment.go
  • src/semantic-router/pkg/cli/deployment/deployment_test.go
  • src/semantic-router/pkg/cli/deployment/helm.go
  • src/semantic-router/pkg/cli/deployment/paths_test.go
  • src/semantic-router/pkg/cli/deployment/pid_management_test.go
  • src/semantic-router/pkg/cli/deployment/upgrade.go
  • src/semantic-router/pkg/cli/model/manager.go
  • src/semantic-router/pkg/cli/model/manager_test.go
  • src/semantic-router/pkg/cli/output.go
  • src/semantic-router/pkg/cli/validator.go
  • src/semantic-router/pkg/cli/validator_test.go
  • src/semantic-router/pkg/config/config.go
  • src/semantic-router/pkg/k8s/reconciler.go

📁 tools

Owners: @yuluo-yx, @rootfs, @Xunzhuo
Files changed:

  • tools/make/build-run-test.mk

📁 website

Owners: @Xunzhuo, @rootfs, @yuluo-yx
Files changed:

  • website/docs/cli/commands-reference.md
  • website/docs/cli/overview.md
  • website/docs/cli/troubleshooting.md

vLLM

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

@srini-abhiram srini-abhiram force-pushed the issue-234 branch 3 times, most recently from 263f97f to c0b0f07 Compare December 14, 2025 15:03
@rootfs
Copy link
Copy Markdown
Collaborator

rootfs commented Dec 15, 2025

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

@srini-abhiram
Copy link
Copy Markdown
Contributor Author

srini-abhiram commented Dec 16, 2025

Test-and-build failing due to cuda errors I believe.

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

Yes, I will create a walkthrough. Here's the link to it: https://asciinema.org/a/0Ve0r8qqsJssUuLmUuESL0PsK .
Few things to mention: in the walkthrough the test-prompt uses port 8080 (not opened in compose), the main cmds all follow the happypath. PTAL, thanks! @rootfs

@rootfs
Copy link
Copy Markdown
Collaborator

rootfs commented Dec 16, 2025

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

rootfs
rootfs previously approved these changes Dec 16, 2025
@JaredforReal
Copy link
Copy Markdown
Collaborator

@srini-abhiram @rootfs a solid and great work! Thanks!

The CI error should disappear after "Update branch".

JaredforReal
JaredforReal previously approved these changes Dec 16, 2025
@JaredforReal
Copy link
Copy Markdown
Collaborator

@srini-abhiram current CI errors come from new test file in this PR, can u fix it~?

@srini-abhiram
Copy link
Copy Markdown
Contributor Author

srini-abhiram commented Dec 17, 2025

@JaredforReal for sure, I will fix those CI errors. And also update the docs in upcoming PR.

@srini-abhiram
Copy link
Copy Markdown
Contributor Author

@JaredforReal the cli tests have a dependency on ibcandle_semantic_router.so , should we split the tests of cli and exclude it from test-semantic-router section?
CGO_ENABLED should be 0, because the cli tests dont need it.

@JaredforReal
Copy link
Copy Markdown
Collaborator

JaredforReal commented Dec 18, 2025

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

srini-abhiram added a commit to srini-abhiram/semantic-router that referenced this pull request Dec 18, 2025
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>
@srini-abhiram srini-abhiram dismissed stale reviews from JaredforReal and rootfs via b2196dc December 18, 2025 13:03
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>
@srini-abhiram
Copy link
Copy Markdown
Contributor Author

@JaredforReal ,The current CI errors are unrelated to the PR, can we re-run them?

@JaredforReal
Copy link
Copy Markdown
Collaborator

@srini-abhiram trying!

@JaredforReal
Copy link
Copy Markdown
Collaborator

@srini-abhiram all green! ready to merge?

@srini-abhiram
Copy link
Copy Markdown
Contributor Author

srini-abhiram commented Dec 19, 2025

@srini-abhiram all green! ready to merge?

@JaredforReal Thanks for re running, please proceed i'm done with the changes.

@JaredforReal JaredforReal merged commit a500d46 into vllm-project:main Dec 19, 2025
42 of 44 checks passed
@samzong
Copy link
Copy Markdown
Collaborator

samzong commented Dec 19, 2025

@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

wilsonwu pushed a commit to wilsonwu/semantic-router that referenced this pull request Dec 23, 2025
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.

Add VSR CLI Support for Enhanced User Experience

7 participants