diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 069bf330..44b8335c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -48,6 +48,7 @@ jobs: pkg-config npm install -g markdownlint-cli pip install --user yamllint codespell + go install github.com/apache/skywalking-eyes/cmd/license-eye@latest - name: Cache Rust dependencies uses: actions/cache@v4 @@ -94,6 +95,9 @@ jobs: - name: Run Code Spell Check run: make codespell + - name: Run License Header Check + run: make license-check + - name: Run pre-commit check run: make precommit-check diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..d06053de --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,62 @@ +# Copyright 2025 The vLLM Semantic Router Authors. + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +header: + license: + spdx-id: Apache-2.0 + copyright-owner: vLLM Semantic Router Authors + content: | + Copyright 2025 The vLLM Semantic Router Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + paths-ignore: + - website + - bin + - models + - '.github' + - '.bin' + - '**/go.mod' + - '**/go.sum' + - '**/*.md' + - '**/*.json' + - '**/*.txt' + - '**/*.hcl' + - '**/.gitignore' + - '**/.helmignore' + - .trivyignore + - '.codespell.*' + - .editorconfig + - .golangci.yml + - .testcoverage.yml + - '.yamllint*' + - LICENSE + - CODEOWNERS + - OWNER + - Dockerfile + - Dockerfile.extproc + - Dockerfile.precommit + - bench/MANIFEST.in + - tools/linter/codespell/.codespell.ignorewords + - tools/linter/codespell/.codespell.skip + - tools/linter/yaml/.yamllint diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9438abb6..fba51c4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: @@ -94,3 +108,14 @@ repos: # args: ['--max-line-length=88', '--extend-ignore=E203,W503'] # files: \.py$ # exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) + +# License header checking +- repo: local + hooks: + - id: license-check + name: license header check + entry: bash -c "make license-check" + language: system + files: \.(go|rs|py|js|yaml|yml)$ + exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/|node_modules/|website/node_modules/|target/|candle-binding/target/) + pass_filenames: false diff --git a/.prowlabels.yaml b/.prowlabels.yaml index 91a6ec84..24d64b2b 100644 --- a/.prowlabels.yaml +++ b/.prowlabels.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + area: - core - research diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8280fc6d..e7b53b9d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -311,3 +311,21 @@ pre-commit run --all-files ## License By contributing to this project, you agree that your contributions will be licensed under the same license as the project (Apache 2.0). + +### License Headers + +All source code files must include the Apache 2.0 license header. The project uses [license-eye](https://github.com/apache/skywalking-eyes) to automatically manage license headers. + +**Check license headers:** + +```bash +make license-check +``` + +**Automatically add missing license headers:** + +```bash +make license-fix +``` + +The license header check is automatically run as part of the pre-commit hooks and CI pipeline. If you encounter license header issues, simply run `make license-fix` to automatically add the required headers to all applicable files. diff --git a/Makefile b/Makefile index 257156d1..5a6640ac 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Semantic Router Root Makefile Define. # It is refer tools/make/*.mk as the sub-makefiles. diff --git a/bench/benchmark_comparison.sh b/bench/benchmark_comparison.sh index 94e2e862..3077200d 100755 --- a/bench/benchmark_comparison.sh +++ b/bench/benchmark_comparison.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Multi-Dataset Reasoning Benchmark Comparison # diff --git a/bench/build_and_test.sh b/bench/build_and_test.sh index fc27a3aa..d9f28a18 100755 --- a/bench/build_and_test.sh +++ b/bench/build_and_test.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Build and test script for vLLM Semantic Router Bench PyPI package diff --git a/bench/comprehensive_bench.sh b/bench/comprehensive_bench.sh index 5054d537..b344878e 100755 --- a/bench/comprehensive_bench.sh +++ b/bench/comprehensive_bench.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Comprehensive Multi-Dataset Benchmark Script for Research Report # This script benchmarks all available datasets with reasonable sample sizes diff --git a/bench/pyproject.toml b/bench/pyproject.toml index ce79128f..53202997 100644 --- a/bench/pyproject.toml +++ b/bench/pyproject.toml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [build-system] requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" diff --git a/bench/router_reason_bench.py b/bench/router_reason_bench.py index f3567f98..a361effe 100644 --- a/bench/router_reason_bench.py +++ b/bench/router_reason_bench.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import argparse import json import os diff --git a/bench/setup.py b/bench/setup.py index c27e0520..cb2183e3 100644 --- a/bench/setup.py +++ b/bench/setup.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Setup script for vllm-semantic-router-bench package.""" import os diff --git a/bench/vllm_semantic_router_bench/__init__.py b/bench/vllm_semantic_router_bench/__init__.py index f982787f..9bad2f12 100644 --- a/bench/vllm_semantic_router_bench/__init__.py +++ b/bench/vllm_semantic_router_bench/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ vLLM Semantic Router Benchmark Suite diff --git a/bench/vllm_semantic_router_bench/bench_plot.py b/bench/vllm_semantic_router_bench/bench_plot.py index fe72d818..c2e8fc8f 100644 --- a/bench/vllm_semantic_router_bench/bench_plot.py +++ b/bench/vllm_semantic_router_bench/bench_plot.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import argparse import json from pathlib import Path diff --git a/bench/vllm_semantic_router_bench/cli.py b/bench/vllm_semantic_router_bench/cli.py index b8fdab63..512aa4a3 100644 --- a/bench/vllm_semantic_router_bench/cli.py +++ b/bench/vllm_semantic_router_bench/cli.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Command Line Interface for Semantic Router Benchmark Suite """ diff --git a/bench/vllm_semantic_router_bench/dataset_factory.py b/bench/vllm_semantic_router_bench/dataset_factory.py index 429faf9e..e0429619 100644 --- a/bench/vllm_semantic_router_bench/dataset_factory.py +++ b/bench/vllm_semantic_router_bench/dataset_factory.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Dataset factory for loading different evaluation datasets. diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/__init__.py b/bench/vllm_semantic_router_bench/dataset_implementations/__init__.py index 00804dc7..f8f614cb 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/__init__.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Dataset implementations for the benchmark.""" from .arc_dataset import ARCChallengeDataset, ARCDataset, ARCEasyDataset diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/arc_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/arc_dataset.py index b0e9a8c8..e2cfae2c 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/arc_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/arc_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ ARC Dataset Implementation diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/commonsenseqa_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/commonsenseqa_dataset.py index 1735c4ef..bf459db8 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/commonsenseqa_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/commonsenseqa_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ CommonsenseQA dataset implementation. diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/gpqa_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/gpqa_dataset.py index 04abccca..d06e8dcf 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/gpqa_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/gpqa_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ GPQA Dataset Implementation diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/hellaswag_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/hellaswag_dataset.py index 3665dcf2..938957f0 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/hellaswag_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/hellaswag_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ HellaSwag dataset implementation. diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/mmlu_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/mmlu_dataset.py index bf4f64b3..572cff38 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/mmlu_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/mmlu_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ MMLU-Pro Dataset Implementation diff --git a/bench/vllm_semantic_router_bench/dataset_implementations/truthfulqa_dataset.py b/bench/vllm_semantic_router_bench/dataset_implementations/truthfulqa_dataset.py index dfa6e989..fed472e6 100644 --- a/bench/vllm_semantic_router_bench/dataset_implementations/truthfulqa_dataset.py +++ b/bench/vllm_semantic_router_bench/dataset_implementations/truthfulqa_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ TruthfulQA dataset implementation. diff --git a/bench/vllm_semantic_router_bench/dataset_interface.py b/bench/vllm_semantic_router_bench/dataset_interface.py index d4c3c1fe..dda60aa8 100644 --- a/bench/vllm_semantic_router_bench/dataset_interface.py +++ b/bench/vllm_semantic_router_bench/dataset_interface.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Multi-Dataset Evaluation Interface diff --git a/bench/vllm_semantic_router_bench/router_reason_bench_multi_dataset.py b/bench/vllm_semantic_router_bench/router_reason_bench_multi_dataset.py index 5a963ff0..8db500a7 100644 --- a/bench/vllm_semantic_router_bench/router_reason_bench_multi_dataset.py +++ b/bench/vllm_semantic_router_bench/router_reason_bench_multi_dataset.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Multi-Dataset Reasoning Benchmark diff --git a/candle-binding/Cargo.toml b/candle-binding/Cargo.toml index 9b9364f4..50a5d056 100644 --- a/candle-binding/Cargo.toml +++ b/candle-binding/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + [package] name = "candle-semantic-router" version = "0.4.0" diff --git a/candle-binding/semantic-router.go b/candle-binding/semantic-router.go index 85c0e191..d4612cb6 100644 --- a/candle-binding/semantic-router.go +++ b/candle-binding/semantic-router.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build !windows && cgo // +build !windows,cgo diff --git a/candle-binding/semantic-router_test.go b/candle-binding/semantic-router_test.go index f911769a..0c19590f 100644 --- a/candle-binding/semantic-router_test.go +++ b/candle-binding/semantic-router_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package candle_binding import ( diff --git a/candle-binding/src/bert_official.rs b/candle-binding/src/bert_official.rs index 8cd48d38..7ea098fc 100644 --- a/candle-binding/src/bert_official.rs +++ b/candle-binding/src/bert_official.rs @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Official Candle BERT implementation based on Candle examples // Reference: https://github.com/huggingface/candle/blob/main/candle-examples/examples/bert/main.rs diff --git a/candle-binding/src/lib.rs b/candle-binding/src/lib.rs index d778c3fb..dbcc59d5 100644 --- a/candle-binding/src/lib.rs +++ b/candle-binding/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // This file is a binding for the candle-core and candle-transformers libraries. // It is based on https://github.com/huggingface/candle/tree/main/candle-examples/examples/bert use std::collections::HashMap; diff --git a/candle-binding/src/modernbert.rs b/candle-binding/src/modernbert.rs index 16120717..ad17fdf8 100644 --- a/candle-binding/src/modernbert.rs +++ b/candle-binding/src/modernbert.rs @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // ModernBERT binding for classification tasks // Based on ModernBERT implementation in candle-transformers diff --git a/candle-binding/src/unified_classifier.rs b/candle-binding/src/unified_classifier.rs index e2667f26..e23716b2 100644 --- a/candle-binding/src/unified_classifier.rs +++ b/candle-binding/src/unified_classifier.rs @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Unified Classifier for Batch Inference Support // This module implements a unified classification system that: // 1. Uses a single shared ModernBERT encoder for all tasks diff --git a/config/cache/milvus.yaml b/config/cache/milvus.yaml index 0838c4e7..e04bca9c 100644 --- a/config/cache/milvus.yaml +++ b/config/cache/milvus.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Milvus Vector Database Configuration for Semantic Cache # This configuration file contains settings for using Milvus as the semantic cache backend. # To use this configuration: diff --git a/config/config.e2e.yaml b/config/config.e2e.yaml index 6a349122..8d995471 100644 --- a/config/config.e2e.yaml +++ b/config/config.e2e.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + bert_model: model_id: sentence-transformers/all-MiniLM-L12-v2 threshold: 0.6 diff --git a/config/config.testing.yaml b/config/config.testing.yaml index 461010eb..1e9a2779 100644 --- a/config/config.testing.yaml +++ b/config/config.testing.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + bert_model: model_id: sentence-transformers/all-MiniLM-L12-v2 threshold: 0.6 diff --git a/config/config.yaml b/config/config.yaml index cdb4eb0a..56d6e967 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + bert_model: model_id: sentence-transformers/all-MiniLM-L12-v2 threshold: 0.6 diff --git a/config/envoy-docker.yaml b/config/envoy-docker.yaml index 2700b49c..1d97bb38 100644 --- a/config/envoy-docker.yaml +++ b/config/envoy-docker.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + static_resources: listeners: - name: listener_0 diff --git a/config/envoy.yaml b/config/envoy.yaml index 364190be..f27d7f02 100644 --- a/config/envoy.yaml +++ b/config/envoy.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + static_resources: listeners: - name: listener_0 diff --git a/config/examples/generic_categories.yaml b/config/examples/generic_categories.yaml index 04468a4a..36da1690 100644 --- a/config/examples/generic_categories.yaml +++ b/config/examples/generic_categories.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Example: Using generic categories with MMLU-Pro mapping # This file demonstrates how to declare free-style categories and map them to # MMLU-Pro categories expected by the classifier model. diff --git a/config/grafana/dashboards.yaml b/config/grafana/dashboards.yaml index f34ddeef..1d9d74ac 100644 --- a/config/grafana/dashboards.yaml +++ b/config/grafana/dashboards.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: 1 providers: - name: LLM Router Dashboards diff --git a/config/grafana/datasource.yaml b/config/grafana/datasource.yaml index 8d9f9d8f..10830dd5 100644 --- a/config/grafana/datasource.yaml +++ b/config/grafana/datasource.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: 1 datasources: - name: Prometheus diff --git a/config/prometheus.yaml b/config/prometheus.yaml index f9a7ac37..04c77e70 100644 --- a/config/prometheus.yaml +++ b/config/prometheus.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + global: scrape_interval: 10s evaluation_interval: 10s diff --git a/deploy/kubernetes/config.yaml b/deploy/kubernetes/config.yaml index 76cc759f..432d7dfe 100644 --- a/deploy/kubernetes/config.yaml +++ b/deploy/kubernetes/config.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + bert_model: model_id: sentence-transformers/all-MiniLM-L12-v2 threshold: 0.6 diff --git a/deploy/kubernetes/crds/vllm.ai_semanticroutes.yaml b/deploy/kubernetes/crds/vllm.ai_semanticroutes.yaml index c943e699..c1a3fd20 100644 --- a/deploy/kubernetes/crds/vllm.ai_semanticroutes.yaml +++ b/deploy/kubernetes/crds/vllm.ai_semanticroutes.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition diff --git a/deploy/kubernetes/deployment.yaml b/deploy/kubernetes/deployment.yaml index 5f92b82d..16368aae 100644 --- a/deploy/kubernetes/deployment.yaml +++ b/deploy/kubernetes/deployment.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: apps/v1 kind: Deployment metadata: diff --git a/deploy/kubernetes/kustomization.yaml b/deploy/kubernetes/kustomization.yaml index 8160564b..fbee4f4d 100644 --- a/deploy/kubernetes/kustomization.yaml +++ b/deploy/kubernetes/kustomization.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization diff --git a/deploy/kubernetes/namespace.yaml b/deploy/kubernetes/namespace.yaml index e77d3fd8..f2e4d074 100644 --- a/deploy/kubernetes/namespace.yaml +++ b/deploy/kubernetes/namespace.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: Namespace metadata: diff --git a/deploy/kubernetes/pvc.yaml b/deploy/kubernetes/pvc.yaml index 8dfb17d1..603bdfec 100644 --- a/deploy/kubernetes/pvc.yaml +++ b/deploy/kubernetes/pvc.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/deploy/kubernetes/service.yaml b/deploy/kubernetes/service.yaml index 0ea5ed62..07ac817a 100644 --- a/deploy/kubernetes/service.yaml +++ b/deploy/kubernetes/service.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: v1 kind: Service metadata: diff --git a/docker-compose.yml b/docker-compose.yml index 2f9931e4..e67b3367 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + services: # Semantic Router External Processor Service diff --git a/e2e-tests/00-client-request-test.py b/e2e-tests/00-client-request-test.py index 3588df78..44756b76 100644 --- a/e2e-tests/00-client-request-test.py +++ b/e2e-tests/00-client-request-test.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ 00-client-request-test.py - Basic client request tests diff --git a/e2e-tests/01-envoy-extproc-test.py b/e2e-tests/01-envoy-extproc-test.py index 34e6f472..d2f68834 100644 --- a/e2e-tests/01-envoy-extproc-test.py +++ b/e2e-tests/01-envoy-extproc-test.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ 01-envoy-extproc-test.py - Envoy ExtProc interaction tests diff --git a/e2e-tests/02-router-classification-test.py b/e2e-tests/02-router-classification-test.py index 040a522c..f6b8f7c4 100644 --- a/e2e-tests/02-router-classification-test.py +++ b/e2e-tests/02-router-classification-test.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ 02-router-classification-test.py - Router classification tests diff --git a/e2e-tests/04-cache-test.py b/e2e-tests/04-cache-test.py index ce76e377..1b920906 100644 --- a/e2e-tests/04-cache-test.py +++ b/e2e-tests/04-cache-test.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ 04-cache-test.py - Semantic cache tests diff --git a/e2e-tests/llm-katan/demo-embed.html b/e2e-tests/llm-katan/demo-embed.html index b3633fb5..3edee7d5 100644 --- a/e2e-tests/llm-katan/demo-embed.html +++ b/e2e-tests/llm-katan/demo-embed.html @@ -1,3 +1,19 @@ + +
=61.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/e2e-tests/llm-katan/terminal-demo.html b/e2e-tests/llm-katan/terminal-demo.html index 562bf51a..d6edd850 100644 --- a/e2e-tests/llm-katan/terminal-demo.html +++ b/e2e-tests/llm-katan/terminal-demo.html @@ -1,3 +1,19 @@ + + diff --git a/e2e-tests/run_all_tests.py b/e2e-tests/run_all_tests.py index 16fdf686..62ca78b6 100644 --- a/e2e-tests/run_all_tests.py +++ b/e2e-tests/run_all_tests.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Run all tests in sequence. diff --git a/e2e-tests/start-llm-katan.sh b/e2e-tests/start-llm-katan.sh index d69feba4..32f54016 100755 --- a/e2e-tests/start-llm-katan.sh +++ b/e2e-tests/start-llm-katan.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # start-llm-katan.sh - Start LLM Katan servers for testing # # This script starts LLM Katan servers using real tiny models diff --git a/e2e-tests/test_base.py b/e2e-tests/test_base.py index 866239d7..5c184b4d 100644 --- a/e2e-tests/test_base.py +++ b/e2e-tests/test_base.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import unittest from typing import Any, Dict, Optional diff --git a/examples/semanticroute/complex-filter-chain.yaml b/examples/semanticroute/complex-filter-chain.yaml index 6eabacfc..56e92f8e 100644 --- a/examples/semanticroute/complex-filter-chain.yaml +++ b/examples/semanticroute/complex-filter-chain.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/examples/semanticroute/comprehensive-example.yaml b/examples/semanticroute/comprehensive-example.yaml index fd5db4d9..79245216 100644 --- a/examples/semanticroute/comprehensive-example.yaml +++ b/examples/semanticroute/comprehensive-example.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/examples/semanticroute/multiple-routes.yaml b/examples/semanticroute/multiple-routes.yaml index 011c8901..8ef3e5cc 100644 --- a/examples/semanticroute/multiple-routes.yaml +++ b/examples/semanticroute/multiple-routes.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/examples/semanticroute/simple-intent-routing.yaml b/examples/semanticroute/simple-intent-routing.yaml index 99abd5b0..a2177032 100644 --- a/examples/semanticroute/simple-intent-routing.yaml +++ b/examples/semanticroute/simple-intent-routing.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/examples/semanticroute/tool-selection-example.yaml b/examples/semanticroute/tool-selection-example.yaml index 7cd4c219..eb61b6e5 100644 --- a/examples/semanticroute/tool-selection-example.yaml +++ b/examples/semanticroute/tool-selection-example.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/examples/semanticroute/weighted-routing.yaml b/examples/semanticroute/weighted-routing.yaml index 19f381cb..1a16d7ed 100644 --- a/examples/semanticroute/weighted-routing.yaml +++ b/examples/semanticroute/weighted-routing.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + apiVersion: vllm.ai/v1alpha1 kind: SemanticRoute metadata: diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index c0b4093a..06fc014b 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + set -euo pipefail CONFIG_FILE_PATH=${CONFIG_FILE:-/app/config/config.yaml} diff --git a/src/semantic-router/cmd/main.go b/src/semantic-router/cmd/main.go index 25dee37b..397febee 100644 --- a/src/semantic-router/cmd/main.go +++ b/src/semantic-router/cmd/main.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/semantic-router/pkg/api/server.go b/src/semantic-router/pkg/api/server.go index 6fe8dfd3..2722cf15 100644 --- a/src/semantic-router/pkg/api/server.go +++ b/src/semantic-router/pkg/api/server.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api import ( diff --git a/src/semantic-router/pkg/api/server_test.go b/src/semantic-router/pkg/api/server_test.go index 4e5c18f1..33fe27f8 100644 --- a/src/semantic-router/pkg/api/server_test.go +++ b/src/semantic-router/pkg/api/server_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package api import ( diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/doc.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/doc.go index fa6e3ba6..cecdb8e6 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/doc.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/doc.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // Package v1alpha1 contains API Schema definitions for the v1alpha1 API group // +kubebuilder:object:generate=true // +groupName=vllm.ai diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_helpers.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_helpers.go index fef12657..4e9a5d9e 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_helpers.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_helpers.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /* Copyright 2025 vLLM Semantic Router. diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_types.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_types.go index 7394954a..8ba5af11 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_types.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/filter_types.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /* Copyright 2025 vLLM Semantic Router. diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/register.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/register.go index 368bfb9a..893dba4f 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/register.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/register.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /* Copyright 2025 vLLM Semantic Router. diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/types.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/types.go index ba4ba0b5..01da71c8 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/types.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/types.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /* Copyright 2025 vLLM Semantic Router. diff --git a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/zz_generated.deepcopy.go b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/zz_generated.deepcopy.go index d4aab7df..09c28b54 100644 --- a/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/zz_generated.deepcopy.go +++ b/src/semantic-router/pkg/apis/vllm.ai/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build !ignore_autogenerated /* diff --git a/src/semantic-router/pkg/cache/cache.go b/src/semantic-router/pkg/cache/cache.go index f2f3e814..4f6dfa3b 100644 --- a/src/semantic-router/pkg/cache/cache.go +++ b/src/semantic-router/pkg/cache/cache.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import ( diff --git a/src/semantic-router/pkg/cache/cache_factory.go b/src/semantic-router/pkg/cache/cache_factory.go index f3343c5a..1f5fa228 100644 --- a/src/semantic-router/pkg/cache/cache_factory.go +++ b/src/semantic-router/pkg/cache/cache_factory.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import ( diff --git a/src/semantic-router/pkg/cache/cache_interface.go b/src/semantic-router/pkg/cache/cache_interface.go index f35e165c..ee107f46 100644 --- a/src/semantic-router/pkg/cache/cache_interface.go +++ b/src/semantic-router/pkg/cache/cache_interface.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import "time" diff --git a/src/semantic-router/pkg/cache/cache_test.go b/src/semantic-router/pkg/cache/cache_test.go index 8e6104ee..c8cbd664 100644 --- a/src/semantic-router/pkg/cache/cache_test.go +++ b/src/semantic-router/pkg/cache/cache_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache_test import ( diff --git a/src/semantic-router/pkg/cache/eviction_policy.go b/src/semantic-router/pkg/cache/eviction_policy.go index 921f17f6..667c48d1 100644 --- a/src/semantic-router/pkg/cache/eviction_policy.go +++ b/src/semantic-router/pkg/cache/eviction_policy.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache type EvictionPolicy interface { diff --git a/src/semantic-router/pkg/cache/eviction_policy_test.go b/src/semantic-router/pkg/cache/eviction_policy_test.go index 91d5504a..67d9b01e 100644 --- a/src/semantic-router/pkg/cache/eviction_policy_test.go +++ b/src/semantic-router/pkg/cache/eviction_policy_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import ( diff --git a/src/semantic-router/pkg/cache/inmemory_cache.go b/src/semantic-router/pkg/cache/inmemory_cache.go index 07595a52..d1771171 100644 --- a/src/semantic-router/pkg/cache/inmemory_cache.go +++ b/src/semantic-router/pkg/cache/inmemory_cache.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + //go:build !windows && cgo // +build !windows,cgo diff --git a/src/semantic-router/pkg/cache/inmemory_cache_integration_test.go b/src/semantic-router/pkg/cache/inmemory_cache_integration_test.go index caffe6b9..4fa0f75d 100644 --- a/src/semantic-router/pkg/cache/inmemory_cache_integration_test.go +++ b/src/semantic-router/pkg/cache/inmemory_cache_integration_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import ( diff --git a/src/semantic-router/pkg/cache/milvus_cache.go b/src/semantic-router/pkg/cache/milvus_cache.go index 725f711b..5e732c81 100644 --- a/src/semantic-router/pkg/cache/milvus_cache.go +++ b/src/semantic-router/pkg/cache/milvus_cache.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package cache import ( diff --git a/src/semantic-router/pkg/config/config.go b/src/semantic-router/pkg/config/config.go index 18828570..8d4a21e8 100644 --- a/src/semantic-router/pkg/config/config.go +++ b/src/semantic-router/pkg/config/config.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config import ( diff --git a/src/semantic-router/pkg/config/config_reset_test.go b/src/semantic-router/pkg/config/config_reset_test.go index 54d1dc49..68c652c3 100644 --- a/src/semantic-router/pkg/config/config_reset_test.go +++ b/src/semantic-router/pkg/config/config_reset_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config import "sync" diff --git a/src/semantic-router/pkg/config/config_test.go b/src/semantic-router/pkg/config/config_test.go index b4028476..0f6da15c 100644 --- a/src/semantic-router/pkg/config/config_test.go +++ b/src/semantic-router/pkg/config/config_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config_test import ( diff --git a/src/semantic-router/pkg/config/mmlu_categories_test.go b/src/semantic-router/pkg/config/mmlu_categories_test.go index fa2685f2..e7663f8d 100644 --- a/src/semantic-router/pkg/config/mmlu_categories_test.go +++ b/src/semantic-router/pkg/config/mmlu_categories_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config_test import ( diff --git a/src/semantic-router/pkg/config/parse_configfile_test.go b/src/semantic-router/pkg/config/parse_configfile_test.go index b0b3d692..36c56d3e 100644 --- a/src/semantic-router/pkg/config/parse_configfile_test.go +++ b/src/semantic-router/pkg/config/parse_configfile_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config_test import ( diff --git a/src/semantic-router/pkg/config/validation.go b/src/semantic-router/pkg/config/validation.go index 3a20c4ca..b3c774cd 100644 --- a/src/semantic-router/pkg/config/validation.go +++ b/src/semantic-router/pkg/config/validation.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config import ( diff --git a/src/semantic-router/pkg/config/validation_test.go b/src/semantic-router/pkg/config/validation_test.go index 8fa758e3..44605335 100644 --- a/src/semantic-router/pkg/config/validation_test.go +++ b/src/semantic-router/pkg/config/validation_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package config import ( diff --git a/src/semantic-router/pkg/consts/consts.go b/src/semantic-router/pkg/consts/consts.go index cf1486bf..c7a65e72 100644 --- a/src/semantic-router/pkg/consts/consts.go +++ b/src/semantic-router/pkg/consts/consts.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package consts // UnknownLabel is a canonical fallback label value used across the codebase diff --git a/src/semantic-router/pkg/extproc/caching_test.go b/src/semantic-router/pkg/extproc/caching_test.go index b67831af..29ee2d7e 100644 --- a/src/semantic-router/pkg/extproc/caching_test.go +++ b/src/semantic-router/pkg/extproc/caching_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/edge_cases_test.go b/src/semantic-router/pkg/extproc/edge_cases_test.go index f402edac..5c097788 100644 --- a/src/semantic-router/pkg/extproc/edge_cases_test.go +++ b/src/semantic-router/pkg/extproc/edge_cases_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/endpoint_selection_test.go b/src/semantic-router/pkg/extproc/endpoint_selection_test.go index f3e74cb8..dc287169 100644 --- a/src/semantic-router/pkg/extproc/endpoint_selection_test.go +++ b/src/semantic-router/pkg/extproc/endpoint_selection_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/error_metrics_test.go b/src/semantic-router/pkg/extproc/error_metrics_test.go index b7544804..6aac5f03 100644 --- a/src/semantic-router/pkg/extproc/error_metrics_test.go +++ b/src/semantic-router/pkg/extproc/error_metrics_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/extproc_test.go b/src/semantic-router/pkg/extproc/extproc_test.go index cc4a8d90..09c0644e 100644 --- a/src/semantic-router/pkg/extproc/extproc_test.go +++ b/src/semantic-router/pkg/extproc/extproc_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/metrics_integration_test.go b/src/semantic-router/pkg/extproc/metrics_integration_test.go index 964e714b..1d7767af 100644 --- a/src/semantic-router/pkg/extproc/metrics_integration_test.go +++ b/src/semantic-router/pkg/extproc/metrics_integration_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/model_selector.go b/src/semantic-router/pkg/extproc/model_selector.go index 2f16bbf3..64019f40 100644 --- a/src/semantic-router/pkg/extproc/model_selector.go +++ b/src/semantic-router/pkg/extproc/model_selector.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/processor.go b/src/semantic-router/pkg/extproc/processor.go index 9b299ba2..98275237 100644 --- a/src/semantic-router/pkg/extproc/processor.go +++ b/src/semantic-router/pkg/extproc/processor.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( 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 99b5639c..5fe0c242 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_config_test.go +++ b/src/semantic-router/pkg/extproc/reason_mode_config_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/reason_mode_selector.go b/src/semantic-router/pkg/extproc/reason_mode_selector.go index f91cfad2..000b9706 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_selector.go +++ b/src/semantic-router/pkg/extproc/reason_mode_selector.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( 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 0a8a1f0a..d7be9c1b 100644 --- a/src/semantic-router/pkg/extproc/reason_mode_selector_test.go +++ b/src/semantic-router/pkg/extproc/reason_mode_selector_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/reasoning_integration_test.go b/src/semantic-router/pkg/extproc/reasoning_integration_test.go index a45bec07..69e9f8aa 100644 --- a/src/semantic-router/pkg/extproc/reasoning_integration_test.go +++ b/src/semantic-router/pkg/extproc/reasoning_integration_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/request_handler.go b/src/semantic-router/pkg/extproc/request_handler.go index 867333de..0d05f35c 100644 --- a/src/semantic-router/pkg/extproc/request_handler.go +++ b/src/semantic-router/pkg/extproc/request_handler.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/request_processing_test.go b/src/semantic-router/pkg/extproc/request_processing_test.go index a0cea76f..079649ae 100644 --- a/src/semantic-router/pkg/extproc/request_processing_test.go +++ b/src/semantic-router/pkg/extproc/request_processing_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/response_handler.go b/src/semantic-router/pkg/extproc/response_handler.go index 5fbe9711..39160b56 100644 --- a/src/semantic-router/pkg/extproc/response_handler.go +++ b/src/semantic-router/pkg/extproc/response_handler.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/router.go b/src/semantic-router/pkg/extproc/router.go index 90eed7c5..11afb574 100644 --- a/src/semantic-router/pkg/extproc/router.go +++ b/src/semantic-router/pkg/extproc/router.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/security_test.go b/src/semantic-router/pkg/extproc/security_test.go index 58edc209..d5cfaddb 100644 --- a/src/semantic-router/pkg/extproc/security_test.go +++ b/src/semantic-router/pkg/extproc/security_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/server.go b/src/semantic-router/pkg/extproc/server.go index 12693e3e..3aa1c0bb 100644 --- a/src/semantic-router/pkg/extproc/server.go +++ b/src/semantic-router/pkg/extproc/server.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/stream_handling_test.go b/src/semantic-router/pkg/extproc/stream_handling_test.go index b9c2e0c3..b13f4bc0 100644 --- a/src/semantic-router/pkg/extproc/stream_handling_test.go +++ b/src/semantic-router/pkg/extproc/stream_handling_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/test_utils_test.go b/src/semantic-router/pkg/extproc/test_utils_test.go index 2f53a762..32ba856c 100644 --- a/src/semantic-router/pkg/extproc/test_utils_test.go +++ b/src/semantic-router/pkg/extproc/test_utils_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc_test import ( diff --git a/src/semantic-router/pkg/extproc/testing_helpers_test.go b/src/semantic-router/pkg/extproc/testing_helpers_test.go index 492ca099..a31bf312 100644 --- a/src/semantic-router/pkg/extproc/testing_helpers_test.go +++ b/src/semantic-router/pkg/extproc/testing_helpers_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/extproc/utils.go b/src/semantic-router/pkg/extproc/utils.go index fd183288..e48d0d49 100644 --- a/src/semantic-router/pkg/extproc/utils.go +++ b/src/semantic-router/pkg/extproc/utils.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package extproc import ( diff --git a/src/semantic-router/pkg/metrics/metrics.go b/src/semantic-router/pkg/metrics/metrics.go index 50fdd637..ccc41be2 100644 --- a/src/semantic-router/pkg/metrics/metrics.go +++ b/src/semantic-router/pkg/metrics/metrics.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package metrics import ( diff --git a/src/semantic-router/pkg/metrics/metrics_test.go b/src/semantic-router/pkg/metrics/metrics_test.go index 371ad51d..4574cfb8 100644 --- a/src/semantic-router/pkg/metrics/metrics_test.go +++ b/src/semantic-router/pkg/metrics/metrics_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package metrics import ( diff --git a/src/semantic-router/pkg/observability/logging.go b/src/semantic-router/pkg/observability/logging.go index 9f358192..3b46cfaa 100644 --- a/src/semantic-router/pkg/observability/logging.go +++ b/src/semantic-router/pkg/observability/logging.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package observability import ( diff --git a/src/semantic-router/pkg/services/classification.go b/src/semantic-router/pkg/services/classification.go index 1240e1e5..a13d8c47 100644 --- a/src/semantic-router/pkg/services/classification.go +++ b/src/semantic-router/pkg/services/classification.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package services import ( diff --git a/src/semantic-router/pkg/services/classification_test.go b/src/semantic-router/pkg/services/classification_test.go index 281418d0..de9ee95e 100644 --- a/src/semantic-router/pkg/services/classification_test.go +++ b/src/semantic-router/pkg/services/classification_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package services import ( diff --git a/src/semantic-router/pkg/tools/tools.go b/src/semantic-router/pkg/tools/tools.go index e3279f9e..f3d180ad 100644 --- a/src/semantic-router/pkg/tools/tools.go +++ b/src/semantic-router/pkg/tools/tools.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package tools import ( diff --git a/src/semantic-router/pkg/utils/classification/classifier.go b/src/semantic-router/pkg/utils/classification/classifier.go index 681d4d76..7add0f00 100644 --- a/src/semantic-router/pkg/utils/classification/classifier.go +++ b/src/semantic-router/pkg/utils/classification/classifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/classifier_test.go b/src/semantic-router/pkg/utils/classification/classifier_test.go index 5606b3a1..f57c4453 100644 --- a/src/semantic-router/pkg/utils/classification/classifier_test.go +++ b/src/semantic-router/pkg/utils/classification/classifier_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/generic_category_mapping_test.go b/src/semantic-router/pkg/utils/classification/generic_category_mapping_test.go index d58ac518..0a595029 100644 --- a/src/semantic-router/pkg/utils/classification/generic_category_mapping_test.go +++ b/src/semantic-router/pkg/utils/classification/generic_category_mapping_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/mapping.go b/src/semantic-router/pkg/utils/classification/mapping.go index 0c45e0ec..071a7f19 100644 --- a/src/semantic-router/pkg/utils/classification/mapping.go +++ b/src/semantic-router/pkg/utils/classification/mapping.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/model_discovery.go b/src/semantic-router/pkg/utils/classification/model_discovery.go index a27b1611..1cd18380 100644 --- a/src/semantic-router/pkg/utils/classification/model_discovery.go +++ b/src/semantic-router/pkg/utils/classification/model_discovery.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/model_discovery_test.go b/src/semantic-router/pkg/utils/classification/model_discovery_test.go index 8cd2f981..804414a1 100644 --- a/src/semantic-router/pkg/utils/classification/model_discovery_test.go +++ b/src/semantic-router/pkg/utils/classification/model_discovery_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/classification/unified_classifier.go b/src/semantic-router/pkg/utils/classification/unified_classifier.go index 68d76d78..93c39299 100644 --- a/src/semantic-router/pkg/utils/classification/unified_classifier.go +++ b/src/semantic-router/pkg/utils/classification/unified_classifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification /* diff --git a/src/semantic-router/pkg/utils/classification/unified_classifier_test.go b/src/semantic-router/pkg/utils/classification/unified_classifier_test.go index 0baa039e..081ddb00 100644 --- a/src/semantic-router/pkg/utils/classification/unified_classifier_test.go +++ b/src/semantic-router/pkg/utils/classification/unified_classifier_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package classification import ( diff --git a/src/semantic-router/pkg/utils/entropy/entropy.go b/src/semantic-router/pkg/utils/entropy/entropy.go index ee1602cb..beb7d13d 100644 --- a/src/semantic-router/pkg/utils/entropy/entropy.go +++ b/src/semantic-router/pkg/utils/entropy/entropy.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package entropy import ( diff --git a/src/semantic-router/pkg/utils/entropy/entropy_test.go b/src/semantic-router/pkg/utils/entropy/entropy_test.go index 5c192c78..9bb13c7c 100644 --- a/src/semantic-router/pkg/utils/entropy/entropy_test.go +++ b/src/semantic-router/pkg/utils/entropy/entropy_test.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package entropy import ( diff --git a/src/semantic-router/pkg/utils/http/response.go b/src/semantic-router/pkg/utils/http/response.go index 58ef1103..3a279457 100644 --- a/src/semantic-router/pkg/utils/http/response.go +++ b/src/semantic-router/pkg/utils/http/response.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package http import ( diff --git a/src/semantic-router/pkg/utils/pii/policy.go b/src/semantic-router/pkg/utils/pii/policy.go index 9104f8ae..df5c7fb3 100644 --- a/src/semantic-router/pkg/utils/pii/policy.go +++ b/src/semantic-router/pkg/utils/pii/policy.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package pii import ( diff --git a/src/training/classifier_model_fine_tuning/ft.py b/src/training/classifier_model_fine_tuning/ft.py index 780a5826..c1cab72e 100644 --- a/src/training/classifier_model_fine_tuning/ft.py +++ b/src/training/classifier_model_fine_tuning/ft.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import os diff --git a/src/training/classifier_model_fine_tuning/ft_linear.py b/src/training/classifier_model_fine_tuning/ft_linear.py index 3c736202..2b5d062f 100644 --- a/src/training/classifier_model_fine_tuning/ft_linear.py +++ b/src/training/classifier_model_fine_tuning/ft_linear.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ MMLU-Pro Category Classification Fine-tuning with Multiple BERT Models Uses the Hugging Face Transformers approach with AutoModelForSequenceClassification. diff --git a/src/training/classifier_model_fine_tuning/test_classifier_python.py b/src/training/classifier_model_fine_tuning/test_classifier_python.py index 6ad3af35..f16e5418 100644 --- a/src/training/classifier_model_fine_tuning/test_classifier_python.py +++ b/src/training/classifier_model_fine_tuning/test_classifier_python.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import os import traceback diff --git a/src/training/classifier_model_fine_tuning/test_linear_classifier.go b/src/training/classifier_model_fine_tuning/test_linear_classifier.go index 7384a43c..5965796a 100644 --- a/src/training/classifier_model_fine_tuning/test_linear_classifier.go +++ b/src/training/classifier_model_fine_tuning/test_linear_classifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/dual_classifier/data_generator.py b/src/training/dual_classifier/data_generator.py index 8cde359c..f06765e0 100644 --- a/src/training/dual_classifier/data_generator.py +++ b/src/training/dual_classifier/data_generator.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import random import re from typing import Dict, List, Tuple diff --git a/src/training/dual_classifier/dual_classifier.py b/src/training/dual_classifier/dual_classifier.py index 6cdb30ef..00884ebd 100644 --- a/src/training/dual_classifier/dual_classifier.py +++ b/src/training/dual_classifier/dual_classifier.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Dict, List, Optional, Tuple, Union import numpy as np diff --git a/src/training/dual_classifier/example.py b/src/training/dual_classifier/example.py index ccec6d1e..27cf062e 100644 --- a/src/training/dual_classifier/example.py +++ b/src/training/dual_classifier/example.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import torch from dual_classifier import DualClassifier diff --git a/src/training/dual_classifier/test_dual_classifier.py b/src/training/dual_classifier/test_dual_classifier.py index 5f846f9e..a81698aa 100644 --- a/src/training/dual_classifier/test_dual_classifier.py +++ b/src/training/dual_classifier/test_dual_classifier.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest import torch from dual_classifier import DualClassifier diff --git a/src/training/dual_classifier/test_dual_classifier_system.py b/src/training/dual_classifier/test_dual_classifier_system.py index 118238c4..5dd24dcd 100644 --- a/src/training/dual_classifier/test_dual_classifier_system.py +++ b/src/training/dual_classifier/test_dual_classifier_system.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import os import tempfile diff --git a/src/training/dual_classifier/test_existing_model.py b/src/training/dual_classifier/test_existing_model.py index 8a910090..460ba90f 100644 --- a/src/training/dual_classifier/test_existing_model.py +++ b/src/training/dual_classifier/test_existing_model.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import torch from dual_classifier import DualClassifier diff --git a/src/training/dual_classifier/train_example.py b/src/training/dual_classifier/train_example.py index 7e8decf4..faeffdf3 100644 --- a/src/training/dual_classifier/train_example.py +++ b/src/training/dual_classifier/train_example.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import time diff --git a/src/training/dual_classifier/trainer.py b/src/training/dual_classifier/trainer.py index 773a6bab..696df4c6 100644 --- a/src/training/dual_classifier/trainer.py +++ b/src/training/dual_classifier/trainer.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import os from typing import Dict, List, Optional, Tuple, Union diff --git a/src/training/model_eval/arc_challenge_vllm_eval.py b/src/training/model_eval/arc_challenge_vllm_eval.py index a3d03502..e9f75de7 100644 --- a/src/training/model_eval/arc_challenge_vllm_eval.py +++ b/src/training/model_eval/arc_challenge_vllm_eval.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ARC Challenge evaluation script for vLLM OpenAI API endpoint # Based on mmlu_pro_vllm_eval.py and ARC dataset format # Usage example: diff --git a/src/training/model_eval/mmlu_pro_vllm_eval.py b/src/training/model_eval/mmlu_pro_vllm_eval.py index 395f45a5..5ef1bd70 100755 --- a/src/training/model_eval/mmlu_pro_vllm_eval.py +++ b/src/training/model_eval/mmlu_pro_vllm_eval.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # MMLU-Pro evaluation script for vLLM OpenAI API endpoint # Based on https://github.com/TIGER-AI-Lab/MMLU-Pro/blob/main/evaluate_from_api.py # Sample usage: diff --git a/src/training/model_eval/plot_category_accuracies.py b/src/training/model_eval/plot_category_accuracies.py index 979e7370..4717d43f 100644 --- a/src/training/model_eval/plot_category_accuracies.py +++ b/src/training/model_eval/plot_category_accuracies.py @@ -1,4 +1,18 @@ #!/usr/bin/env python3 +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # plot_category_accuracies.py - Visualize MMLU-Pro results by category import argparse diff --git a/src/training/model_eval/result_to_config.py b/src/training/model_eval/result_to_config.py index e5c5c2c3..66483f99 100644 --- a/src/training/model_eval/result_to_config.py +++ b/src/training/model_eval/result_to_config.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # analyze_mmlu_results.py - Analyzes MMLU-Pro results and generates optimized config.yaml import argparse diff --git a/src/training/multitask_bert_fine_tuning/multitask_bert_training.py b/src/training/multitask_bert_fine_tuning/multitask_bert_training.py index c58c66b9..f1381038 100644 --- a/src/training/multitask_bert_fine_tuning/multitask_bert_training.py +++ b/src/training/multitask_bert_fine_tuning/multitask_bert_training.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Fine tune BERT for multitask learning # Motivated by research papers that explain the benefits of multitask learning in resource efficiency diff --git a/src/training/pii_model_fine_tuning/pii_bert_finetuning.py b/src/training/pii_model_fine_tuning/pii_bert_finetuning.py index c24d32c2..9844cc19 100755 --- a/src/training/pii_model_fine_tuning/pii_bert_finetuning.py +++ b/src/training/pii_model_fine_tuning/pii_bert_finetuning.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ PII Token Classification Fine-tuning with Multiple BERT Models Supports token classification (NER-style) for precise PII entity detection and location. diff --git a/src/training/pii_model_fine_tuning/pii_classifier_verifier.go b/src/training/pii_model_fine_tuning/pii_classifier_verifier.go index caceb0a9..1b7d4908 100644 --- a/src/training/pii_model_fine_tuning/pii_classifier_verifier.go +++ b/src/training/pii_model_fine_tuning/pii_classifier_verifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/prompt_guard_fine_tuning/jailbreak_bert_finetuning.py b/src/training/prompt_guard_fine_tuning/jailbreak_bert_finetuning.py index a795f12a..b8b39a34 100644 --- a/src/training/prompt_guard_fine_tuning/jailbreak_bert_finetuning.py +++ b/src/training/prompt_guard_fine_tuning/jailbreak_bert_finetuning.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Jailbreak Classification Fine-tuning with Multiple BERT Models Uses the simplified Hugging Face Transformers approach with AutoModelForSequenceClassification. diff --git a/src/training/prompt_guard_fine_tuning/jailbreak_classifier_verifier.go b/src/training/prompt_guard_fine_tuning/jailbreak_classifier_verifier.go index e592e242..ba2ee0b7 100644 --- a/src/training/prompt_guard_fine_tuning/jailbreak_classifier_verifier.go +++ b/src/training/prompt_guard_fine_tuning/jailbreak_classifier_verifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora.py b/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora.py index 3a955a46..7f4841d9 100644 --- a/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora.py +++ b/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ MMLU-Pro Category Classification Fine-tuning with Enhanced LoRA Training Uses PEFT (Parameter-Efficient Fine-Tuning) with LoRA adapters for efficient intent classification. diff --git a/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora_verifier.go b/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora_verifier.go index 46c619e1..a2120c74 100644 --- a/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora_verifier.go +++ b/src/training/training_lora/classifier_model_fine_tuning_lora/ft_linear_lora_verifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/training_lora/classifier_model_fine_tuning_lora/train_cpu_optimized.sh b/src/training/training_lora/classifier_model_fine_tuning_lora/train_cpu_optimized.sh index 4e1d4402..5328eb57 100755 --- a/src/training/training_lora/classifier_model_fine_tuning_lora/train_cpu_optimized.sh +++ b/src/training/training_lora/classifier_model_fine_tuning_lora/train_cpu_optimized.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # CPU-Optimized Training Script for Intent Classification LoRA # ============================================================= diff --git a/src/training/training_lora/common_lora_utils.py b/src/training/training_lora/common_lora_utils.py index 9a287554..3d9d0735 100644 --- a/src/training/training_lora/common_lora_utils.py +++ b/src/training/training_lora/common_lora_utils.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Common LoRA Training Utilities ============================= diff --git a/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora.py b/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora.py index f182499b..d6dd0b57 100644 --- a/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora.py +++ b/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ PII Token Classification Fine-tuning with Enhanced LoRA Training Uses PEFT (Parameter-Efficient Fine-Tuning) with LoRA adapters for efficient token classification. diff --git a/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora_verifier.go b/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora_verifier.go index 93ed287c..834e0272 100644 --- a/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora_verifier.go +++ b/src/training/training_lora/pii_model_fine_tuning_lora/pii_bert_finetuning_lora_verifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/training_lora/pii_model_fine_tuning_lora/train_cpu_optimized.sh b/src/training/training_lora/pii_model_fine_tuning_lora/train_cpu_optimized.sh index 49e46ee2..df65658b 100755 --- a/src/training/training_lora/pii_model_fine_tuning_lora/train_cpu_optimized.sh +++ b/src/training/training_lora/pii_model_fine_tuning_lora/train_cpu_optimized.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # CPU-Optimized Training Script for PII Detection LoRA # ==================================================== diff --git a/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora.py b/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora.py index 76b6df02..4ad553f4 100644 --- a/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora.py +++ b/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Jailbreak Classification Fine-tuning with Enhanced LoRA Training Uses PEFT (Parameter-Efficient Fine-Tuning) with LoRA adapters for efficient security detection. diff --git a/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora_verifier.go b/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora_verifier.go index f70de786..1f1f56f1 100644 --- a/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora_verifier.go +++ b/src/training/training_lora/prompt_guard_fine_tuning_lora/jailbreak_bert_finetuning_lora_verifier.go @@ -1,3 +1,17 @@ +// Copyright 2025 The vLLM Semantic Router Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package main import ( diff --git a/src/training/training_lora/prompt_guard_fine_tuning_lora/train_cpu_optimized.sh b/src/training/training_lora/prompt_guard_fine_tuning_lora/train_cpu_optimized.sh index 7b717205..2f2a6be2 100755 --- a/src/training/training_lora/prompt_guard_fine_tuning_lora/train_cpu_optimized.sh +++ b/src/training/training_lora/prompt_guard_fine_tuning_lora/train_cpu_optimized.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # CPU-Optimized Training Script for Security Detection LoRA # ========================================================== diff --git a/tools/linter/codespell/.codespell.skip b/tools/linter/codespell/.codespell.skip index c1002a15..b8405007 100644 --- a/tools/linter/codespell/.codespell.skip +++ b/tools/linter/codespell/.codespell.skip @@ -14,3 +14,4 @@ ./website/node_modules/* ./website/package-lock.json ./candle-binding/target +./models/* diff --git a/tools/linter/markdown/markdownlint.yaml b/tools/linter/markdown/markdownlint.yaml index 0e00f8e2..e0bc12de 100644 --- a/tools/linter/markdown/markdownlint.yaml +++ b/tools/linter/markdown/markdownlint.yaml @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # MD003 heading-style/header-style Heading style MD003: false diff --git a/tools/make/build-run-test.mk b/tools/make/build-run-test.mk index 67ccb4fa..d1065a79 100644 --- a/tools/make/build-run-test.mk +++ b/tools/make/build-run-test.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ============== build-run-test.mk ============== # = Project build, run and test related = # =============== build-run-test.mk ============= diff --git a/tools/make/common.mk b/tools/make/common.mk index d34f2dbc..81970635 100644 --- a/tools/make/common.mk +++ b/tools/make/common.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ====================== common.mk ====================== # = Common function or variables for other makefiles = # ====================== common.mk ====================== diff --git a/tools/make/docs.mk b/tools/make/docs.mk index 5d794172..4954ffe0 100644 --- a/tools/make/docs.mk +++ b/tools/make/docs.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ========================== docs.mk ========================== # = Everything For Docs,include API Docs and Docs Website = # ========================== docs.mk ========================== diff --git a/tools/make/envoy.mk b/tools/make/envoy.mk index c790fc73..fd7b9643 100644 --- a/tools/make/envoy.mk +++ b/tools/make/envoy.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ======== envoy.mk ======== # = Everything For envoy = # ======== envoy.mk ======== diff --git a/tools/make/envs.mk b/tools/make/envs.mk index f4c9e81f..b85c93de 100644 --- a/tools/make/envs.mk +++ b/tools/make/envs.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ====================== envs.mk ====================== # = Environment Makefile, refer for other makefile = # ====================== envs.mk ====================== diff --git a/tools/make/golang.mk b/tools/make/golang.mk index 06441e20..b208b02b 100644 --- a/tools/make/golang.mk +++ b/tools/make/golang.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ======== golang.mk ======== # = Everything For Golang = # ======== golang.mk ======== diff --git a/tools/make/linter.mk b/tools/make/linter.mk index 940b8b35..d2dc41f3 100644 --- a/tools/make/linter.mk +++ b/tools/make/linter.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # =============================== linter.mk ========================== # = Everything For Project Linter, markdown, yaml, code spell etc. = # =============================== linter.mk ========================== @@ -26,3 +40,22 @@ codespell: CODESPELL_SKIP := $(shell cat tools/linter/codespell/.codespell.skip codespell: @$(LOG_TARGET) codespell --skip $(CODESPELL_SKIP) --ignore-words tools/linter/codespell/.codespell.ignorewords --check-filenames + +# License header checking and fixing +license-check: + @$(LOG_TARGET) + @echo "Checking license headers..." + @if ! command -v license-eye >/dev/null 2>&1; then \ + echo "Installing license-eye..."; \ + go install github.com/apache/skywalking-eyes/cmd/license-eye@latest; \ + fi + license-eye header check + +license-fix: + @$(LOG_TARGET) + @echo "Fixing license headers..." + @if ! command -v license-eye >/dev/null 2>&1; then \ + echo "Installing license-eye..."; \ + go install github.com/apache/skywalking-eyes/cmd/license-eye@latest; \ + fi + license-eye header fix diff --git a/tools/make/milvus.mk b/tools/make/milvus.mk index d435dd22..d8e41096 100644 --- a/tools/make/milvus.mk +++ b/tools/make/milvus.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ======== milvus.mk ======== # = Everything For milvus = # ======== milvus.mk ======== diff --git a/tools/make/models.mk b/tools/make/models.mk index 08342024..d4f3ef4f 100644 --- a/tools/make/models.mk +++ b/tools/make/models.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ======== models.mk ======== # = Everything For models = # ======== models.mk ======== diff --git a/tools/make/pre-commit.mk b/tools/make/pre-commit.mk index 53d6a54f..aba1b105 100644 --- a/tools/make/pre-commit.mk +++ b/tools/make/pre-commit.mk @@ -1,25 +1,25 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + PRECOMMIT_CONTAINER := ghcr.io/vllm-project/semantic-router/precommit:latest precommit-install: pip install pre-commit precommit-check: - @FILES=$$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o -name "*.js" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) \ - ! -path "./target/*" \ - ! -path "./candle-binding/target/*" \ - ! -path "./.git/*" \ - ! -path "./node_modules/*" \ - ! -path "./vendor/*" \ - ! -path "./__pycache__/*" \ - ! -path "./site/*" \ - ! -name "*.pb.go" \ - | tr '\n' ' '); \ - if [ -n "$$FILES" ]; then \ - echo "Running pre-commit on files: $$FILES"; \ - pre-commit run --files $$FILES; \ - else \ - echo "No Go, Rust, JavaScript, Markdown, Yaml, or Python files found to check"; \ - fi + @echo "Running pre-commit on all files..." + pre-commit run --all-files # Run pre-commit hooks in a Docker container, # and you can exec container to run bash for debug. diff --git a/tools/make/rust.mk b/tools/make/rust.mk index 7b94516f..95f7daa4 100644 --- a/tools/make/rust.mk +++ b/tools/make/rust.mk @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # ======== rust.mk ======== # = Everything For rust = # ======== rust.mk ======== diff --git a/tools/mock-vllm/Dockerfile b/tools/mock-vllm/Dockerfile index c11141d1..7afb1b1f 100644 --- a/tools/mock-vllm/Dockerfile +++ b/tools/mock-vllm/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM python:3.11-slim WORKDIR /app diff --git a/tools/mock-vllm/app.py b/tools/mock-vllm/app.py index e4d02d15..837d63ed 100644 --- a/tools/mock-vllm/app.py +++ b/tools/mock-vllm/app.py @@ -1,3 +1,17 @@ +# Copyright 2025 The vLLM Semantic Router Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import math import time from typing import List, Optional