diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a27a6688..3e0731a1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -10,7 +10,7 @@ on: jobs: pre-commit: runs-on: ubuntu-latest - name: Run pre-commit hooks on Go, Rust, and Python files + name: Run pre-commit hooks on Go, Rust, JavaScripts and Python files steps: - name: Check out the repo @@ -28,6 +28,11 @@ jobs: with: go-version: '1.24' + - name: Set up Node + uses: actions/setup-node@v5 + with: + node-version: 23 + - name: Set up Rust uses: dtolnay/rust-toolchain@stable with: @@ -60,6 +65,13 @@ jobs: ~/go/pkg/mod key: ${{ runner.os }}-go-precommit-${{ hashFiles('**/go.sum') }} + - name: Cache Node dependencies + uses: actions/cache@v4 + with: + path: | + ~/website/node_modules + key: ${{ runner.os }}-node-precommit-${{ hashFiles('website/package.json') }} + - name: Cache pre-commit environments uses: actions/cache@v4 with: @@ -69,13 +81,14 @@ jobs: - name: Install pre-commit run: pip install pre-commit - - name: Run pre-commit on Go, Rust, and Python files + - name: Run pre-commit on Go, Rust, JavaScript and Python files run: | - # Find all Go, Rust, and Python files (excluding vendored/generated code) - FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" \) \ + # Find all Go, Rust, JavaScripts and Python files (excluding vendored/generated code) + FILES=$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o -name "*.js" \) \ ! -path "./target/*" \ ! -path "./candle-binding/target/*" \ ! -path "./.git/*" \ + ! -path "./node_modules/*" \ ! -path "./vendor/*" \ ! -path "./__pycache__/*" \ ! -path "./site/*" \ @@ -86,7 +99,7 @@ jobs: echo "Running pre-commit on files: $FILES" pre-commit run --files $FILES else - echo "No Go, Rust, or Python files found to check" + echo "No Go, Rust, JavaScript or Python files found to check" fi - name: Show pre-commit results diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d57378f..4b65a545 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,12 +6,12 @@ repos: rev: v6.0.0 hooks: - id: trailing-whitespace - files: \.(go|rs|py)$ + files: \.(go|rs|py|js)$ - id: end-of-file-fixer - files: \.(go|rs|py)$ + files: \.(go|rs|py|js)$ - id: check-added-large-files args: ['--maxkb=500'] - files: \.(go|rs|py)$ + files: \.(go|rs|py|js)$ # Go specific hooks - repo: local @@ -22,6 +22,15 @@ repos: language: system files: \.go$ +# JavaScript specific hooks +- repo: local + hooks: + - id: js-lint + name: js lint + entry: bash -c 'cd website && npm install eslint && npm run lint' + language: system + files: \.js$ + # Rust specific hooks - repo: local hooks: diff --git a/Makefile b/Makefile index 9f3f4258..0eb27304 100644 --- a/Makefile +++ b/Makefile @@ -215,3 +215,11 @@ docs-serve: docs-build docs-clean: @echo "Cleaning documentation build artifacts..." cd website && npm run clear + +docs-lint: + @echo "Linting documentation..." + cd website && npm run lint + +docs-lint-fix: + @echo "Fixing documentation lint issues..." + cd website && npm run lint:fix diff --git a/src/semantic-router/cmd/main.go b/src/semantic-router/cmd/main.go index d32db437..e92e3ced 100644 --- a/src/semantic-router/cmd/main.go +++ b/src/semantic-router/cmd/main.go @@ -8,9 +8,9 @@ import ( "os" "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/vllm-project/semantic-router/semantic-router/pkg/api" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" - "github.com/vllm-project/semantic-router/semantic-router/pkg/observability" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/api" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/observability" ) func main() { diff --git a/src/semantic-router/go.mod b/src/semantic-router/go.mod index 7c4e59f7..3b6513b2 100644 --- a/src/semantic-router/go.mod +++ b/src/semantic-router/go.mod @@ -1,11 +1,11 @@ -module github.com/vllm-project/semantic-router/semantic-router +module github.com/vllm-project/semantic-router/src/semantic-router go 1.24.1 replace ( github.com/vllm-project/semantic-router/candle-binding => ../../candle-binding - github.com/vllm-project/semantic-router/semantic-router/pkg/config => ./pkg/config - github.com/vllm-project/semantic-router/semantic-router/pkg/extproc => ./pkg/extproc + github.com/vllm-project/semantic-router/src/semantic-router/pkg/config => ./pkg/config + github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc => ./pkg/extproc ) require ( diff --git a/src/semantic-router/pkg/api/server.go b/src/semantic-router/pkg/api/server.go index 47c64464..d17e8803 100644 --- a/src/semantic-router/pkg/api/server.go +++ b/src/semantic-router/pkg/api/server.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" - "github.com/vllm-project/semantic-router/semantic-router/pkg/services" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/services" ) // ClassificationAPIServer holds the server state and dependencies diff --git a/src/semantic-router/pkg/api/server_test.go b/src/semantic-router/pkg/api/server_test.go index 243edcb8..594839e7 100644 --- a/src/semantic-router/pkg/api/server_test.go +++ b/src/semantic-router/pkg/api/server_test.go @@ -9,8 +9,8 @@ import ( "net/http/httptest" "testing" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/services" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/services" ) func TestHandleBatchClassification(t *testing.T) { diff --git a/src/semantic-router/pkg/cache/cache_test.go b/src/semantic-router/pkg/cache/cache_test.go index a0a9594c..d4787b47 100644 --- a/src/semantic-router/pkg/cache/cache_test.go +++ b/src/semantic-router/pkg/cache/cache_test.go @@ -11,7 +11,7 @@ import ( . "github.com/onsi/gomega" candle "github.com/vllm-project/semantic-router/candle-binding" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" ) func TestCache(t *testing.T) { diff --git a/src/semantic-router/pkg/config/config_test.go b/src/semantic-router/pkg/config/config_test.go index fc01cee8..464f0cc7 100644 --- a/src/semantic-router/pkg/config/config_test.go +++ b/src/semantic-router/pkg/config/config_test.go @@ -8,7 +8,7 @@ import ( "gopkg.in/yaml.v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/src/semantic-router/pkg/config/parse_configfile_test.go b/src/semantic-router/pkg/config/parse_configfile_test.go index d0fe30bd..b0b3d692 100644 --- a/src/semantic-router/pkg/config/parse_configfile_test.go +++ b/src/semantic-router/pkg/config/parse_configfile_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) var _ = Describe("ParseConfigFile and ReplaceGlobalConfig", func() { diff --git a/src/semantic-router/pkg/extproc/caching_test.go b/src/semantic-router/pkg/extproc/caching_test.go index ab7f04e8..b0f3f6bd 100644 --- a/src/semantic-router/pkg/extproc/caching_test.go +++ b/src/semantic-router/pkg/extproc/caching_test.go @@ -9,9 +9,9 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" ) var _ = Describe("Caching Functionality", func() { diff --git a/src/semantic-router/pkg/extproc/edge_cases_test.go b/src/semantic-router/pkg/extproc/edge_cases_test.go index 862d015d..f402edac 100644 --- a/src/semantic-router/pkg/extproc/edge_cases_test.go +++ b/src/semantic-router/pkg/extproc/edge_cases_test.go @@ -11,9 +11,9 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" ) var _ = Describe("Edge Cases and Error Conditions", func() { diff --git a/src/semantic-router/pkg/extproc/endpoint_selection_test.go b/src/semantic-router/pkg/extproc/endpoint_selection_test.go index 53e6b4c6..f3e74cb8 100644 --- a/src/semantic-router/pkg/extproc/endpoint_selection_test.go +++ b/src/semantic-router/pkg/extproc/endpoint_selection_test.go @@ -8,8 +8,8 @@ import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" ) var _ = Describe("Endpoint Selection", func() { diff --git a/src/semantic-router/pkg/extproc/reason_mode_config_test.go b/src/semantic-router/pkg/extproc/reason_mode_config_test.go index e58b7560..3eccfa4b 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_config_test.go +++ b/src/semantic-router/pkg/extproc/reason_mode_config_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // TestReasoningModeConfiguration demonstrates how the reasoning mode works with the new config-based approach diff --git a/src/semantic-router/pkg/extproc/reason_mode_selector.go b/src/semantic-router/pkg/extproc/reason_mode_selector.go index 00051736..4e27d9d2 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_selector.go +++ b/src/semantic-router/pkg/extproc/reason_mode_selector.go @@ -6,8 +6,8 @@ import ( "log" "strings" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" ) // shouldUseReasoningMode determines if reasoning mode should be enabled based on the query category diff --git a/src/semantic-router/pkg/extproc/reason_mode_selector_test.go b/src/semantic-router/pkg/extproc/reason_mode_selector_test.go index ffe95d66..0a8a1f0a 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_selector_test.go +++ b/src/semantic-router/pkg/extproc/reason_mode_selector_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // TestModelReasoningFamily tests the new family-based configuration approach diff --git a/src/semantic-router/pkg/extproc/reasoning_integration_test.go b/src/semantic-router/pkg/extproc/reasoning_integration_test.go index 799899bb..e4c9dbc7 100644 --- a/src/semantic-router/pkg/extproc/reasoning_integration_test.go +++ b/src/semantic-router/pkg/extproc/reasoning_integration_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "testing" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // TestReasoningModeIntegration tests the complete reasoning mode integration diff --git a/src/semantic-router/pkg/extproc/request_handler.go b/src/semantic-router/pkg/extproc/request_handler.go index a9323e45..defc281a 100644 --- a/src/semantic-router/pkg/extproc/request_handler.go +++ b/src/semantic-router/pkg/extproc/request_handler.go @@ -12,11 +12,11 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" - "github.com/vllm-project/semantic-router/semantic-router/pkg/observability" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/http" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/pii" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/observability" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/http" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/pii" ) // parseOpenAIRequest parses the raw JSON using the OpenAI SDK types diff --git a/src/semantic-router/pkg/extproc/request_processing_test.go b/src/semantic-router/pkg/extproc/request_processing_test.go index d2f6326b..6d29edca 100644 --- a/src/semantic-router/pkg/extproc/request_processing_test.go +++ b/src/semantic-router/pkg/extproc/request_processing_test.go @@ -10,10 +10,10 @@ import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" - "github.com/vllm-project/semantic-router/semantic-router/pkg/tools" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/tools" ) var _ = Describe("Request Processing", func() { diff --git a/src/semantic-router/pkg/extproc/response_handler.go b/src/semantic-router/pkg/extproc/response_handler.go index c39ad73a..6805f9c3 100644 --- a/src/semantic-router/pkg/extproc/response_handler.go +++ b/src/semantic-router/pkg/extproc/response_handler.go @@ -8,8 +8,8 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" "github.com/openai/openai-go" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" - "github.com/vllm-project/semantic-router/semantic-router/pkg/observability" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/observability" ) // handleResponseHeaders processes the response headers diff --git a/src/semantic-router/pkg/extproc/router.go b/src/semantic-router/pkg/extproc/router.go index 152d1a06..d18b7d10 100644 --- a/src/semantic-router/pkg/extproc/router.go +++ b/src/semantic-router/pkg/extproc/router.go @@ -8,12 +8,12 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" candle_binding "github.com/vllm-project/semantic-router/candle-binding" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/services" - "github.com/vllm-project/semantic-router/semantic-router/pkg/tools" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/classification" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/pii" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/services" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/tools" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/classification" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/pii" ) var ( diff --git a/src/semantic-router/pkg/extproc/security_test.go b/src/semantic-router/pkg/extproc/security_test.go index d2812846..71030e12 100644 --- a/src/semantic-router/pkg/extproc/security_test.go +++ b/src/semantic-router/pkg/extproc/security_test.go @@ -12,12 +12,12 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/classification" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/classification" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/pii" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/pii" ) const ( diff --git a/src/semantic-router/pkg/extproc/server.go b/src/semantic-router/pkg/extproc/server.go index 1c999976..12693e3e 100644 --- a/src/semantic-router/pkg/extproc/server.go +++ b/src/semantic-router/pkg/extproc/server.go @@ -13,7 +13,7 @@ import ( ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" "github.com/fsnotify/fsnotify" - "github.com/vllm-project/semantic-router/semantic-router/pkg/observability" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/observability" "google.golang.org/grpc" ) diff --git a/src/semantic-router/pkg/extproc/stream_handling_test.go b/src/semantic-router/pkg/extproc/stream_handling_test.go index 2d5880b8..b9c2e0c3 100644 --- a/src/semantic-router/pkg/extproc/stream_handling_test.go +++ b/src/semantic-router/pkg/extproc/stream_handling_test.go @@ -13,8 +13,8 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" ) var _ = Describe("Process Stream Handling", func() { diff --git a/src/semantic-router/pkg/extproc/test_utils_test.go b/src/semantic-router/pkg/extproc/test_utils_test.go index 80d1b9ad..5ca4ca3b 100644 --- a/src/semantic-router/pkg/extproc/test_utils_test.go +++ b/src/semantic-router/pkg/extproc/test_utils_test.go @@ -10,12 +10,12 @@ import ( "google.golang.org/grpc/metadata" candle_binding "github.com/vllm-project/semantic-router/candle-binding" - "github.com/vllm-project/semantic-router/semantic-router/pkg/cache" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/extproc" - "github.com/vllm-project/semantic-router/semantic-router/pkg/tools" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/classification" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/pii" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/cache" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/extproc" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/tools" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/classification" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/pii" ) // MockStream implements the ext_proc.ExternalProcessor_ProcessServer interface for testing diff --git a/src/semantic-router/pkg/metrics/metrics.go b/src/semantic-router/pkg/metrics/metrics.go index 7be69000..bc465848 100644 --- a/src/semantic-router/pkg/metrics/metrics.go +++ b/src/semantic-router/pkg/metrics/metrics.go @@ -8,7 +8,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // Minimal fallback bucket configurations - used only when configuration is completely missing diff --git a/src/semantic-router/pkg/metrics/metrics_test.go b/src/semantic-router/pkg/metrics/metrics_test.go index c84c8f18..371ad51d 100644 --- a/src/semantic-router/pkg/metrics/metrics_test.go +++ b/src/semantic-router/pkg/metrics/metrics_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // TestMain ensures metrics are initialized before running tests diff --git a/src/semantic-router/pkg/services/classification.go b/src/semantic-router/pkg/services/classification.go index 638fe5b5..88f7705c 100644 --- a/src/semantic-router/pkg/services/classification.go +++ b/src/semantic-router/pkg/services/classification.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/utils/classification" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/classification" ) // Global classification service instance diff --git a/src/semantic-router/pkg/utils/classification/classifier.go b/src/semantic-router/pkg/utils/classification/classifier.go index 40a3ad01..0923ec8a 100644 --- a/src/semantic-router/pkg/utils/classification/classifier.go +++ b/src/semantic-router/pkg/utils/classification/classifier.go @@ -8,8 +8,8 @@ import ( "time" candle_binding "github.com/vllm-project/semantic-router/candle-binding" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" ) type CategoryInference interface { diff --git a/src/semantic-router/pkg/utils/classification/classifier_test.go b/src/semantic-router/pkg/utils/classification/classifier_test.go index 8a9a5a17..a86446bc 100644 --- a/src/semantic-router/pkg/utils/classification/classifier_test.go +++ b/src/semantic-router/pkg/utils/classification/classifier_test.go @@ -8,7 +8,7 @@ import ( . "github.com/onsi/gomega" candle_binding "github.com/vllm-project/semantic-router/candle-binding" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) func TestClassifier(t *testing.T) { diff --git a/src/semantic-router/pkg/utils/http/response.go b/src/semantic-router/pkg/utils/http/response.go index a42193de..93a6cc4a 100644 --- a/src/semantic-router/pkg/utils/http/response.go +++ b/src/semantic-router/pkg/utils/http/response.go @@ -9,7 +9,7 @@ import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" ext_proc "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" typev3 "github.com/envoyproxy/go-control-plane/envoy/type/v3" - "github.com/vllm-project/semantic-router/semantic-router/pkg/metrics" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/metrics" ) // CreatePIIViolationResponse creates an HTTP response for PII policy violations diff --git a/src/semantic-router/pkg/utils/pii/policy.go b/src/semantic-router/pkg/utils/pii/policy.go index 3b206340..b3254a82 100644 --- a/src/semantic-router/pkg/utils/pii/policy.go +++ b/src/semantic-router/pkg/utils/pii/policy.go @@ -4,7 +4,7 @@ import ( "log" "slices" - "github.com/vllm-project/semantic-router/semantic-router/pkg/config" + "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config" ) // PolicyChecker handles PII policy validation diff --git a/website/docs/intro.md b/website/docs/intro.md index 904d70d3..908904e1 100644 --- a/website/docs/intro.md +++ b/website/docs/intro.md @@ -6,7 +6,8 @@ sidebar_position: 1 [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/vllm-project/semantic-router/blob/main/LICENSE) [![Hugging Face](https://img.shields.io/badge/๐Ÿค—%20Hugging%20Face-Community-yellow)](https://huggingface.co/LLM-Semantic-Router) -[![Go Report Card](https://goreportcard.com/badge/github.com/vllm-project/semantic-router)](https://goreportcard.com/report/github.com/vllm-project/semantic-router) +[![Go Report Card](https://goreportcard.com/badge/github.com/vllm-project/semantic-router/src/semantic-router)](https://goreportcard.com/report/github.com/vllm-project/semantic-router/src/semantic-router) +![](https://github.com/vllm-project/semantic-router/workflows/Test%20And%20Build/badge.svg) An intelligent **Mixture-of-Models (MoM)** router that acts as an Envoy External Processor (ExtProc) to intelligently direct OpenAI API requests to the most suitable backend model from a defined pool. Using BERT-based semantic understanding and classification, it optimizes both performance and cost efficiency. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index d5cc02cb..f1ccd448 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -1,9 +1,9 @@ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion -const {themes} = require('prism-react-renderer'); -const lightCodeTheme = themes.github; -const darkCodeTheme = themes.vsDark; +const { themes } = require('prism-react-renderer') +const lightCodeTheme = themes.github +const darkCodeTheme = themes.vsDark /** @type {import('@docusaurus/types').Config} */ const config = { @@ -211,6 +211,6 @@ const config = { respectPrefersColorScheme: false, }, }), -}; +} -module.exports = config; +module.exports = config diff --git a/website/eslint.config.mjs b/website/eslint.config.mjs new file mode 100644 index 00000000..b8bb3652 --- /dev/null +++ b/website/eslint.config.mjs @@ -0,0 +1,23 @@ +import stylistic from '@stylistic/eslint-plugin' +import react from 'eslint-plugin-react' + +export default [ + { + ignores: ['.docusaurus', 'build'], + }, + stylistic.configs['recommended-flat'], + { + files: ['**/*.js', '**/*.jsx'], + plugins: { + react: react, + }, + rules: { + ...react.configs['jsx-runtime'].rules, + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { jsx: true }, + }, + }, + }, +] diff --git a/website/package.json b/website/package.json index 8ec1dd13..5aa63be5 100644 --- a/website/package.json +++ b/website/package.json @@ -14,7 +14,9 @@ "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", - "write-heading-ids": "docusaurus write-heading-ids" + "write-heading-ids": "docusaurus write-heading-ids", + "lint": "eslint .", + "lint:fix": "eslint . --fix" }, "keywords": [ "llm", @@ -30,6 +32,9 @@ "@docusaurus/theme-mermaid": "^3.8.1", "@mdx-js/react": "^3.1.0", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "@stylistic/eslint-plugin": "2.13.0", + "eslint": "9.18.0", + "eslint-plugin-react": "^7.37.4" } } diff --git a/website/sidebars.js b/website/sidebars.js index 3bf1650b..353cda9c 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -57,6 +57,6 @@ const sidebars = { ], }, ], -}; +} -module.exports = sidebars; +module.exports = sidebars diff --git a/website/src/components/AIChipAnimation.js b/website/src/components/AIChipAnimation.js index 9002e7d3..60b85599 100644 --- a/website/src/components/AIChipAnimation.js +++ b/website/src/components/AIChipAnimation.js @@ -1,25 +1,25 @@ -import React, { useEffect, useRef } from 'react'; -import styles from './AIChipAnimation.module.css'; +import React, { useEffect, useRef } from 'react' +import styles from './AIChipAnimation.module.css' const AIChipAnimation = () => { - const svgRef = useRef(null); + const svgRef = useRef(null) useEffect(() => { - const svg = svgRef.current; - if (!svg) return; + const svg = svgRef.current + if (!svg) return // Add pulsing animation to circuit paths - const paths = svg.querySelectorAll('.circuit-path'); + const paths = svg.querySelectorAll('.circuit-path') paths.forEach((path, index) => { - path.style.animationDelay = `${index * 0.2}s`; - }); + path.style.animationDelay = `${index * 0.2}s` + }) // Add data flow animation - const dataPoints = svg.querySelectorAll('.data-point'); + const dataPoints = svg.querySelectorAll('.data-point') dataPoints.forEach((point, index) => { - point.style.animationDelay = `${index * 0.3}s`; - }); - }, []); + point.style.animationDelay = `${index * 0.3}s` + }) + }, []) return (
@@ -41,7 +41,7 @@ const AIChipAnimation = () => { strokeWidth="2" className={styles.chipBase} /> - + {/* Circuit patterns */} {/* Horizontal circuits */} @@ -66,7 +66,7 @@ const AIChipAnimation = () => { fill="none" className="circuit-path" /> - + {/* Vertical circuits */} { - + {/* Core labels */} AI ML @@ -111,7 +111,7 @@ const AIChipAnimation = () => { - + @@ -129,7 +129,7 @@ const AIChipAnimation = () => { - + {/* Right pins */} @@ -148,19 +148,19 @@ const AIChipAnimation = () => { - + - + - + @@ -168,13 +168,13 @@ const AIChipAnimation = () => { - +
Neural Processing Unit Embedding โ€ข Classify โ€ข Similarity
- ); -}; + ) +} -export default AIChipAnimation; +export default AIChipAnimation diff --git a/website/src/components/AcknowledgementsSection/index.js b/website/src/components/AcknowledgementsSection/index.js index 95d0c07a..fbcc969d 100644 --- a/website/src/components/AcknowledgementsSection/index.js +++ b/website/src/components/AcknowledgementsSection/index.js @@ -1,9 +1,9 @@ -import React from 'react'; -import styles from './index.module.css'; -import acknowledgementsData from './data.json'; +import React from 'react' +import styles from './index.module.css' +import acknowledgementsData from './data.json' function AcknowledgementsSection() { - const { title, subtitle, projects } = acknowledgementsData; + const { title, subtitle, projects } = acknowledgementsData return (
@@ -16,7 +16,7 @@ function AcknowledgementsSection() { {subtitle}

- {projects.map((project) => ( + {projects.map(project => (
- ); + ) } -export default AcknowledgementsSection; +export default AcknowledgementsSection diff --git a/website/src/components/HomepageFeatures/index.js b/website/src/components/HomepageFeatures/index.js index b3e8af89..f94a9aeb 100644 --- a/website/src/components/HomepageFeatures/index.js +++ b/website/src/components/HomepageFeatures/index.js @@ -1,13 +1,17 @@ -import React from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; +import React from 'react' +import clsx from 'clsx' +import styles from './styles.module.css' const FeatureList = [ { title: '๐Ÿง  Intelligent Routing', description: ( <> - Powered by ModernBERT Fine-Tuned Models for + Powered by + {' '} + ModernBERT Fine-Tuned Models + {' '} + for intelligent intent understanding, it understands context, intent, and complexity to route requests to the best LLM. @@ -17,7 +21,15 @@ const FeatureList = [ title: '๐Ÿ›ก๏ธ AI-Powered Security', description: ( <> - Advanced PII Detection and Prompt Guard to identify and block jailbreak attempts, ensuring secure and responsible AI interactions + Advanced + {' '} + PII Detection + {' '} + and + {' '} + Prompt Guard + {' '} + to identify and block jailbreak attempts, ensuring secure and responsible AI interactions across your infrastructure. ), @@ -26,7 +38,11 @@ const FeatureList = [ title: 'โšก Semantic Caching', description: ( <> - Intelligent Similarity Cache that stores semantic representations + Intelligent + {' '} + Similarity Cache + {' '} + that stores semantic representations of prompts, dramatically reducing token usage and latency through smart content matching. ), @@ -35,7 +51,10 @@ const FeatureList = [ title: '๐Ÿค– Auto-Reasoning Engine', description: ( <> - Auto reasoning engine that analyzes request complexity, domain expertise + Auto reasoning engine that analyzes request + {' '} + complexity + , domain expertise requirements, and performance constraints to automatically select the best model for each task. ), @@ -44,7 +63,10 @@ const FeatureList = [ title: '๐Ÿ”ฌ Real-time Analytics', description: ( <> - Comprehensive monitoring and analytics dashboard with neural network insights, + Comprehensive monitoring and analytics dashboard with + {' '} + neural network insights + , model performance metrics, and intelligent routing decisions visualization. ), @@ -53,14 +75,17 @@ const FeatureList = [ title: '๐Ÿš€ Scalable Architecture', description: ( <> - Cloud-native design with distributed neural processing, auto-scaling capabilities, + Cloud-native design with + {' '} + distributed neural processing + , auto-scaling capabilities, and seamless integration with existing LLM infrastructure and model serving platforms. ), }, -]; +] -function Feature({title, description}) { +function Feature({ title, description }) { return (
@@ -70,7 +95,7 @@ function Feature({title, description}) {
- ); + ) } export default function HomepageFeatures() { @@ -92,5 +117,5 @@ export default function HomepageFeatures() { - ); + ) } diff --git a/website/src/components/NeuralNetworkBackground.js b/website/src/components/NeuralNetworkBackground.js index b7b329d6..abcb4d95 100644 --- a/website/src/components/NeuralNetworkBackground.js +++ b/website/src/components/NeuralNetworkBackground.js @@ -1,32 +1,32 @@ -import React, { useEffect, useRef } from 'react'; -import styles from './NeuralNetworkBackground.module.css'; +import React, { useEffect, useRef } from 'react' +import styles from './NeuralNetworkBackground.module.css' const NeuralNetworkBackground = () => { - const canvasRef = useRef(null); - const animationRef = useRef(null); - const nodesRef = useRef([]); - const connectionsRef = useRef([]); + const canvasRef = useRef(null) + const animationRef = useRef(null) + const nodesRef = useRef([]) + const connectionsRef = useRef([]) useEffect(() => { - const canvas = canvasRef.current; - if (!canvas) return; + const canvas = canvasRef.current + if (!canvas) return - const ctx = canvas.getContext('2d'); - let width, height; + const ctx = canvas.getContext('2d') + let width, height const resizeCanvas = () => { - const rect = canvas.parentElement.getBoundingClientRect(); - width = rect.width; - height = rect.height; - canvas.width = width; - canvas.height = height; - }; + const rect = canvas.parentElement.getBoundingClientRect() + width = rect.width + height = rect.height + canvas.width = width + canvas.height = height + } // Initialize nodes const initNodes = () => { - const nodeCount = Math.min(50, Math.floor((width * height) / 15000)); - nodesRef.current = []; - + const nodeCount = Math.min(50, Math.floor((width * height) / 15000)) + nodesRef.current = [] + for (let i = 0; i < nodeCount; i++) { nodesRef.current.push({ x: Math.random() * width, @@ -37,23 +37,23 @@ const NeuralNetworkBackground = () => { opacity: Math.random() * 0.8 + 0.2, pulsePhase: Math.random() * Math.PI * 2, isAI: Math.random() < 0.1, // 10% chance to be an AI node - }); + }) } - }; + } // Create connections between nearby nodes const updateConnections = () => { - connectionsRef.current = []; - const maxDistance = 120; - + connectionsRef.current = [] + const maxDistance = 120 + for (let i = 0; i < nodesRef.current.length; i++) { for (let j = i + 1; j < nodesRef.current.length; j++) { - const nodeA = nodesRef.current[i]; - const nodeB = nodesRef.current[j]; + const nodeA = nodesRef.current[i] + const nodeB = nodesRef.current[j] const distance = Math.sqrt( - Math.pow(nodeA.x - nodeB.x, 2) + Math.pow(nodeA.y - nodeB.y, 2) - ); - + Math.pow(nodeA.x - nodeB.x, 2) + Math.pow(nodeA.y - nodeB.y, 2), + ) + if (distance < maxDistance) { connectionsRef.current.push({ nodeA, @@ -61,127 +61,129 @@ const NeuralNetworkBackground = () => { distance, opacity: (1 - distance / maxDistance) * 0.3, isActive: Math.random() < 0.1, // 10% chance to be active - }); + }) } } } - }; + } // Animation loop const animate = (timestamp) => { - ctx.clearRect(0, 0, width, height); - + ctx.clearRect(0, 0, width, height) + // Update and draw connections - connectionsRef.current.forEach(connection => { - const { nodeA, nodeB, opacity, isActive } = connection; - - ctx.beginPath(); - ctx.moveTo(nodeA.x, nodeB.y); - ctx.lineTo(nodeB.x, nodeB.y); - + connectionsRef.current.forEach((connection) => { + const { nodeA, nodeB, opacity, isActive } = connection + + ctx.beginPath() + ctx.moveTo(nodeA.x, nodeB.y) + ctx.lineTo(nodeB.x, nodeB.y) + if (isActive) { // Active connections with gradient - const gradient = ctx.createLinearGradient(nodeA.x, nodeA.y, nodeB.x, nodeB.y); - gradient.addColorStop(0, `rgba(9, 105, 218, ${opacity * 0.8})`); - gradient.addColorStop(0.5, `rgba(88, 166, 255, ${opacity})`); - gradient.addColorStop(1, `rgba(130, 80, 223, ${opacity * 0.8})`); - ctx.strokeStyle = gradient; - ctx.lineWidth = 2; - } else { - ctx.strokeStyle = `rgba(9, 105, 218, ${opacity * 0.4})`; - ctx.lineWidth = 1; + const gradient = ctx.createLinearGradient(nodeA.x, nodeA.y, nodeB.x, nodeB.y) + gradient.addColorStop(0, `rgba(9, 105, 218, ${opacity * 0.8})`) + gradient.addColorStop(0.5, `rgba(88, 166, 255, ${opacity})`) + gradient.addColorStop(1, `rgba(130, 80, 223, ${opacity * 0.8})`) + ctx.strokeStyle = gradient + ctx.lineWidth = 2 + } + else { + ctx.strokeStyle = `rgba(9, 105, 218, ${opacity * 0.4})` + ctx.lineWidth = 1 } - - ctx.stroke(); - }); - + + ctx.stroke() + }) + // Update and draw nodes - nodesRef.current.forEach(node => { + nodesRef.current.forEach((node) => { // Update position - node.x += node.vx; - node.y += node.vy; - + node.x += node.vx + node.y += node.vy + // Bounce off edges - if (node.x < 0 || node.x > width) node.vx *= -1; - if (node.y < 0 || node.y > height) node.vy *= -1; - + if (node.x < 0 || node.x > width) node.vx *= -1 + if (node.y < 0 || node.y > height) node.vy *= -1 + // Keep nodes in bounds - node.x = Math.max(0, Math.min(width, node.x)); - node.y = Math.max(0, Math.min(height, node.y)); - + node.x = Math.max(0, Math.min(width, node.x)) + node.y = Math.max(0, Math.min(height, node.y)) + // Update pulse - node.pulsePhase += 0.02; - const pulse = Math.sin(node.pulsePhase) * 0.3 + 0.7; - + node.pulsePhase += 0.02 + const pulse = Math.sin(node.pulsePhase) * 0.3 + 0.7 + // Draw node - ctx.beginPath(); - ctx.arc(node.x, node.y, node.radius * pulse, 0, Math.PI * 2); - + ctx.beginPath() + ctx.arc(node.x, node.y, node.radius * pulse, 0, Math.PI * 2) + if (node.isAI) { // AI nodes with special glow const gradient = ctx.createRadialGradient( node.x, node.y, 0, - node.x, node.y, node.radius * pulse * 3 - ); - gradient.addColorStop(0, `rgba(253, 181, 22, ${node.opacity * pulse})`); - gradient.addColorStop(0.5, `rgba(253, 181, 22, ${node.opacity * pulse * 0.5})`); - gradient.addColorStop(1, 'rgba(253, 181, 22, 0)'); - ctx.fillStyle = gradient; - ctx.fill(); - + node.x, node.y, node.radius * pulse * 3, + ) + gradient.addColorStop(0, `rgba(253, 181, 22, ${node.opacity * pulse})`) + gradient.addColorStop(0.5, `rgba(253, 181, 22, ${node.opacity * pulse * 0.5})`) + gradient.addColorStop(1, 'rgba(253, 181, 22, 0)') + ctx.fillStyle = gradient + ctx.fill() + // Core - ctx.beginPath(); - ctx.arc(node.x, node.y, node.radius * 0.6, 0, Math.PI * 2); - ctx.fillStyle = `rgba(253, 181, 22, ${node.opacity})`; - ctx.fill(); - } else { + ctx.beginPath() + ctx.arc(node.x, node.y, node.radius * 0.6, 0, Math.PI * 2) + ctx.fillStyle = `rgba(253, 181, 22, ${node.opacity})` + ctx.fill() + } + else { // Regular nodes const gradient = ctx.createRadialGradient( node.x, node.y, 0, - node.x, node.y, node.radius * pulse * 2 - ); - gradient.addColorStop(0, `rgba(88, 166, 255, ${node.opacity * pulse})`); - gradient.addColorStop(1, 'rgba(88, 166, 255, 0)'); - ctx.fillStyle = gradient; - ctx.fill(); - + node.x, node.y, node.radius * pulse * 2, + ) + gradient.addColorStop(0, `rgba(88, 166, 255, ${node.opacity * pulse})`) + gradient.addColorStop(1, 'rgba(88, 166, 255, 0)') + ctx.fillStyle = gradient + ctx.fill() + // Core - ctx.beginPath(); - ctx.arc(node.x, node.y, node.radius * 0.5, 0, Math.PI * 2); - ctx.fillStyle = `rgba(88, 166, 255, ${node.opacity})`; - ctx.fill(); + ctx.beginPath() + ctx.arc(node.x, node.y, node.radius * 0.5, 0, Math.PI * 2) + ctx.fillStyle = `rgba(88, 166, 255, ${node.opacity})` + ctx.fill() } - }); - - animationRef.current = requestAnimationFrame(animate); - }; + }) + + animationRef.current = requestAnimationFrame(animate) + } // Initialize - resizeCanvas(); - initNodes(); - updateConnections(); - animate(); + resizeCanvas() + initNodes() + updateConnections() + animate() // Handle resize const handleResize = () => { - resizeCanvas(); - initNodes(); - updateConnections(); - }; + resizeCanvas() + initNodes() + updateConnections() + } - window.addEventListener('resize', handleResize); + window.addEventListener('resize', handleResize) // Update connections periodically - const connectionInterval = setInterval(updateConnections, 2000); + const connectionInterval = setInterval(updateConnections, 2000) return () => { if (animationRef.current) { - cancelAnimationFrame(animationRef.current); + cancelAnimationFrame(animationRef.current) } - window.removeEventListener('resize', handleResize); - clearInterval(connectionInterval); - }; - }, []); + window.removeEventListener('resize', handleResize) + clearInterval(connectionInterval) + } + }, []) return (
@@ -190,7 +192,7 @@ const NeuralNetworkBackground = () => { className={styles.neuralNetworkCanvas} />
- ); -}; + ) +} -export default NeuralNetworkBackground; +export default NeuralNetworkBackground diff --git a/website/src/components/TypewriterCode.js b/website/src/components/TypewriterCode.js index 5b3e9d84..e9954955 100644 --- a/website/src/components/TypewriterCode.js +++ b/website/src/components/TypewriterCode.js @@ -1,5 +1,5 @@ -import React, { useState, useEffect } from 'react'; -import styles from './TypewriterCode.module.css'; +import React, { useState, useEffect } from 'react' +import styles from './TypewriterCode.module.css' const TypewriterCode = () => { const codeText = `curl -X POST http://vllm-semantic-router/v1/chat/completions \\ @@ -14,26 +14,25 @@ const TypewriterCode = () => { ] }' -# selected: gpt-oss-120b, complexity: high, reasoning_effort: high, domain: math`; +# selected: gpt-oss-120b, complexity: high, reasoning_effort: high, domain: math` - const [displayedText, setDisplayedText] = useState(''); - const [currentIndex, setCurrentIndex] = useState(0); - const [isComplete, setIsComplete] = useState(false); + const [displayedText, setDisplayedText] = useState('') + const [currentIndex, setCurrentIndex] = useState(0) + const [isComplete, setIsComplete] = useState(false) useEffect(() => { if (currentIndex < codeText.length) { const timer = setTimeout(() => { - setDisplayedText(prev => prev + codeText[currentIndex]); - setCurrentIndex(prev => prev + 1); - }, 50); // ๆ‰“ๅญ—้€Ÿๅบฆ๏ผŒๅฏไปฅ่ฐƒๆ•ด + setDisplayedText(prev => prev + codeText[currentIndex]) + setCurrentIndex(prev => prev + 1) + }, 50) // ๆ‰“ๅญ—้€Ÿๅบฆ๏ผŒๅฏไปฅ่ฐƒๆ•ด - return () => clearTimeout(timer); - } else { - setIsComplete(true); + return () => clearTimeout(timer) } - }, [currentIndex, codeText]); - - + else { + setIsComplete(true) + } + }, [currentIndex, codeText]) // ๆธฒๆŸ“ๅธฆ้ขœ่‰ฒ็š„ๆ–‡ๆœฌ const renderColoredText = (text) => { @@ -49,34 +48,33 @@ const TypewriterCode = () => { 'true': styles.highColor, 'mathematics': styles.scienceColor, 'domain': styles.confidenceValueColor, - 'Riemann Hypothesis': styles.modernBertColor - }; + 'Riemann Hypothesis': styles.modernBertColor, + } - let result = []; - let currentIndex = 0; + let result = [] + let currentIndex = 0 // ้ๅކๆ–‡ๆœฌ๏ผŒๆŸฅๆ‰พ็‰นๆฎŠๅ•่ฏ while (currentIndex < text.length) { - let foundSpecialWord = false; + let foundSpecialWord = false // ๆฃ€ๆŸฅๆ˜ฏๅฆๅŒน้…็‰นๆฎŠๅ•่ฏ for (const [word, className] of Object.entries(specialWords)) { - const wordStart = currentIndex; - const wordEnd = wordStart + word.length; - - if (wordEnd <= text.length && - text.substring(wordStart, wordEnd).toLowerCase() === word.toLowerCase()) { + const wordStart = currentIndex + const wordEnd = wordStart + word.length + if (wordEnd <= text.length + && text.substring(wordStart, wordEnd).toLowerCase() === word.toLowerCase()) { // ๆ‰พๅˆฐ็‰นๆฎŠๅ•่ฏ๏ผŒๅบ”็”จ็‰นๆฎŠๆ ทๅผ - const wordText = text.substring(wordStart, wordEnd); + const wordText = text.substring(wordStart, wordEnd) result.push( {wordText} - - ); - currentIndex = wordEnd; - foundSpecialWord = true; - break; + , + ) + currentIndex = wordEnd + foundSpecialWord = true + break } } @@ -85,14 +83,14 @@ const TypewriterCode = () => { result.push( {text[currentIndex]} - - ); - currentIndex++; + , + ) + currentIndex++ } } - return result; - }; + return result + } return (
@@ -114,7 +112,7 @@ const TypewriterCode = () => {
- ); -}; + ) +} -export default TypewriterCode; +export default TypewriterCode diff --git a/website/src/pages/community/code-of-conduct.js b/website/src/pages/community/code-of-conduct.js index c85d73d7..eaf6bfb5 100644 --- a/website/src/pages/community/code-of-conduct.js +++ b/website/src/pages/community/code-of-conduct.js @@ -1,12 +1,13 @@ -import React from 'react'; -import Layout from '@theme/Layout'; -import styles from './community-page.module.css'; +import React from 'react' +import Layout from '@theme/Layout' +import styles from './community-page.module.css' export default function CodeOfConduct() { return ( + description="vLLM Semantic Router Community Code of Conduct" + >

Code of Conduct ๐Ÿ“œ

@@ -14,7 +15,7 @@ export default function CodeOfConduct() { Our commitment to fostering an open, welcoming, and inclusive community.

- +

๐Ÿค Our Pledge

@@ -47,7 +48,7 @@ export default function CodeOfConduct() {
  • Focusing on what is best not just for us as individuals, but for the overall community
  • - +

    Examples of unacceptable behavior:

    @@ -152,13 +189,19 @@ export default function CodeOfConduct() {

    ๐Ÿ“š Attribution

    - This Code of Conduct is adapted from the Contributor Covenant, - version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + This Code of Conduct is adapted from the + {' '} + Contributor Covenant + , + version 2.0, available at + {' '} + https://www.contributor-covenant.org/version/2/0/code_of_conduct.html + .

    - ); + ) } diff --git a/website/src/pages/community/contributing.js b/website/src/pages/community/contributing.js index c34e54b7..02358d47 100644 --- a/website/src/pages/community/contributing.js +++ b/website/src/pages/community/contributing.js @@ -1,12 +1,13 @@ -import React from 'react'; -import Layout from '@theme/Layout'; -import styles from './community-page.module.css'; +import React from 'react' +import Layout from '@theme/Layout' +import styles from './community-page.module.css' export default function Contributing() { return ( + description="How to contribute to vLLM Semantic Router" + >

    Contributing to vLLM Semantic Router ๐Ÿค

    @@ -14,14 +15,18 @@ export default function Contributing() { We welcome contributions from the community! Here's how you can help make vLLM Semantic Router better.

    - +

    ๐ŸŽฏ Ways to Contribute

    ๐Ÿ› Bug Reports

    -

    Found a bug? Please report it on our GitHub Issues.

    +

    + Found a bug? Please report it on our + GitHub Issues + . +

    • Use a clear and descriptive title
    • Provide steps to reproduce
    • @@ -76,7 +81,7 @@ export default function Contributing() {

      Discuss your idea or bug report with the community first.

    - +
    2
    @@ -84,7 +89,7 @@ export default function Contributing() {

    Create a new branch for your changes from the main branch.

    - +
    3
    @@ -92,7 +97,7 @@ export default function Contributing() {

    Implement your changes following our coding standards.

    - +
    4
    @@ -100,7 +105,7 @@ export default function Contributing() {

    Run tests and ensure your changes don't break existing functionality.

    - +
    5
    @@ -115,7 +120,11 @@ export default function Contributing() {

    ๐Ÿท๏ธ Working Group Areas

    - Consider joining one of our Working Groups to focus your contributions: + Consider joining one of our + {' '} + Working Groups + {' '} + to focus your contributions:

    area/document @@ -133,14 +142,26 @@ export default function Contributing() {

    Need help with your contribution? Reach out to us:

    - ); + ) } diff --git a/website/src/pages/community/team.js b/website/src/pages/community/team.js index 5f16b9b3..8e252467 100644 --- a/website/src/pages/community/team.js +++ b/website/src/pages/community/team.js @@ -1,6 +1,6 @@ -import React from 'react'; -import Layout from '@theme/Layout'; -import styles from './team.module.css'; +import React from 'react' +import Layout from '@theme/Layout' +import styles from './team.module.css' const coreTeam = [ { @@ -11,7 +11,7 @@ const coreTeam = [ github: 'https://github.com/rootfs', linkedin: 'https://www.linkedin.com/in/huaminchen', bio: 'Distinguished Engineer at Red Hat, driving innovation in cloud-native and AI/LLM Inference technologies.', - expertise: ['Cloud Native', 'Kubernetes', 'Container Technologies', 'System Architecture'] + expertise: ['Cloud Native', 'Kubernetes', 'Container Technologies', 'System Architecture'], }, { name: 'Chen Wang', @@ -21,7 +21,7 @@ const coreTeam = [ github: 'https://github.com/wangchen615', linkedin: 'https://www.linkedin.com/in/chenw615/', bio: 'Senior Staff Research Scientist at IBM, focusing on advanced AI systems and research.', - expertise: ['AI Systems', 'Research Leadership', 'Machine Learning', 'Innovation'] + expertise: ['AI Systems', 'Research Leadership', 'Machine Learning', 'Innovation'], }, { name: 'Yue Zhu', @@ -31,7 +31,7 @@ const coreTeam = [ github: 'https://github.com/yuezhu1', linkedin: 'https://www.linkedin.com/in/yue-zhu-b26526a3/', bio: 'Staff Research Scientist at IBM, specializing in AI research and LLM Inference.', - expertise: ['Machine Learning', 'AI Research', 'Data Science', 'Research & Development'] + expertise: ['Machine Learning', 'AI Research', 'Data Science', 'Research & Development'], }, { name: 'Xunzhuo Liu', @@ -41,11 +41,9 @@ const coreTeam = [ github: 'https://github.com/Xunzhuo', linkedin: 'https://www.linkedin.com/in/bitliu/', bio: 'Software Engineer at Tencent, leading the development of vLLM Semantic Router and driving the project vision.', - expertise: ['System Architecture', 'ML Infrastructure', 'Open Source', 'Software Engineering'] + expertise: ['System Architecture', 'ML Infrastructure', 'Open Source', 'Software Engineering'], }, -]; - - +] const contributors = [ { @@ -54,9 +52,9 @@ const contributors = [ avatar: 'https://github.com/github.png', github: '/community/contributing', bio: 'Join our community and help make vLLM Semantic Router even better!', - expertise: ['Your Skills Here'] + expertise: ['Your Skills Here'], }, -]; +] function TeamMember({ member, isContributor = false }) { return ( @@ -71,7 +69,13 @@ function TeamMember({ member, isContributor = false }) {

    {member.name}

    {member.role} - {member.company && @ {member.company}} + {member.company && ( + + {' '} + @ + {member.company} + + )}

    @@ -118,14 +122,15 @@ function TeamMember({ member, isContributor = false }) { )} - ); + ) } export default function Team() { return ( + description="Meet the team behind vLLM Semantic Router" + >

    Meet Our Team ๐Ÿ‘ฅ

    @@ -133,7 +138,7 @@ export default function Team() { The passionate individuals building the future of intelligent LLM routing

    - +

    ๐ŸŒŸ Core Team

    @@ -147,8 +152,6 @@ export default function Team() {
    - -

    ๐Ÿค Join Our Team

    @@ -166,11 +169,11 @@ export default function Team() {

    Contributor Recognition

    - We believe in recognizing the valuable contributions of our community members. - Contributors who show consistent dedication and quality work in specific areas + We believe in recognizing the valuable contributions of our community members. + Contributors who show consistent dedication and quality work in specific areas may be invited to become maintainers with write access to the repository.

    - +

    Path to Maintainership:

    @@ -181,15 +184,18 @@ export default function Team() {

    Make consistent, quality contributions to your area of interest

    - +
    2
    Join a Working Group
    -

    Participate actively in one of our Working Groups

    +

    + Participate actively in one of our + Working Groups +

    - +
    3
    @@ -197,7 +203,7 @@ export default function Team() {

    Receive nomination and approval from the maintainer team

    - +
    4
    @@ -220,7 +226,7 @@ export default function Team() { Contributing Guide
    - +

    ๐Ÿ‘ฅ Join Working Groups

    Find your area of expertise and connect with like-minded contributors.

    @@ -228,7 +234,7 @@ export default function Team() { View Work Groups
    - +

    ๐Ÿ’ฌ Join Discussions

    Participate in community discussions and share your ideas.

    @@ -241,5 +247,5 @@ export default function Team() {
    - ); + ) } diff --git a/website/src/pages/community/work-groups.js b/website/src/pages/community/work-groups.js index f93efb72..92c17886 100644 --- a/website/src/pages/community/work-groups.js +++ b/website/src/pages/community/work-groups.js @@ -1,6 +1,6 @@ -import React from 'react'; -import Layout from '@theme/Layout'; -import styles from './work-groups.module.css'; +import React from 'react' +import Layout from '@theme/Layout' +import styles from './work-groups.module.css' const workingGroups = [ // First column - Core areas @@ -10,7 +10,7 @@ const workingGroups = [ label: 'area/core', icon: '๐Ÿง ', skills: ['Machine learning', 'BERT models', 'Classification algorithms'], - needs: ['Model optimization', 'Algorithm improvements', 'Reasoning logic'] + needs: ['Model optimization', 'Algorithm improvements', 'Reasoning logic'], }, { name: 'Research', @@ -18,7 +18,7 @@ const workingGroups = [ label: 'area/research', icon: '๐Ÿ”ฌ', skills: ['Model Training', 'Model Fine-Tuning', 'Deep Learning'], - needs: ['SLM research', 'Latency optimization', 'Context improvement'] + needs: ['SLM research', 'Latency optimization', 'Context improvement'], }, { name: 'Networking', @@ -26,7 +26,7 @@ const workingGroups = [ label: 'area/networking', icon: '๐ŸŒ', skills: ['Envoy proxy', 'Network protocols', 'Performance optimization'], - needs: ['Load balancing', 'Traffic routing', 'Network security'] + needs: ['Load balancing', 'Traffic routing', 'Network security'], }, // Second column - Operations and monitoring { @@ -35,7 +35,7 @@ const workingGroups = [ label: 'area/observability', icon: '๐Ÿ“ˆ', skills: ['Prometheus/Grafana', 'OpenTelemetry', 'Log aggregation', 'Monitoring systems'], - needs: ['Metrics implementation', 'Tracing integration', 'Dashboard creation', 'Log standardization'] + needs: ['Metrics implementation', 'Tracing integration', 'Dashboard creation', 'Log standardization'], }, { name: 'Bench', @@ -43,7 +43,7 @@ const workingGroups = [ label: 'area/benchmark', icon: '๐Ÿ“Š', skills: ['Performance testing', 'Benchmarking tools', 'Data analysis'], - needs: ['Benchmark frameworks', 'Performance metrics', 'Testing automation'] + needs: ['Benchmark frameworks', 'Performance metrics', 'Testing automation'], }, { name: 'Environment', @@ -51,7 +51,7 @@ const workingGroups = [ label: 'area/environment', icon: '๐Ÿณ', skills: ['Docker', 'Kubernetes', 'Cloud platforms', 'DevOps'], - needs: ['Helm charts', 'Deployment automation', 'Cloud integrations'] + needs: ['Helm charts', 'Deployment automation', 'Cloud integrations'], }, // Third column - Development and user experience { @@ -60,7 +60,7 @@ const workingGroups = [ label: 'area/tooling, area/ci', icon: '๐Ÿ”ง', skills: ['CI/CD tools', 'Build automation', 'Release processes'], - needs: ['Test automation', 'Release pipelines', 'Quality assurance'] + needs: ['Test automation', 'Release pipelines', 'Quality assurance'], }, { name: 'User Experience', @@ -68,7 +68,7 @@ const workingGroups = [ label: 'area/user-experience', icon: '๐Ÿ‘ฅ', skills: ['API design', 'UX/UI', 'Developer experience'], - needs: ['API improvements', 'CLI enhancements', 'User feedback integration'] + needs: ['API improvements', 'CLI enhancements', 'User feedback integration'], }, { name: 'Docs', @@ -76,9 +76,9 @@ const workingGroups = [ label: 'area/document', icon: '๐Ÿ“š', skills: ['Technical writing', 'Documentation tools', 'User experience design'], - needs: ['API documentation', 'Tutorials', 'Deployment guides'] - } -]; + needs: ['API documentation', 'Tutorials', 'Deployment guides'], + }, +] function WorkGroupCard({ group }) { return ( @@ -108,19 +108,20 @@ function WorkGroupCard({ group }) {
    - ); + ) } export default function WorkGroups() { return ( + description="vLLM Semantic Router Community Working Groups" + >

    vLLM Semantic Router Work Groups ๐Ÿ‘‹

    - +

    ๐ŸŒ WG Initialization

    @@ -128,15 +129,17 @@ export default function WorkGroups() { We are looking for interests around vLLM Semantic Router project and separate it into different WGs.

    - Please comment on{' '} - GitHub Issue #15 - {' '} + + {' '} if you are interested in one or more.

    @@ -155,8 +158,8 @@ export default function WorkGroups() {

    ๐Ÿ” Community Promotion

    - We are grateful for any contributions, and if you show consistent contributions to the above specify area, - you will be promoting as its maintainer after votes from maintainer team, and you will be invited to + We are grateful for any contributions, and if you show consistent contributions to the above specify area, + you will be promoting as its maintainer after votes from maintainer team, and you will be invited to semantic-router-maintainer group, and granted WRITE access to this repo.

    @@ -164,10 +167,36 @@ export default function WorkGroups() {

    How to Get Involved

      -
    1. Choose Your Interest Area: Review the working groups above and identify which areas align with your skills and interests
    2. -
    3. Join the Discussion: Comment on GitHub Issue #15 to express your interest
    4. -
    5. Start Contributing: Look for issues labeled with the corresponding area tags (e.g., area/document, area/core)
    6. -
    7. Collaborate: Connect with other community members working in the same areas
    8. +
    9. + Choose Your Interest Area: + {' '} + Review the working groups above and identify which areas align with your skills and interests +
    10. +
    11. + Join the Discussion: + {' '} + Comment on + {' '} + GitHub Issue #15 + {' '} + to express your interest +
    12. +
    13. + Start Contributing: + {' '} + Look for issues labeled with the corresponding area tags (e.g., + {' '} + area/document + , + {' '} + area/core + ) +
    14. +
    15. + Collaborate: + {' '} + Connect with other community members working in the same areas +
    @@ -175,13 +204,24 @@ export default function WorkGroups() {

    Contact

    For questions about working groups or to get involved:

    - ); + ) } diff --git a/website/src/pages/index.js b/website/src/pages/index.js index 8e802c9b..7ac0ef2f 100644 --- a/website/src/pages/index.js +++ b/website/src/pages/index.js @@ -1,18 +1,18 @@ -import React from 'react'; -import clsx from 'clsx'; -import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; -import HomepageFeatures from '@site/src/components/HomepageFeatures'; -import TypewriterCode from '@site/src/components/TypewriterCode'; -import NeuralNetworkBackground from '@site/src/components/NeuralNetworkBackground'; -import AIChipAnimation from '@site/src/components/AIChipAnimation'; -import AcknowledgementsSection from '@site/src/components/AcknowledgementsSection'; +import React from 'react' +import clsx from 'clsx' +import Link from '@docusaurus/Link' +import useDocusaurusContext from '@docusaurus/useDocusaurusContext' +import Layout from '@theme/Layout' +import HomepageFeatures from '@site/src/components/HomepageFeatures' +import TypewriterCode from '@site/src/components/TypewriterCode' +import NeuralNetworkBackground from '@site/src/components/NeuralNetworkBackground' +import AIChipAnimation from '@site/src/components/AIChipAnimation' +import AcknowledgementsSection from '@site/src/components/AcknowledgementsSection' -import styles from './index.module.css'; +import styles from './index.module.css' function HomepageHeader() { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext() return (
    @@ -26,11 +26,19 @@ function HomepageHeader() { className={styles.vllmLogo} />

    - AI-Powered vLLM Semantic Router + AI-Powered + {' '} + vLLM Semantic Router

    - ๐Ÿง  Intelligent Auto Reasoning Router for Efficient LLM Inference on Mixture-of-Models + ๐Ÿง  Intelligent + {' '} + Auto Reasoning + {' '} + Router for Efficient LLM Inference on + {' '} + Mixture-of-Models
    ๐Ÿงฌ Neural Networks @@ -46,13 +54,14 @@ function HomepageHeader() {

    + to="/docs/intro" + > ๐Ÿš€ Get Started - 5min โฑ๏ธ
    - ); + ) } function AITechShowcase() { @@ -94,7 +103,7 @@ function AITechShowcase() { - ); + ) } function FlowDiagram() { @@ -115,15 +124,16 @@ function FlowDiagram() { - ); + ) } export default function Home() { - const {siteConfig} = useDocusaurusContext(); + const { siteConfig } = useDocusaurusContext() return ( + description="AI-Powered Intelligent Mixture-of-Models Router with Neural Network Processing" + >
    @@ -151,5 +161,5 @@ export default function Home() {
    - ); + ) } diff --git a/website/src/pages/roadmap/v0.1.js b/website/src/pages/roadmap/v0.1.js index c9b05d26..2fc027b2 100644 --- a/website/src/pages/roadmap/v0.1.js +++ b/website/src/pages/roadmap/v0.1.js @@ -1,12 +1,12 @@ -import React from 'react'; -import Layout from '@theme/Layout'; -import styles from './roadmap.module.css'; +import React from 'react' +import Layout from '@theme/Layout' +import styles from './roadmap.module.css' const priorityColors = { - 'P0': '#dc3545', // Red for critical - 'P1': '#fd7e14', // Orange for important - 'P2': '#6c757d', // Gray for nice-to-have -}; + P0: '#dc3545', // Red for critical + P1: '#fd7e14', // Orange for important + P2: '#6c757d', // Gray for nice-to-have +} const PriorityBadge = ({ priority }) => ( ( > {priority} -); +) // Counter for generating unique task numbers -let taskCounter = 0; +let taskCounter = 0 const RoadmapItem = ({ title, priority, acceptance, children, id }) => { - taskCounter++; - const taskId = id || `task-${taskCounter}`; - const taskNumber = taskCounter; + taskCounter++ + const taskId = id || `task-${taskCounter}` + const taskNumber = taskCounter return (

    - #{taskNumber} + # + {taskNumber} {' '} {title} @@ -40,12 +41,14 @@ const RoadmapItem = ({ title, priority, acceptance, children, id }) => { {children &&
    {children}
    } {acceptance && (
    - Acceptance: {acceptance} + Acceptance: + {' '} + {acceptance}
    )}

    - ); -}; + ) +} const AreaSection = ({ title, children }) => (
    @@ -54,11 +57,11 @@ const AreaSection = ({ title, children }) => ( {children}
    -); +) export default function RoadmapV01() { // Reset task counter for consistent numbering on re-renders - taskCounter = 0; + taskCounter = 0 return ( Productizing Intelligent Routing with Comprehensive Evaluation

    - +

    Release Goal

    @@ -84,13 +87,25 @@ export default function RoadmapV01() {

  • Comprehensive benchmarking and monitoring beyond MMLU-Pro
  • Production-ready caching and observability
  • - +

    Key P0 Deliverables

      -
    • Router intelligence: Reasoning controller, ExtProc plugins, semantic caching
    • -
    • Operations: K8s operator, benchmarks, monitoring
    • -
    • Quality: Test coverage, integration tests, structured logging
    • +
    • + Router intelligence: + {' '} + Reasoning controller, ExtProc plugins, semantic caching +
    • +
    • + Operations: + {' '} + K8s operator, benchmarks, monitoring +
    • +
    • + Quality: + {' '} + Test coverage, integration tests, structured logging +
    @@ -131,7 +146,7 @@ export default function RoadmapV01() { acceptance="Configurable reasoning effort levels per category; template handling for different model families (GPT OSS/Qwen3/DeepSeek/etc); metrics for reasoning mode decisions and model-specific template usage." /> - +

    Routing Logic

    - +

    Semantic Cache

    - - + + @@ -273,5 +288,5 @@ export default function RoadmapV01() {
    - ); + ) }