Skip to content

vllm-project/semantic-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
vLLM Semantic Router

Documentation Hugging Face License Crates.io Test And Build Ask DeepWiki

πŸ“š Complete Documentation | πŸš€ Quick Start | πŸ“£ Blog | πŸ“– Publications


Latest News πŸ”₯


Innovations ✨

architecture

Intelligent Routing 🧠

Auto-Selection of Models and LoRA Adapters

A Mixture-of-Models (MoM) router that intelligently directs OpenAI API requests to the most suitable models or LoRA adapters from a defined pool based on Semantic Understanding of the request's intent (Complexity, Task, Tools).

mom-overview

Conceptually similar to Mixture-of-Experts (MoE) which lives within a model, this system selects the best entire model for the nature of the task.

As such, the overall inference accuracy is improved by using a pool of models that are better suited for different types of tasks:

Model Accuracy

The router is implemented in two ways:

  • Golang (with Rust FFI based on the candle rust ML framework)
  • Python Benchmarking will be conducted to determine the best implementation.

Request Flow

architecture

Auto-Selection of Tools

Select the tools to use based on the prompt, avoiding the use of tools that are not relevant to the prompt so as to reduce the number of prompt tokens and improve tool selection accuracy by the LLM.

Domain Aware System Prompts

Automatically inject specialized system prompts based on query classification, ensuring optimal model behavior for different domains (math, coding, business, etc.) without manual prompt engineering.

Domain Aware Similarity Caching ⚑️

Cache the semantic representation of the prompt so as to reduce the number of prompt tokens and improve the overall inference latency.

Enterprise Security πŸ”’

PII detection

Detect PII in the prompt, avoiding sending PII to the LLM so as to protect the privacy of the user.

Prompt guard

Detect if the prompt is a jailbreak prompt, avoiding sending jailbreak prompts to the LLM so as to prevent the LLM from misbehaving. Can be configured globally or at the category level for fine-grained security control.

Quick Start πŸš€

Using VSR CLI (Recommended)

The vsr CLI tool provides a unified interface for managing the vLLM Semantic Router across all environments. It reduces setup time from hours to minutes with intelligent auto-detection, comprehensive diagnostics, and beautiful CLI output.

Installation

# Clone and build
cd semantic-router/src/semantic-router
make build-cli
export PATH=$PATH:$(pwd)/bin

# Verify installation
vsr --version

Get Started in 4 Commands

vsr init                    # Initialize configuration
make download-models        # Download AI models
vsr config validate        # Validate setup
vsr deploy docker          # Deploy with Docker Compose

Key Features

  • Multi-Environment Support: Deploy to Local, Docker, Kubernetes, or Helm
  • Model Management: Download, validate, list, and inspect models
  • Health Monitoring: Status checks, diagnostics, and health reports
  • Debug Tools: Interactive debugging and troubleshooting
  • Dashboard Integration: Auto-detect and open dashboard in browser
  • Enhanced Logging: Multi-environment log fetching with filtering

Common Commands

vsr status                  # Check deployment status
vsr logs --follow          # View logs in real-time
vsr health                 # Quick health check
vsr dashboard              # Open dashboard
vsr model list             # List available models
vsr debug                  # Run diagnostics
vsr upgrade docker         # Upgrade deployment
vsr undeploy docker        # Stop deployment

For complete CLI documentation, see src/semantic-router/cmd/vsr/README.md or Quick Start Guide.

Using Quickstart Script

Alternatively, get up and running in seconds with our interactive setup script:

bash ./scripts/quickstart.sh

This command will:

  • πŸ” Check all prerequisites automatically
  • πŸ“¦ Install HuggingFace CLI if needed
  • πŸ“₯ Download all required AI models (~1.5GB)
  • 🐳 Start all Docker services
  • ⏳ Wait for services to become healthy
  • 🌐 Show you all the endpoints and next steps

For detailed installation and configuration instructions, see the Complete Documentation.

Documentation πŸ“–

For comprehensive documentation including detailed setup instructions, architecture guides, and API references, visit:

πŸ‘‰ Complete Documentation at Read the Docs

The documentation includes:

Community πŸ‘‹

For questions, feedback, or to contribute, please join #semantic-router channel in vLLM Slack.

Community Meetings πŸ“…

We host bi-weekly community meetings to sync up with contributors across different time zones:

Join us to discuss the latest developments, share ideas, and collaborate on the project!

Citation

If you find Semantic Router helpful in your research or projects, please consider citing it:

@misc{semanticrouter2025,
  title={vLLM Semantic Router},
  author={vLLM Semantic Router Team},
  year={2025},
  howpublished={\url{https://github.com/vllm-project/semantic-router}},
}

Star History πŸ”₯

We opened the project at Aug 31, 2025. We love open source and collaboration ❀️

Star History Chart

Sponsors πŸ‘‹

We are grateful to our sponsors who support us:


AMD provides us with GPU resources and ROCmβ„’ Software for training and researching the frontier router models, enhancing e2e testing, and building online models playground.