Skip to content

Conversation

@srini-abhiram
Copy link
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

…llm-project#713)

Fixes two critical bugs causing keyword routing E2E test failures:

1. **Config merge bug**: Embedded struct assignment in reconciler didn't copy
   IntelligentRouting fields correctly. Changed to explicit field-by-field copy
   to ensure keyword rules are properly loaded from CRDs.

2. **Cache hit headers bug**: Cache responses used ImmediateResponse which
   bypassed normal header processing, causing VSR decision headers to be missing.
   Added vsrDecisionName parameter to CreateCacheHitResponse() to include
   x-vsr-selected-decision header in cached responses.

**Test Results:**
- keyword-routing: 16.67% -> 100%
- rule-condition-logic: 33.33% -> 83.33% (remaining failure is unrelated)

Fixes vllm-project#713

Signed-off-by: Srinivas A <[email protected]>
Implements the initial version of the VSR CLI with the following commands: config, deploy, get, install, logs, status, test-prompt.

- Added Cobra-based CLI structure

- Implemented configuration management

- Added deployment support for Local, Docker, and Kubernetes

- Added documentation in website/docs/cli
…ssue vllm-project#234)

Completes the VSR CLI tool implementation with all remaining commands, comprehensive test coverage, and full documentation.

- Added model management commands (list, info, validate, remove, download)
- Added debug and diagnostics commands (debug, health, diagnose)
- Added monitoring commands (dashboard, metrics)
- Added utility commands (completion, upgrade, undeploy)
- Implemented Helm deployment support (4th deployment environment)
- Added comprehensive test coverage (15 test files, 109 test functions, 93+ test cases)
- Created detailed documentation (README, quick start guide, test coverage report)
- Enhanced deployment lifecycle with graceful shutdown and health checks
- Implemented multi-environment auto-detection for status and logs
- Added shell completion support for bash, zsh, fish, and powershell

Signed-off-by: Srinivas A <[email protected]>
Updates the main README with detailed VSR CLI usage instructions,
replacing the previous brief CLI section with comprehensive guidance.

- Added installation instructions with verification step
- Added quick start guide (4 commands to deploy)
- Listed key features (multi-environment, model management, monitoring)
- Provided common command examples with descriptions
- Added links to detailed CLI documentation and quick start guide

This provides users with a clear entry point to the VSR CLI tool
and highlights its capabilities for simplified deployment and management.

Signed-off-by: Srinivas A <[email protected]>
This commit addresses 6 critical issues identified during code review,
plus build improvements for better user experience.

Critical fixes:
- Issue vllm-project#1: PID file race condition - kill router process if PID file
  write fails to prevent untrackable processes
- Issue vllm-project#2: Cross-platform compatibility - replace hardcoded /tmp paths
  with os.TempDir() and add user-specific suffixes using os.Getuid()
- Issue vllm-project#3: Signal handling - add graceful shutdown for port-forward
  process on Ctrl+C to prevent orphaned kubectl processes
- Issue vllm-project#4: HTTP timeout - add 30-second timeout to prevent hanging
  requests in test command
- Issue vllm-project#5: Security - restrict log/PID file permissions to 0600
- Issue vllm-project#6: Input validation - enforce 10k character limit on prompts

Build improvements:
- Embed library path using -ldflags="-r" to eliminate need for users
  to manually set LD_LIBRARY_PATH when running vsr binary

Files modified:
- src/semantic-router/pkg/cli/deployment/deployment.go
- src/semantic-router/pkg/cli/deployment/upgrade.go
- src/semantic-router/cmd/vsr/commands/dashboard.go
- src/semantic-router/cmd/vsr/commands/test.go
- tools/make/build-run-test.mk
- src/semantic-router/pkg/cli/deployment/deployment_test.go

All fixes have been verified with standalone test programs.

Signed-off-by: Srinivas A <[email protected]>
Add unit tests to verify all 6 critical production fixes implemented
in the previous commit. Tests ensure cross-platform compatibility,
security, and robustness of the VSR CLI tool.

Test coverage added:
- Cross-platform path handling (Issue vllm-project#2)
  * Absolute path validation
  * User-specific path generation
  * Temp directory usage

- PID file management and security (Issues vllm-project#1, vllm-project#5)
  * PID file race condition handling
  * Process termination on write failure
  * Restrictive 0600 file permissions
  * Proper cleanup on exit

- HTTP client timeout (Issue vllm-project#4)
  * 30-second timeout prevents hanging
  * Fast responses unaffected
  * Timeout configuration validation

- Input validation (Issue vllm-project#6)
  * 10k character limit enforcement
  * Boundary condition testing

- Signal handling (Issue vllm-project#3)
  * Graceful shutdown on interrupt
  * Process cleanup verification
  * No orphaned processes

All tests compile and validate the production fixes.

Signed-off-by: Srinivas A <[email protected]>
Replace 'Issue #X' comments with clear, descriptive explanations of test
functionality to improve code maintainability and prevent confusion with
GitHub issue tracking. Remove generated test coverage report.

Signed-off-by: Srinivas A <[email protected]>
Ignore the config/config.yaml file as it is generated by 'vsr init' and contains environment-specific settings. This prevents accidental commits of local or sensitive configuration.

Signed-off-by: Srinivas A <[email protected]>
@netlify
Copy link

netlify bot commented Dec 2, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 2fb8406
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/692eb9f696d30300086d6397
😎 Deploy Preview https://deploy-preview-757--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

github-actions bot commented Dec 2, 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:

  • .gitignore
  • README.md

📁 config

Owners: @rootfs, @Xunzhuo
Files changed:

  • config/config.yaml

📁 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/extproc/req_filter_cache.go
  • src/semantic-router/pkg/k8s/reconciler.go
  • src/semantic-router/pkg/utils/http/response.go
  • src/semantic-router/pkg/utils/http/response_test.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.

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

4 participants