Development Guide
This guide covers the prerequisites, setup, and testing procedures for the vLLM Semantic Router.
Prerequisitesâ
Ensure you have the following installed:
- Docker (or Podman)
- Make (for build automation)
- Python 3.10+ (recommended, for training and testing)
Quick Startâ
-
Clone the repository:
git clone https://github.com/vllm-project/semantic-router.git
cd semantic-router -
Start the development environment:
make vllm-sr-startThis single command handles everything:
- Builds the Docker image with all dependencies
- Downloads required models from Hugging Face
- Installs the
vllm-srCLI tool - Starts all services (semantic router, envoy, dashboard)
-
Install Python dependencies (Optional):
# For training and development
pip install -r requirements.txt
# For end-to-end testing
pip install -r e2e/testing/requirements.txt
Debugging Tipsâ
- Rust: Set
RUST_LOG=debug. - Go: Set
SR_LOG_LEVEL=debug.
Running Testsâ
Unit Testsâ
-
Rust bindings:
make test-binding -
Go Router:
make test-semantic-router -
Classifiers:
make test-category-classifier
make test-pii-classifier
make test-jailbreak-classifier
Manual Testingâ
Use these commands to test specific scenarios:
# Model auto-selection
make test-auto-prompt-no-reasoning
make test-auto-prompt-reasoning
make test-pii # PII detection
make test-prompt-guard # Jailbreak detection
make test-tools # Tools auto-selection
End-to-End Testsâ
Ensure services are running, then:
# Run all E2E tests
python e2e/testing/run_all_tests.py
# Run specific test
python e2e/testing/00-client-request-test.py