diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1eb470ee54..ad767c823b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -210,7 +210,7 @@ repos: name: Check SPDX headers entry: python tools/pre_commit/check_spdx_header.py language: python - types: [python] + types_or: [python, rust, proto] - id: check-root-lazy-imports name: Check root lazy imports entry: python tools/pre_commit/check_init_lazy_imports.py diff --git a/rust/proto/vllm_grpc.proto b/rust/proto/vllm_grpc.proto index 5f6539986d..2509d5071b 100644 --- a/rust/proto/vllm_grpc.proto +++ b/rust/proto/vllm_grpc.proto @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + syntax = "proto3"; package vllm; diff --git a/rust/src/chat/examples/external_engine_chat_qwen.rs b/rust/src/chat/examples/external_engine_chat_qwen.rs index 457dd453d6..4f62982036 100644 --- a/rust/src/chat/examples/external_engine_chat_qwen.rs +++ b/rust/src/chat/examples/external_engine_chat_qwen.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use anyhow::{Context, Result, bail}; diff --git a/rust/src/chat/src/backend/hf.rs b/rust/src/chat/src/backend/hf.rs index 47c0bfb78c..5f3a656ae0 100644 --- a/rust/src/chat/src/backend/hf.rs +++ b/rust/src/chat/src/backend/hf.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use tracing::info; diff --git a/rust/src/chat/src/backend/mod.rs b/rust/src/chat/src/backend/mod.rs index be609ba5d9..68f2f6a568 100644 --- a/rust/src/chat/src/backend/mod.rs +++ b/rust/src/chat/src/backend/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::sync::Arc; diff --git a/rust/src/chat/src/error.rs b/rust/src/chat/src/error.rs index 8e5d4ef84f..e09c3734d9 100644 --- a/rust/src/chat/src/error.rs +++ b/rust/src/chat/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error; use thiserror_ext::{AsReport as _, Macro}; diff --git a/rust/src/chat/src/event.rs b/rust/src/chat/src/event.rs index 9edfac534a..589fde7540 100644 --- a/rust/src/chat/src/event.rs +++ b/rust/src/chat/src/event.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::ops::Deref; use std::sync::Arc; diff --git a/rust/src/chat/src/lib.rs b/rust/src/chat/src/lib.rs index 8e7ed02a40..625a2d7818 100644 --- a/rust/src/chat/src/lib.rs +++ b/rust/src/chat/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Minimal chat facade above [`vllm_text`]. //! //! This crate keeps the northbound boundary intentionally small: diff --git a/rust/src/chat/src/multimodal.rs b/rust/src/chat/src/multimodal.rs index 422696ae71..662e6fd064 100644 --- a/rust/src/chat/src/multimodal.rs +++ b/rust/src/chat/src/multimodal.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Chat-layer multimodal media preparation. //! //! This module owns the multimodal path for chat requests: it extracts media diff --git a/rust/src/chat/src/multimodal/expand.rs b/rust/src/chat/src/multimodal/expand.rs index 36a2a9bdb7..b679f13b07 100644 --- a/rust/src/chat/src/multimodal/expand.rs +++ b/rust/src/chat/src/multimodal/expand.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Prompt placeholder expansion shared across modalities. use std::collections::{HashMap, VecDeque}; diff --git a/rust/src/chat/src/multimodal/image.rs b/rust/src/chat/src/multimodal/image.rs index f71f1ee352..65f86041f7 100644 --- a/rust/src/chat/src/multimodal/image.rs +++ b/rust/src/chat/src/multimodal/image.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Image-modality preparation: batch preprocessing and per-item feature //! build. diff --git a/rust/src/chat/src/multimodal/tensor.rs b/rust/src/chat/src/multimodal/tensor.rs index e26022aea0..f701e0646c 100644 --- a/rust/src/chat/src/multimodal/tensor.rs +++ b/rust/src/chat/src/multimodal/tensor.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use half::{bf16, f16}; diff --git a/rust/src/chat/src/multimodal/video.rs b/rust/src/chat/src/multimodal/video.rs index 482074abde..af29799e78 100644 --- a/rust/src/chat/src/multimodal/video.rs +++ b/rust/src/chat/src/multimodal/video.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Video-modality preparation: per-clip preprocessing, config resolution, //! and per-item feature build. diff --git a/rust/src/chat/src/output/default/mod.rs b/rust/src/chat/src/output/default/mod.rs index b42d24dcaa..ab288336f4 100644 --- a/rust/src/chat/src/output/default/mod.rs +++ b/rust/src/chat/src/output/default/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Default output processing pipeline. mod structural_tag; diff --git a/rust/src/chat/src/output/default/structural_tag.rs b/rust/src/chat/src/output/default/structural_tag.rs index 45a508ffee..79aa1a1f1b 100644 --- a/rust/src/chat/src/output/default/structural_tag.rs +++ b/rust/src/chat/src/output/default/structural_tag.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Applies xgrammar structural-tag constraints for strict tool calling. use thiserror_ext::AsReport; diff --git a/rust/src/chat/src/output/default/unified.rs b/rust/src/chat/src/output/default/unified.rs index 3290be19e6..038b907a26 100644 --- a/rust/src/chat/src/output/default/unified.rs +++ b/rust/src/chat/src/output/default/unified.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Adapts decoded text updates into parsed assistant deltas. //! //! This stage sits between low-level token decoding and final block assembly. diff --git a/rust/src/chat/src/output/harmony/mod.rs b/rust/src/chat/src/output/harmony/mod.rs index 7f4f7e30d6..a84687882b 100644 --- a/rust/src/chat/src/output/harmony/mod.rs +++ b/rust/src/chat/src/output/harmony/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Native Harmony output processing for `gpt_oss`. //! //! Unlike the default text-first pipeline, this processor consumes diff --git a/rust/src/chat/src/output/harmony/tests.rs b/rust/src/chat/src/output/harmony/tests.rs index 1de4aaf7b2..9b9544bdc6 100644 --- a/rust/src/chat/src/output/harmony/tests.rs +++ b/rust/src/chat/src/output/harmony/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use futures::executor::block_on; diff --git a/rust/src/chat/src/output/mod.rs b/rust/src/chat/src/output/mod.rs index 3b839f971f..ecf90015ca 100644 --- a/rust/src/chat/src/output/mod.rs +++ b/rust/src/chat/src/output/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::pin::Pin; use std::sync::Arc; diff --git a/rust/src/chat/src/output/structured.rs b/rust/src/chat/src/output/structured.rs index 908261e494..387d8f9bd5 100644 --- a/rust/src/chat/src/output/structured.rs +++ b/rust/src/chat/src/output/structured.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Adapts parsed assistant updates into structured chat events. //! //! This module remains the final assembly stage in `vllm-chat`. Token-to-text diff --git a/rust/src/chat/src/parser/mod.rs b/rust/src/chat/src/parser/mod.rs index f56770d89d..7684aa9d97 100644 --- a/rust/src/chat/src/parser/mod.rs +++ b/rust/src/chat/src/parser/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod reasoning; pub mod tool; pub mod unified; diff --git a/rust/src/chat/src/parser/reasoning/mod.rs b/rust/src/chat/src/parser/reasoning/mod.rs index 99e749d8f8..10d48b2b39 100644 --- a/rust/src/chat/src/parser/reasoning/mod.rs +++ b/rust/src/chat/src/parser/reasoning/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Reasoning parser registration and selection boundary for `vllm-chat`. use std::sync::{Arc, LazyLock}; diff --git a/rust/src/chat/src/parser/reasoning/tests.rs b/rust/src/chat/src/parser/reasoning/tests.rs index b6ae5ba9c3..7b7f1fe94a 100644 --- a/rust/src/chat/src/parser/reasoning/tests.rs +++ b/rust/src/chat/src/parser/reasoning/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use vllm_tokenizer::test_utils::TestTokenizer; diff --git a/rust/src/chat/src/parser/tool/mod.rs b/rust/src/chat/src/parser/tool/mod.rs index a156d67024..3e394c417b 100644 --- a/rust/src/chat/src/parser/tool/mod.rs +++ b/rust/src/chat/src/parser/tool/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Tool parser registration and selection boundary for `vllm-chat`. use std::sync::{Arc, LazyLock}; diff --git a/rust/src/chat/src/parser/tool/tests.rs b/rust/src/chat/src/parser/tool/tests.rs index a630f9a951..bb89ea38fe 100644 --- a/rust/src/chat/src/parser/tool/tests.rs +++ b/rust/src/chat/src/parser/tool/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_parser::tool::{Result, ToolParserOutput}; use super::{ToolParser, ToolParserFactory, names}; diff --git a/rust/src/chat/src/parser/unified.rs b/rust/src/chat/src/parser/unified.rs index 50f2104d61..ff97bb38db 100644 --- a/rust/src/chat/src/parser/unified.rs +++ b/rust/src/chat/src/parser/unified.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Unified parser registration and selection boundary for `vllm-chat`. use std::sync::LazyLock; diff --git a/rust/src/chat/src/renderer/deepseek_v32/encoding.rs b/rust/src/chat/src/renderer/deepseek_v32/encoding.rs index 2af7e4be7b..86925c87c4 100644 --- a/rust/src/chat/src/renderer/deepseek_v32/encoding.rs +++ b/rust/src/chat/src/renderer/deepseek_v32/encoding.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! DeepSeek V3.2 prompt renderer. use std::collections::{HashMap, HashSet}; diff --git a/rust/src/chat/src/renderer/deepseek_v32/mod.rs b/rust/src/chat/src/renderer/deepseek_v32/mod.rs index 9da2423389..1a41e14f8f 100644 --- a/rust/src/chat/src/renderer/deepseek_v32/mod.rs +++ b/rust/src/chat/src/renderer/deepseek_v32/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod encoding; use vllm_text::Prompt; diff --git a/rust/src/chat/src/renderer/deepseek_v32/tests.rs b/rust/src/chat/src/renderer/deepseek_v32/tests.rs index 38eddef92a..76796edd09 100644 --- a/rust/src/chat/src/renderer/deepseek_v32/tests.rs +++ b/rust/src/chat/src/renderer/deepseek_v32/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::PathBuf; use expect_test::{ExpectFile, expect, expect_file}; diff --git a/rust/src/chat/src/renderer/deepseek_v4/encoding.rs b/rust/src/chat/src/renderer/deepseek_v4/encoding.rs index 54a6924861..80438b0c41 100644 --- a/rust/src/chat/src/renderer/deepseek_v4/encoding.rs +++ b/rust/src/chat/src/renderer/deepseek_v4/encoding.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! DeepSeek V4 prompt renderer. //! //! Original Python implementation: diff --git a/rust/src/chat/src/renderer/deepseek_v4/mod.rs b/rust/src/chat/src/renderer/deepseek_v4/mod.rs index 78047c9dbe..2762f1546f 100644 --- a/rust/src/chat/src/renderer/deepseek_v4/mod.rs +++ b/rust/src/chat/src/renderer/deepseek_v4/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod encoding; use vllm_text::Prompt; diff --git a/rust/src/chat/src/renderer/deepseek_v4/tests.rs b/rust/src/chat/src/renderer/deepseek_v4/tests.rs index 058802b8e3..73380cef26 100644 --- a/rust/src/chat/src/renderer/deepseek_v4/tests.rs +++ b/rust/src/chat/src/renderer/deepseek_v4/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::PathBuf; use expect_test::{ExpectFile, expect, expect_file}; diff --git a/rust/src/chat/src/renderer/harmony/encoding.rs b/rust/src/chat/src/renderer/harmony/encoding.rs index 3b8030292d..74dfb7cd04 100644 --- a/rust/src/chat/src/renderer/harmony/encoding.rs +++ b/rust/src/chat/src/renderer/harmony/encoding.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Shared Harmony encoding helper for the GPT-OSS renderer and output parser. use std::sync::LazyLock; diff --git a/rust/src/chat/src/renderer/harmony/mod.rs b/rust/src/chat/src/renderer/harmony/mod.rs index 70a1bb063e..49375abe8a 100644 --- a/rust/src/chat/src/renderer/harmony/mod.rs +++ b/rust/src/chat/src/renderer/harmony/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Native Harmony chat renderer for `gpt_oss`. pub(crate) mod encoding; diff --git a/rust/src/chat/src/renderer/harmony/tests.rs b/rust/src/chat/src/renderer/harmony/tests.rs index bcbf97c866..301d9707e7 100644 --- a/rust/src/chat/src/renderer/harmony/tests.rs +++ b/rust/src/chat/src/renderer/harmony/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::PathBuf; use expect_test::{ExpectFile, expect, expect_file}; diff --git a/rust/src/chat/src/renderer/hf/error.rs b/rust/src/chat/src/renderer/hf/error.rs index fcc48c75ab..b173f98239 100644 --- a/rust/src/chat/src/renderer/hf/error.rs +++ b/rust/src/chat/src/renderer/hf/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error as ThisError; #[derive(Debug, ThisError)] diff --git a/rust/src/chat/src/renderer/hf/format.rs b/rust/src/chat/src/renderer/hf/format.rs index afb142c9bf..f419b9e3a0 100644 --- a/rust/src/chat/src/renderer/hf/format.rs +++ b/rust/src/chat/src/renderer/hf/format.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{HashSet, VecDeque}; use std::fmt; use std::str::FromStr; diff --git a/rust/src/chat/src/renderer/hf/mod.rs b/rust/src/chat/src/renderer/hf/mod.rs index 1c87e75337..58ee1ccb7a 100644 --- a/rust/src/chat/src/renderer/hf/mod.rs +++ b/rust/src/chat/src/renderer/hf/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use serde::Serialize; diff --git a/rust/src/chat/src/renderer/hf/template.rs b/rust/src/chat/src/renderer/hf/template.rs index c04df0165d..5a609621cc 100644 --- a/rust/src/chat/src/renderer/hf/template.rs +++ b/rust/src/chat/src/renderer/hf/template.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Chat template support for tokenizers using Jinja2 templates. //! //! This module is inlined from SMG's tokenizer crate with local adaptations: diff --git a/rust/src/chat/src/renderer/hf/tojson.rs b/rust/src/chat/src/renderer/hf/tojson.rs index cd53108c57..e2e2757cf8 100644 --- a/rust/src/chat/src/renderer/hf/tojson.rs +++ b/rust/src/chat/src/renderer/hf/tojson.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use minijinja::value::{Kwargs, ViaDeserialize}; use minijinja::{Error as MinijinjaError, ErrorKind, Value}; use serde::Deserialize; diff --git a/rust/src/chat/src/renderer/hf/value.rs b/rust/src/chat/src/renderer/hf/value.rs index 65064705e0..574e4a4592 100644 --- a/rust/src/chat/src/renderer/hf/value.rs +++ b/rust/src/chat/src/renderer/hf/value.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use indexmap::IndexMap; diff --git a/rust/src/chat/src/renderer/mod.rs b/rust/src/chat/src/renderer/mod.rs index f1c510a1b3..639d6df30e 100644 --- a/rust/src/chat/src/renderer/mod.rs +++ b/rust/src/chat/src/renderer/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::sync::Arc; diff --git a/rust/src/chat/src/renderer/selection.rs b/rust/src/chat/src/renderer/selection.rs index 837ec7d69c..508bf8d17c 100644 --- a/rust/src/chat/src/renderer/selection.rs +++ b/rust/src/chat/src/renderer/selection.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::fmt; use std::str::FromStr; diff --git a/rust/src/chat/src/renderer/test_utils.rs b/rust/src/chat/src/renderer/test_utils.rs index bf560de842..a12531150c 100644 --- a/rust/src/chat/src/renderer/test_utils.rs +++ b/rust/src/chat/src/renderer/test_utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::fs; use std::path::Path; diff --git a/rust/src/chat/src/request.rs b/rust/src/chat/src/request.rs index cbb543c1ff..966bbde1bb 100644 --- a/rust/src/chat/src/request.rs +++ b/rust/src/chat/src/request.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use llm_multimodal::ImageDetail; diff --git a/rust/src/chat/src/stream.rs b/rust/src/chat/src/stream.rs index 8b0a8eed5d..c24dcaa84b 100644 --- a/rust/src/chat/src/stream.rs +++ b/rust/src/chat/src/stream.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::pin::Pin; use std::sync::Arc; use std::task::{Context, Poll}; diff --git a/rust/src/chat/tests/chat.rs b/rust/src/chat/tests/chat.rs index c0325d184b..e14f91a7b1 100644 --- a/rust/src/chat/tests/chat.rs +++ b/rust/src/chat/tests/chat.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; use std::fmt; use std::sync::Arc; diff --git a/rust/src/chat/tests/roundtrip.rs b/rust/src/chat/tests/roundtrip.rs index 597fbe12ad..58a3adfc4e 100644 --- a/rust/src/chat/tests/roundtrip.rs +++ b/rust/src/chat/tests/roundtrip.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Roundtrip tests for the real chat-template and output-processor pairing. //! //! The invariant under test is that a structured assistant message rendered as history can be diff --git a/rust/src/cmd/src/cli.rs b/rust/src/cmd/src/cli.rs index 3384fb9c67..314765bab2 100644 --- a/rust/src/cmd/src/cli.rs +++ b/rust/src/cmd/src/cli.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! CLI argument definitions for the `vllm-rs` binary. //! //! Python vLLM references: diff --git a/rust/src/cmd/src/cli/tests.rs b/rust/src/cmd/src/cli/tests.rs index 8056ee9392..f3af2a18fd 100644 --- a/rust/src/cmd/src/cli/tests.rs +++ b/rust/src/cmd/src/cli/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use expect_test::expect; use vllm_engine_core_client::TransportMode; use vllm_server::{Config, HttpListenerMode, ParserSelection, RendererSelection}; diff --git a/rust/src/cmd/src/cli/unsupported.rs b/rust/src/cmd/src/cli/unsupported.rs index 548001412c..66e8b2e9ab 100644 --- a/rust/src/cmd/src/cli/unsupported.rs +++ b/rust/src/cmd/src/cli/unsupported.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + #![allow(clippy::doc_lazy_continuation)] use std::fmt::Display; diff --git a/rust/src/cmd/src/logging.rs b/rust/src/cmd/src/logging.rs index aab080c939..4d31b92ee2 100644 --- a/rust/src/cmd/src/logging.rs +++ b/rust/src/cmd/src/logging.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::{env, fmt, process}; use time::UtcOffset; diff --git a/rust/src/cmd/src/main.rs b/rust/src/cmd/src/main.rs index c015319ed1..9637a3be57 100644 --- a/rust/src/cmd/src/main.rs +++ b/rust/src/cmd/src/main.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod cli; mod logging; diff --git a/rust/src/engine-core-client/examples/external_engine_logprobs.rs b/rust/src/engine-core-client/examples/external_engine_logprobs.rs index a067ad6600..891598c9f7 100644 --- a/rust/src/engine-core-client/examples/external_engine_logprobs.rs +++ b/rust/src/engine-core-client/examples/external_engine_logprobs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use anyhow::{Context, Result, bail}; diff --git a/rust/src/engine-core-client/examples/external_engine_utility_call.rs b/rust/src/engine-core-client/examples/external_engine_utility_call.rs index 2fff91bc20..b1826bb76e 100644 --- a/rust/src/engine-core-client/examples/external_engine_utility_call.rs +++ b/rust/src/engine-core-client/examples/external_engine_utility_call.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use anyhow::{Context, Result, bail}; diff --git a/rust/src/engine-core-client/src/client.rs b/rust/src/engine-core-client/src/client.rs index eb899e3e78..5b9cd500d3 100644 --- a/rust/src/engine-core-client/src/client.rs +++ b/rust/src/engine-core-client/src/client.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use std::time::Duration; diff --git a/rust/src/engine-core-client/src/client/imp.rs b/rust/src/engine-core-client/src/client/imp.rs index c91a93d271..a699f85c26 100644 --- a/rust/src/engine-core-client/src/client/imp.rs +++ b/rust/src/engine-core-client/src/client/imp.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet}; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/rust/src/engine-core-client/src/client/state.rs b/rust/src/engine-core-client/src/client/state.rs index 881035d2f9..fad117ac31 100644 --- a/rust/src/engine-core-client/src/client/state.rs +++ b/rust/src/engine-core-client/src/client/state.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::sync::atomic::{AtomicU64, Ordering}; diff --git a/rust/src/engine-core-client/src/client/stream.rs b/rust/src/engine-core-client/src/client/stream.rs index b0ea180795..ba408f2c87 100644 --- a/rust/src/engine-core-client/src/client/stream.rs +++ b/rust/src/engine-core-client/src/client/stream.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::ops::Deref; use std::pin::Pin; use std::task::{Context, Poll}; diff --git a/rust/src/engine-core-client/src/coordinator/bootstrap.rs b/rust/src/engine-core-client/src/coordinator/bootstrap.rs index 8c6855bfe7..68229085d2 100644 --- a/rust/src/engine-core-client/src/coordinator/bootstrap.rs +++ b/rust/src/engine-core-client/src/coordinator/bootstrap.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use bytes::Bytes; diff --git a/rust/src/engine-core-client/src/coordinator/external.rs b/rust/src/engine-core-client/src/coordinator/external.rs index eb447c4809..606224ea9e 100644 --- a/rust/src/engine-core-client/src/coordinator/external.rs +++ b/rust/src/engine-core-client/src/coordinator/external.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use serde_tuple::{Deserialize_tuple, Serialize_tuple}; diff --git a/rust/src/engine-core-client/src/coordinator/handle.rs b/rust/src/engine-core-client/src/coordinator/handle.rs index f063b624d3..b68c76ddec 100644 --- a/rust/src/engine-core-client/src/coordinator/handle.rs +++ b/rust/src/engine-core-client/src/coordinator/handle.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use parking_lot::Mutex; diff --git a/rust/src/engine-core-client/src/coordinator/inproc.rs b/rust/src/engine-core-client/src/coordinator/inproc.rs index aaa6d8171b..bf4c23cc13 100644 --- a/rust/src/engine-core-client/src/coordinator/inproc.rs +++ b/rust/src/engine-core-client/src/coordinator/inproc.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use serde_tuple::{Deserialize_tuple, Serialize_tuple}; diff --git a/rust/src/engine-core-client/src/coordinator/mod.rs b/rust/src/engine-core-client/src/coordinator/mod.rs index e4740a3739..bfbcbb814c 100644 --- a/rust/src/engine-core-client/src/coordinator/mod.rs +++ b/rust/src/engine-core-client/src/coordinator/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod bootstrap; mod external; mod handle; diff --git a/rust/src/engine-core-client/src/error.rs b/rust/src/engine-core-client/src/error.rs index f4fc5c4823..94809a6786 100644 --- a/rust/src/engine-core-client/src/error.rs +++ b/rust/src/engine-core-client/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use std::time::Duration; diff --git a/rust/src/engine-core-client/src/lib.rs b/rust/src/engine-core-client/src/lib.rs index f4ae0e19ee..7b60206194 100644 --- a/rust/src/engine-core-client/src/lib.rs +++ b/rust/src/engine-core-client/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod client; mod coordinator; mod error; diff --git a/rust/src/engine-core-client/src/metrics.rs b/rust/src/engine-core-client/src/metrics.rs index 05744db42d..8b2eb9e588 100644 --- a/rust/src/engine-core-client/src/metrics.rs +++ b/rust/src/engine-core-client/src/metrics.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use std::collections::BTreeSet; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/rust/src/engine-core-client/src/mock_engine.rs b/rust/src/engine-core-client/src/mock_engine.rs index 781b004c7b..628104e9c3 100644 --- a/rust/src/engine-core-client/src/mock_engine.rs +++ b/rust/src/engine-core-client/src/mock_engine.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::Path; use std::time::Duration; diff --git a/rust/src/engine-core-client/src/protocol/dtype.rs b/rust/src/engine-core-client/src/protocol/dtype.rs index 081d1ce921..8d321df9d3 100644 --- a/rust/src/engine-core-client/src/protocol/dtype.rs +++ b/rust/src/engine-core-client/src/protocol/dtype.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde::{Deserialize, Serialize}; /// Effective model dtype reported by the engine after config resolution. diff --git a/rust/src/engine-core-client/src/protocol/handshake.rs b/rust/src/engine-core-client/src/protocol/handshake.rs index 7a29520961..c8545017a9 100644 --- a/rust/src/engine-core-client/src/protocol/handshake.rs +++ b/rust/src/engine-core-client/src/protocol/handshake.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; diff --git a/rust/src/engine-core-client/src/protocol/logprobs.rs b/rust/src/engine-core-client/src/protocol/logprobs.rs index 24e6ae2fee..a01186d0dc 100644 --- a/rust/src/engine-core-client/src/protocol/logprobs.rs +++ b/rust/src/engine-core-client/src/protocol/logprobs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod array; #[cfg(test)] mod tests; diff --git a/rust/src/engine-core-client/src/protocol/logprobs/array.rs b/rust/src/engine-core-client/src/protocol/logprobs/array.rs index 132428ffcd..9829c828a8 100644 --- a/rust/src/engine-core-client/src/protocol/logprobs/array.rs +++ b/rust/src/engine-core-client/src/protocol/logprobs/array.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::io::Cursor; use byteorder::{BigEndian, LittleEndian, NativeEndian, ReadBytesExt}; diff --git a/rust/src/engine-core-client/src/protocol/logprobs/tests.rs b/rust/src/engine-core-client/src/protocol/logprobs/tests.rs index 17310c7a30..b105ea8d4a 100644 --- a/rust/src/engine-core-client/src/protocol/logprobs/tests.rs +++ b/rust/src/engine-core-client/src/protocol/logprobs/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; use bytes::Bytes; diff --git a/rust/src/engine-core-client/src/protocol/logprobs/wire.rs b/rust/src/engine-core-client/src/protocol/logprobs/wire.rs index 5c4a5a8e76..2f37d7ee46 100644 --- a/rust/src/engine-core-client/src/protocol/logprobs/wire.rs +++ b/rust/src/engine-core-client/src/protocol/logprobs/wire.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde_tuple::{Deserialize_tuple, Serialize_tuple}; use crate::protocol::tensor::WireNdArray; diff --git a/rust/src/engine-core-client/src/protocol/lora.rs b/rust/src/engine-core-client/src/protocol/lora.rs index 27b74cf991..0f66d36cbe 100644 --- a/rust/src/engine-core-client/src/protocol/lora.rs +++ b/rust/src/engine-core-client/src/protocol/lora.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde_tuple::{Deserialize_tuple, Serialize_tuple}; use crate::protocol::OpaqueValue; diff --git a/rust/src/engine-core-client/src/protocol/mod.rs b/rust/src/engine-core-client/src/protocol/mod.rs index d434a4e3e9..23bd09d8d8 100644 --- a/rust/src/engine-core-client/src/protocol/mod.rs +++ b/rust/src/engine-core-client/src/protocol/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::any::type_name; use std::io::Cursor; diff --git a/rust/src/engine-core-client/src/protocol/multimodal.rs b/rust/src/engine-core-client/src/protocol/multimodal.rs index 78d84740e2..260812d00e 100644 --- a/rust/src/engine-core-client/src/protocol/multimodal.rs +++ b/rust/src/engine-core-client/src/protocol/multimodal.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; diff --git a/rust/src/engine-core-client/src/protocol/output.rs b/rust/src/engine-core-client/src/protocol/output.rs index 930fd25694..78b9ff2daf 100644 --- a/rust/src/engine-core-client/src/protocol/output.rs +++ b/rust/src/engine-core-client/src/protocol/output.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; use enum_as_inner::EnumAsInner; diff --git a/rust/src/engine-core-client/src/protocol/request.rs b/rust/src/engine-core-client/src/protocol/request.rs index b7993a3f7c..ee1a6ac0b2 100644 --- a/rust/src/engine-core-client/src/protocol/request.rs +++ b/rust/src/engine-core-client/src/protocol/request.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, HashMap}; use bytes::Bytes; diff --git a/rust/src/engine-core-client/src/protocol/sampling.rs b/rust/src/engine-core-client/src/protocol/sampling.rs index 5b52ded065..d5c6a85208 100644 --- a/rust/src/engine-core-client/src/protocol/sampling.rs +++ b/rust/src/engine-core-client/src/protocol/sampling.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeSet, HashMap}; use serde::{Deserialize, Serialize}; diff --git a/rust/src/engine-core-client/src/protocol/stats.rs b/rust/src/engine-core-client/src/protocol/stats.rs index 1fc9606bcd..d1f2dd3d35 100644 --- a/rust/src/engine-core-client/src/protocol/stats.rs +++ b/rust/src/engine-core-client/src/protocol/stats.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; diff --git a/rust/src/engine-core-client/src/protocol/structured_outputs.rs b/rust/src/engine-core-client/src/protocol/structured_outputs.rs index ed82d3e558..745ca3150b 100644 --- a/rust/src/engine-core-client/src/protocol/structured_outputs.rs +++ b/rust/src/engine-core-client/src/protocol/structured_outputs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use enum_as_inner::EnumAsInner; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; diff --git a/rust/src/engine-core-client/src/protocol/tensor.rs b/rust/src/engine-core-client/src/protocol/tensor.rs index b80472129b..5eb1668e75 100644 --- a/rust/src/engine-core-client/src/protocol/tensor.rs +++ b/rust/src/engine-core-client/src/protocol/tensor.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use bytemuck::allocation::pod_collect_to_vec; use enum_as_inner::EnumAsInner; use half::{bf16, f16}; diff --git a/rust/src/engine-core-client/src/protocol/utility.rs b/rust/src/engine-core-client/src/protocol/utility.rs index e15ea6bea0..d59720fb1c 100644 --- a/rust/src/engine-core-client/src/protocol/utility.rs +++ b/rust/src/engine-core-client/src/protocol/utility.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::any::type_name; use std::fmt; use std::str::FromStr; diff --git a/rust/src/engine-core-client/src/runtime.rs b/rust/src/engine-core-client/src/runtime.rs index 2015bff752..d081c44878 100644 --- a/rust/src/engine-core-client/src/runtime.rs +++ b/rust/src/engine-core-client/src/runtime.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::mem::ManuallyDrop; use std::ops::{Deref, DerefMut}; use std::sync::OnceLock; diff --git a/rust/src/engine-core-client/src/test_utils.rs b/rust/src/engine-core-client/src/test_utils.rs index 0d777c9121..13d473f597 100644 --- a/rust/src/engine-core-client/src/test_utils.rs +++ b/rust/src/engine-core-client/src/test_utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::future::Future; use std::path::Path; use std::pin::Pin; diff --git a/rust/src/engine-core-client/src/tests/client.rs b/rust/src/engine-core-client/src/tests/client.rs index 5f2a724873..64b80185c3 100644 --- a/rust/src/engine-core-client/src/tests/client.rs +++ b/rust/src/engine-core-client/src/tests/client.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet}; use std::convert::TryFrom; use std::io::Cursor; diff --git a/rust/src/engine-core-client/src/tests/mod.rs b/rust/src/engine-core-client/src/tests/mod.rs index b79c47fca3..afd78b35ab 100644 --- a/rust/src/engine-core-client/src/tests/mod.rs +++ b/rust/src/engine-core-client/src/tests/mod.rs @@ -1 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod client; diff --git a/rust/src/engine-core-client/src/transport.rs b/rust/src/engine-core-client/src/transport.rs index aecf962500..d2eb57aa14 100644 --- a/rust/src/engine-core-client/src/transport.rs +++ b/rust/src/engine-core-client/src/transport.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet}; use std::fmt::Debug; use std::ops::Deref; diff --git a/rust/src/llm/examples/external_engine_smoke.rs b/rust/src/llm/examples/external_engine_smoke.rs index e5e153f334..ae4f428822 100644 --- a/rust/src/llm/examples/external_engine_smoke.rs +++ b/rust/src/llm/examples/external_engine_smoke.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use anyhow::{Context, Result, bail}; diff --git a/rust/src/llm/src/error.rs b/rust/src/llm/src/error.rs index 5865e1fcc3..48bd8d18fd 100644 --- a/rust/src/llm/src/error.rs +++ b/rust/src/llm/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error; pub type Result = std::result::Result; diff --git a/rust/src/llm/src/inflight.rs b/rust/src/llm/src/inflight.rs index cd4455df31..518290b38e 100644 --- a/rust/src/llm/src/inflight.rs +++ b/rust/src/llm/src/inflight.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Tracking of the external→internal request-id mapping for in-flight requests. //! //! When request-id randomization is enabled (the default), [`crate::Llm`] diff --git a/rust/src/llm/src/lib.rs b/rust/src/llm/src/lib.rs index 52f5758931..5aa2479193 100644 --- a/rust/src/llm/src/lib.rs +++ b/rust/src/llm/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use tracing::Span; use vllm_engine_core_client::EngineCoreClient; diff --git a/rust/src/llm/src/log_stats.rs b/rust/src/llm/src/log_stats.rs index 81c9093a10..525d1b2639 100644 --- a/rust/src/llm/src/log_stats.rs +++ b/rust/src/llm/src/log_stats.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::fmt::Write; use std::time::{Duration, Instant}; diff --git a/rust/src/llm/src/output.rs b/rust/src/llm/src/output.rs index 4e9d885b1a..c8f01b9fb9 100644 --- a/rust/src/llm/src/output.rs +++ b/rust/src/llm/src/output.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::future::Future; use std::pin::Pin; use std::sync::Arc; diff --git a/rust/src/llm/src/request.rs b/rust/src/llm/src/request.rs index 45e5bd1ca6..c4d78396ba 100644 --- a/rust/src/llm/src/request.rs +++ b/rust/src/llm/src/request.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use uuid::Uuid; diff --git a/rust/src/llm/src/request_metrics.rs b/rust/src/llm/src/request_metrics.rs index 4f1673db15..2cc9c187a8 100644 --- a/rust/src/llm/src/request_metrics.rs +++ b/rust/src/llm/src/request_metrics.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::{SystemTime, UNIX_EPOCH}; use vllm_engine_core_client::protocol::output::{ diff --git a/rust/src/llm/tests/generate.rs b/rust/src/llm/tests/generate.rs index 498a4f0a4a..d6bc9d1cfa 100644 --- a/rust/src/llm/tests/generate.rs +++ b/rust/src/llm/tests/generate.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; use std::sync::Once; use std::time::Duration; diff --git a/rust/src/managed-engine/src/cli.rs b/rust/src/managed-engine/src/cli.rs index 9cf5e311ec..95d61f652c 100644 --- a/rust/src/managed-engine/src/cli.rs +++ b/rust/src/managed-engine/src/cli.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashSet; use std::ffi::OsString; diff --git a/rust/src/managed-engine/src/lib.rs b/rust/src/managed-engine/src/lib.rs index e9812104cb..895a9f18c7 100644 --- a/rust/src/managed-engine/src/lib.rs +++ b/rust/src/managed-engine/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod cli; mod process; diff --git a/rust/src/managed-engine/src/process.rs b/rust/src/managed-engine/src/process.rs index 0a506244dc..cf247c3b86 100644 --- a/rust/src/managed-engine/src/process.rs +++ b/rust/src/managed-engine/src/process.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::io; use std::net::TcpListener; use std::process::{Command as StdCommand, ExitStatus, Stdio}; diff --git a/rust/src/metrics/src/api_server.rs b/rust/src/metrics/src/api_server.rs index 5ef6600a38..4decaa5573 100644 --- a/rust/src/metrics/src/api_server.rs +++ b/rust/src/metrics/src/api_server.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use prometheus_client::encoding::EncodeLabelSet; use prometheus_client::metrics::family::Family; use prometheus_client::metrics::histogram::Histogram; diff --git a/rust/src/metrics/src/lib.rs b/rust/src/metrics/src/lib.rs index ca650fbada..25ab4fc6ba 100644 --- a/rust/src/metrics/src/lib.rs +++ b/rust/src/metrics/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::fmt; use std::sync::LazyLock; use std::sync::atomic::AtomicU64; diff --git a/rust/src/metrics/src/request.rs b/rust/src/metrics/src/request.rs index 421ff30349..c1135781b2 100644 --- a/rust/src/metrics/src/request.rs +++ b/rust/src/metrics/src/request.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use prometheus_client::encoding::EncodeLabelSet; use prometheus_client::metrics::family::Family; use prometheus_client::metrics::histogram::Histogram; diff --git a/rust/src/metrics/src/scheduler.rs b/rust/src/metrics/src/scheduler.rs index c38cc291dc..af43961b9a 100644 --- a/rust/src/metrics/src/scheduler.rs +++ b/rust/src/metrics/src/scheduler.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet}; use std::sync::{Arc, Mutex}; diff --git a/rust/src/mock-engine/src/engine.rs b/rust/src/mock-engine/src/engine.rs index 73d60b5597..c216829159 100644 --- a/rust/src/mock-engine/src/engine.rs +++ b/rust/src/mock-engine/src/engine.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::hash::{Hash as _, Hasher as _}; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/rust/src/mock-engine/src/io.rs b/rust/src/mock-engine/src/io.rs index 77c0f14b57..d31be22437 100644 --- a/rust/src/mock-engine/src/io.rs +++ b/rust/src/mock-engine/src/io.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use anyhow::{Context as _, Result, anyhow, bail}; use futures::{Stream, StreamExt as _, stream}; use tokio::sync::mpsc; diff --git a/rust/src/mock-engine/src/lib.rs b/rust/src/mock-engine/src/lib.rs index 98cf54c7ea..d4e8581b2f 100644 --- a/rust/src/mock-engine/src/lib.rs +++ b/rust/src/mock-engine/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use anyhow::{Context, Result, bail}; use clap::Parser; use tokio::sync::mpsc; diff --git a/rust/src/mock-engine/src/main.rs b/rust/src/mock-engine/src/main.rs index d28574fa8b..60960db2eb 100644 --- a/rust/src/mock-engine/src/main.rs +++ b/rust/src/mock-engine/src/main.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use anyhow::{Context, Result}; use clap::Parser as _; use tokio_util::sync::CancellationToken; diff --git a/rust/src/mock-engine/src/tests.rs b/rust/src/mock-engine/src/tests.rs index 71a4e0a657..6765faeab7 100644 --- a/rust/src/mock-engine/src/tests.rs +++ b/rust/src/mock-engine/src/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::net::TcpListener; use std::time::Duration; diff --git a/rust/src/parser/benches/deepseek_v3.rs b/rust/src/parser/benches/deepseek_v3.rs index 4d1ea337a7..72f251bc2d 100644 --- a/rust/src/parser/benches/deepseek_v3.rs +++ b/rust/src/parser/benches/deepseek_v3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/deepseek_v31.rs b/rust/src/parser/benches/deepseek_v31.rs index a6f17c9f01..b7d0a75eb9 100644 --- a/rust/src/parser/benches/deepseek_v31.rs +++ b/rust/src/parser/benches/deepseek_v31.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/deepseek_v32.rs b/rust/src/parser/benches/deepseek_v32.rs index 1e770d9b13..5c47c69713 100644 --- a/rust/src/parser/benches/deepseek_v32.rs +++ b/rust/src/parser/benches/deepseek_v32.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/gemma4.rs b/rust/src/parser/benches/gemma4.rs index fd29e77a9a..16aca3c6df 100644 --- a/rust/src/parser/benches/gemma4.rs +++ b/rust/src/parser/benches/gemma4.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/glm45_moe.rs b/rust/src/parser/benches/glm45_moe.rs index a55a9e83ac..d512b537d6 100644 --- a/rust/src/parser/benches/glm45_moe.rs +++ b/rust/src/parser/benches/glm45_moe.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/granite4.rs b/rust/src/parser/benches/granite4.rs index 17ef867160..099c7096dc 100644 --- a/rust/src/parser/benches/granite4.rs +++ b/rust/src/parser/benches/granite4.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/kimi_k2.rs b/rust/src/parser/benches/kimi_k2.rs index ab4c98399a..9bb8a73b1b 100644 --- a/rust/src/parser/benches/kimi_k2.rs +++ b/rust/src/parser/benches/kimi_k2.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/llama3_json.rs b/rust/src/parser/benches/llama3_json.rs index 1126daf6f7..dc3614549b 100644 --- a/rust/src/parser/benches/llama3_json.rs +++ b/rust/src/parser/benches/llama3_json.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/minimax_m2.rs b/rust/src/parser/benches/minimax_m2.rs index 734d7437fb..9e6a662aef 100644 --- a/rust/src/parser/benches/minimax_m2.rs +++ b/rust/src/parser/benches/minimax_m2.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/qwen3_coder.rs b/rust/src/parser/benches/qwen3_coder.rs index 9d70937728..3dedcce5bf 100644 --- a/rust/src/parser/benches/qwen3_coder.rs +++ b/rust/src/parser/benches/qwen3_coder.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/qwen3_xml.rs b/rust/src/parser/benches/qwen3_xml.rs index 59ea0de47d..5138007b54 100644 --- a/rust/src/parser/benches/qwen3_xml.rs +++ b/rust/src/parser/benches/qwen3_xml.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main}; diff --git a/rust/src/parser/benches/utils/adapter.rs b/rust/src/parser/benches/utils/adapter.rs index 20f8977441..ab017b5136 100644 --- a/rust/src/parser/benches/utils/adapter.rs +++ b/rust/src/parser/benches/utils/adapter.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use vllm_parser::tool::{ diff --git a/rust/src/parser/benches/utils/mod.rs b/rust/src/parser/benches/utils/mod.rs index bb67413171..e67f5fdb02 100644 --- a/rust/src/parser/benches/utils/mod.rs +++ b/rust/src/parser/benches/utils/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + // This module is shared by multiple benchmark targets. // There could be false positives for unused code or imports, and fixing them would lead to some other benchmarks failing to compile. #![allow(dead_code)] diff --git a/rust/src/parser/python/src/lib.rs b/rust/src/parser/python/src/lib.rs index 8057930ade..38b5f1d461 100644 --- a/rust/src/parser/python/src/lib.rs +++ b/rust/src/parser/python/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Thin PyO3 bindings for `vllm_parser::tool`. //! //! This crate exposes the Rust tool parser trait and data shapes to Python diff --git a/rust/src/parser/src/lib.rs b/rust/src/parser/src/lib.rs index 0b5c2b6d78..c9ddd53896 100644 --- a/rust/src/parser/src/lib.rs +++ b/rust/src/parser/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Streaming parsers for chat completions. pub mod reasoning; diff --git a/rust/src/parser/src/reasoning/cohere_cmd.rs b/rust/src/parser/src/reasoning/cohere_cmd.rs index 9acaf3c5f1..c269c99823 100644 --- a/rust/src/parser/src/reasoning/cohere_cmd.rs +++ b/rust/src/parser/src/reasoning/cohere_cmd.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/deepseek_r1.rs b/rust/src/parser/src/reasoning/deepseek_r1.rs index 069de478b7..90a071c39c 100644 --- a/rust/src/parser/src/reasoning/deepseek_r1.rs +++ b/rust/src/parser/src/reasoning/deepseek_r1.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/delimited.rs b/rust/src/parser/src/reasoning/delimited.rs index 256e95fdde..51cb4eaf91 100644 --- a/rust/src/parser/src/reasoning/delimited.rs +++ b/rust/src/parser/src/reasoning/delimited.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::{DynTokenizer, Tokenizer}; use super::{ReasoningDelta, ReasoningError, Result}; diff --git a/rust/src/parser/src/reasoning/kimi.rs b/rust/src/parser/src/reasoning/kimi.rs index 6c042d0d8f..324db3fb1c 100644 --- a/rust/src/parser/src/reasoning/kimi.rs +++ b/rust/src/parser/src/reasoning/kimi.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/minimax_m3.rs b/rust/src/parser/src/reasoning/minimax_m3.rs index 69d4e416df..34b6fb1aab 100644 --- a/rust/src/parser/src/reasoning/minimax_m3.rs +++ b/rust/src/parser/src/reasoning/minimax_m3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/mod.rs b/rust/src/parser/src/reasoning/mod.rs index fcb0f96792..e8dda6631a 100644 --- a/rust/src/parser/src/reasoning/mod.rs +++ b/rust/src/parser/src/reasoning/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Streaming reasoning parsers for chat completions. //! //! The key design choice here is that parser initialization prefers the diff --git a/rust/src/parser/src/reasoning/qwen3.rs b/rust/src/parser/src/reasoning/qwen3.rs index c50ab2d0fb..1289b47f55 100644 --- a/rust/src/parser/src/reasoning/qwen3.rs +++ b/rust/src/parser/src/reasoning/qwen3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/seed_oss.rs b/rust/src/parser/src/reasoning/seed_oss.rs index 61dde65377..2de7a614c0 100644 --- a/rust/src/parser/src/reasoning/seed_oss.rs +++ b/rust/src/parser/src/reasoning/seed_oss.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/step3p5.rs b/rust/src/parser/src/reasoning/step3p5.rs index 79677e682f..8a826a74f9 100644 --- a/rust/src/parser/src/reasoning/step3p5.rs +++ b/rust/src/parser/src/reasoning/step3p5.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_tokenizer::DynTokenizer; use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result}; diff --git a/rust/src/parser/src/reasoning/tests.rs b/rust/src/parser/src/reasoning/tests.rs index 5c148079e3..f7c8e8e3d6 100644 --- a/rust/src/parser/src/reasoning/tests.rs +++ b/rust/src/parser/src/reasoning/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use vllm_tokenizer::test_utils::TestTokenizer; diff --git a/rust/src/parser/src/tool/deepseek_dsml/deepseek_v32.rs b/rust/src/parser/src/tool/deepseek_dsml/deepseek_v32.rs index e4f5c58ee0..aebcde8a03 100644 --- a/rust/src/parser/src/tool/deepseek_dsml/deepseek_v32.rs +++ b/rust/src/parser/src/tool/deepseek_dsml/deepseek_v32.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{DeepSeekDsmlToolParser, DsmlTokens}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/deepseek_dsml/deepseek_v4.rs b/rust/src/parser/src/tool/deepseek_dsml/deepseek_v4.rs index a049393276..31470abcdf 100644 --- a/rust/src/parser/src/tool/deepseek_dsml/deepseek_v4.rs +++ b/rust/src/parser/src/tool/deepseek_dsml/deepseek_v4.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{DeepSeekDsmlToolParser, DsmlTokens}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/deepseek_dsml/mod.rs b/rust/src/parser/src/tool/deepseek_dsml/mod.rs index b49fb1de8b..dfb45d72ca 100644 --- a/rust/src/parser/src/tool/deepseek_dsml/mod.rs +++ b/rust/src/parser/src/tool/deepseek_dsml/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::{multispace0 as ws0, multispace1 as ws1}; use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated}; use winnow::prelude::*; diff --git a/rust/src/parser/src/tool/deepseek_json/deepseek_v3.rs b/rust/src/parser/src/tool/deepseek_json/deepseek_v3.rs index dc9859d001..3e3c16624d 100644 --- a/rust/src/parser/src/tool/deepseek_json/deepseek_v3.rs +++ b/rust/src/parser/src/tool/deepseek_json/deepseek_v3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{DeepSeekJsonFormat, DeepSeekJsonToolParser}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/deepseek_json/deepseek_v31.rs b/rust/src/parser/src/tool/deepseek_json/deepseek_v31.rs index 088e6d53db..1a1ec3634a 100644 --- a/rust/src/parser/src/tool/deepseek_json/deepseek_v31.rs +++ b/rust/src/parser/src/tool/deepseek_json/deepseek_v31.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{DeepSeekJsonFormat, DeepSeekJsonToolParser}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/deepseek_json/mod.rs b/rust/src/parser/src/tool/deepseek_json/mod.rs index c6fce9fec6..9a85ddf226 100644 --- a/rust/src/parser/src/tool/deepseek_json/mod.rs +++ b/rust/src/parser/src/tool/deepseek_json/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod deepseek_v3; mod deepseek_v31; diff --git a/rust/src/parser/src/tool/error.rs b/rust/src/parser/src/tool/error.rs index 4b2b4efcb4..2338fbe258 100644 --- a/rust/src/parser/src/tool/error.rs +++ b/rust/src/parser/src/tool/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error; use thiserror_ext::Macro; diff --git a/rust/src/parser/src/tool/glm_xml/glm45_moe.rs b/rust/src/parser/src/tool/glm_xml/glm45_moe.rs index a8d1ea0f19..06a26fae47 100644 --- a/rust/src/parser/src/tool/glm_xml/glm45_moe.rs +++ b/rust/src/parser/src/tool/glm_xml/glm45_moe.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{GlmXmlToolParser, Separator}; use crate::tool::{Result, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/glm_xml/glm47_moe.rs b/rust/src/parser/src/tool/glm_xml/glm47_moe.rs index ac1a9d6ac6..f13cd7983e 100644 --- a/rust/src/parser/src/tool/glm_xml/glm47_moe.rs +++ b/rust/src/parser/src/tool/glm_xml/glm47_moe.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{GlmXmlToolParser, Separator}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/glm_xml/mod.rs b/rust/src/parser/src/tool/glm_xml/mod.rs index cc175aeb64..dc942a3891 100644 --- a/rust/src/parser/src/tool/glm_xml/mod.rs +++ b/rust/src/parser/src/tool/glm_xml/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::multispace0 as ws0; use winnow::combinator::{alt, eof, repeat, seq, terminated}; use winnow::prelude::*; diff --git a/rust/src/parser/src/tool/hy_v3.rs b/rust/src/parser/src/tool/hy_v3.rs index 566df28d32..227f4aa287 100644 --- a/rust/src/parser/src/tool/hy_v3.rs +++ b/rust/src/parser/src/tool/hy_v3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::multispace0 as ws0; use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated}; use winnow::prelude::*; diff --git a/rust/src/parser/src/tool/json/granite4.rs b/rust/src/parser/src/tool/json/granite4.rs index 0f7bb69021..e50b457780 100644 --- a/rust/src/parser/src/tool/json/granite4.rs +++ b/rust/src/parser/src/tool/json/granite4.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::multispace0 as ws0; use winnow::combinator::{alt, peek, seq}; use winnow::error::{ContextError, ErrMode, ModalResult, StrContext}; diff --git a/rust/src/parser/src/tool/json/hermes.rs b/rust/src/parser/src/tool/json/hermes.rs index 817eaee91f..64c594ee0f 100644 --- a/rust/src/parser/src/tool/json/hermes.rs +++ b/rust/src/parser/src/tool/json/hermes.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/json/internlm2.rs b/rust/src/parser/src/tool/json/internlm2.rs index 25bc65911a..9600fbf01b 100644 --- a/rust/src/parser/src/tool/json/internlm2.rs +++ b/rust/src/parser/src/tool/json/internlm2.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace}; use crate::tool::{Result, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/json/llama.rs b/rust/src/parser/src/tool/json/llama.rs index 9f30bbe84a..e898d07d86 100644 --- a/rust/src/parser/src/tool/json/llama.rs +++ b/rust/src/parser/src/tool/json/llama.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::multispace0 as ws0; use winnow::combinator::seq; use winnow::error::{ModalResult, StrContext}; diff --git a/rust/src/parser/src/tool/json/mistral.rs b/rust/src/parser/src/tool/json/mistral.rs index ab99afc7ef..590a595dfd 100644 --- a/rust/src/parser/src/tool/json/mistral.rs +++ b/rust/src/parser/src/tool/json/mistral.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace}; use crate::tool::{Result, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/json/mod.rs b/rust/src/parser/src/tool/json/mod.rs index 6a701de435..ee85ddf356 100644 --- a/rust/src/parser/src/tool/json/mod.rs +++ b/rust/src/parser/src/tool/json/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Shared parser core for JSON tool calls wrapped by text markers. pub use granite4::Granite4ToolParser; diff --git a/rust/src/parser/src/tool/json/phi4mini.rs b/rust/src/parser/src/tool/json/phi4mini.rs index 3f259c2d7f..e2ef065905 100644 --- a/rust/src/parser/src/tool/json/phi4mini.rs +++ b/rust/src/parser/src/tool/json/phi4mini.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace}; use crate::tool::{Result, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/json/qwen.rs b/rust/src/parser/src/tool/json/qwen.rs index a69798f785..cf7c1fbe23 100644 --- a/rust/src/parser/src/tool/json/qwen.rs +++ b/rust/src/parser/src/tool/json/qwen.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace}; use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/kimi_k2.rs b/rust/src/parser/src/tool/kimi_k2.rs index e4730f96bc..aa4dc0e6ad 100644 --- a/rust/src/parser/src/tool/kimi_k2.rs +++ b/rust/src/parser/src/tool/kimi_k2.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use winnow::ascii::{digit1, multispace0 as ws0}; diff --git a/rust/src/parser/src/tool/minimax_m2.rs b/rust/src/parser/src/tool/minimax_m2.rs index c56b4bd1f6..903b14eb6a 100644 --- a/rust/src/parser/src/tool/minimax_m2.rs +++ b/rust/src/parser/src/tool/minimax_m2.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::{multispace0 as ws0, multispace1 as ws1}; use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated}; use winnow::prelude::*; diff --git a/rust/src/parser/src/tool/minimax_m3.rs b/rust/src/parser/src/tool/minimax_m3.rs index e2a0cada2c..366bf9302f 100644 --- a/rust/src/parser/src/tool/minimax_m3.rs +++ b/rust/src/parser/src/tool/minimax_m3.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::{multispace0 as ws0, multispace1 as ws1}; use winnow::combinator::{alt, delimited, seq}; use winnow::error::{ContextError, ErrMode}; diff --git a/rust/src/parser/src/tool/mod.rs b/rust/src/parser/src/tool/mod.rs index 5a06f2311e..d0e88e1936 100644 --- a/rust/src/parser/src/tool/mod.rs +++ b/rust/src/parser/src/tool/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Streaming tool parsers for chat completions. #[macro_use] diff --git a/rust/src/parser/src/tool/parameters.rs b/rust/src/parser/src/tool/parameters.rs index f9abb50f8b..913ad815e5 100644 --- a/rust/src/parser/src/tool/parameters.rs +++ b/rust/src/parser/src/tool/parameters.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use serde_json::{Map, Number, Value}; diff --git a/rust/src/parser/src/tool/qwen_coder.rs b/rust/src/parser/src/tool/qwen_coder.rs index c2e1b0c794..f864984192 100644 --- a/rust/src/parser/src/tool/qwen_coder.rs +++ b/rust/src/parser/src/tool/qwen_coder.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use winnow::ascii::multispace0 as ws0; use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated}; use winnow::prelude::*; diff --git a/rust/src/parser/src/tool/test_utils.rs b/rust/src/parser/src/tool/test_utils.rs index c160977479..ef3143183f 100644 --- a/rust/src/parser/src/tool/test_utils.rs +++ b/rust/src/parser/src/tool/test_utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde_json::json; use super::{ToolParser, ToolParserOutput}; diff --git a/rust/src/parser/src/tool/tests.rs b/rust/src/parser/src/tool/tests.rs index 5a79e76420..bb6348ac36 100644 --- a/rust/src/parser/src/tool/tests.rs +++ b/rust/src/parser/src/tool/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::{Result, Tool, ToolCallDelta, ToolParser, ToolParserEvent, ToolParserOutput}; use crate::tool::ToolParserTestExt as _; diff --git a/rust/src/parser/src/unified/combined.rs b/rust/src/parser/src/unified/combined.rs index 3b6abb4b93..13183192c6 100644 --- a/rust/src/parser/src/unified/combined.rs +++ b/rust/src/parser/src/unified/combined.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Adapter that combines reasoning and tool parsers. use vllm_tokenizer::DynTokenizer; diff --git a/rust/src/parser/src/unified/gemma4.rs b/rust/src/parser/src/unified/gemma4.rs index 51a1de12c2..bc5925189e 100644 --- a/rust/src/parser/src/unified/gemma4.rs +++ b/rust/src/parser/src/unified/gemma4.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde_json::{Map, Number, Value}; use vllm_tokenizer::DynTokenizer; use winnow::ascii::multispace0 as ws0; diff --git a/rust/src/parser/src/unified/mod.rs b/rust/src/parser/src/unified/mod.rs index 0410c56846..1fec8ac09b 100644 --- a/rust/src/parser/src/unified/mod.rs +++ b/rust/src/parser/src/unified/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Unified parser interface for reasoning and tool-call deltas. mod combined; diff --git a/rust/src/parser/src/utils.rs b/rust/src/parser/src/utils.rs index c692a57c88..ce932fbce2 100644 --- a/rust/src/parser/src/utils.rs +++ b/rust/src/parser/src/utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Shared helpers for streaming parsers. use winnow::Parser; diff --git a/rust/src/server/build.rs b/rust/src/server/build.rs index 86a44aac7b..c20ff1c86b 100644 --- a/rust/src/server/build.rs +++ b/rust/src/server/build.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + fn main() -> Result<(), Box> { let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); let proto_dir = format!("{manifest_dir}/../../proto"); diff --git a/rust/src/server/examples/external_engine_openai_qwen.rs b/rust/src/server/examples/external_engine_openai_qwen.rs index d1c6c0fc31..2c2779569a 100644 --- a/rust/src/server/examples/external_engine_openai_qwen.rs +++ b/rust/src/server/examples/external_engine_openai_qwen.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Duration; use anyhow::{Context, Result, bail}; diff --git a/rust/src/server/src/config.rs b/rust/src/server/src/config.rs index 2ed3da2c1d..91373c82f2 100644 --- a/rust/src/server/src/config.rs +++ b/rust/src/server/src/config.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::fmt; use std::time::Duration; diff --git a/rust/src/server/src/error.rs b/rust/src/server/src/error.rs index c566f0e227..fbd13b77ba 100644 --- a/rust/src/server/src/error.rs +++ b/rust/src/server/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use axum::Json; use axum::http::StatusCode; use axum::response::{IntoResponse, Response}; diff --git a/rust/src/server/src/grpc/convert.rs b/rust/src/server/src/grpc/convert.rs index 5bea5a52e7..2f13422fec 100644 --- a/rust/src/server/src/grpc/convert.rs +++ b/rust/src/server/src/grpc/convert.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Conversion between gRPC protobuf types and internal `vllm-text` //! request/response types. diff --git a/rust/src/server/src/grpc/mod.rs b/rust/src/server/src/grpc/mod.rs index 59ce52dfc7..023aae38ac 100644 --- a/rust/src/server/src/grpc/mod.rs +++ b/rust/src/server/src/grpc/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! gRPC Generate service backed by the shared [`vllm_text::TextLlm`] facade. mod convert; diff --git a/rust/src/server/src/grpc/tests.rs b/rust/src/server/src/grpc/tests.rs index 205f449245..56d0c1c2f5 100644 --- a/rust/src/server/src/grpc/tests.rs +++ b/rust/src/server/src/grpc/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::future::Future; use std::io; use std::pin::Pin; diff --git a/rust/src/server/src/lib.rs b/rust/src/server/src/lib.rs index 008a29149e..7f1ec91c6f 100644 --- a/rust/src/server/src/lib.rs +++ b/rust/src/server/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Minimal OpenAI-compatible HTTP server above [`vllm_chat`]. mod config; diff --git a/rust/src/server/src/listener.rs b/rust/src/server/src/listener.rs index e61484398a..5af274d581 100644 --- a/rust/src/server/src/listener.rs +++ b/rust/src/server/src/listener.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Unified listener wrapper for the Rust frontend. //! //! This module hides the difference between TCP and Unix-domain listeners so diff --git a/rust/src/server/src/lora.rs b/rust/src/server/src/lora.rs index e92c663419..896ba32aac 100644 --- a/rust/src/server/src/lora.rs +++ b/rust/src/server/src/lora.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::atomic::{AtomicU64, Ordering}; use indexmap::IndexMap; diff --git a/rust/src/server/src/middleware/auth.rs b/rust/src/server/src/middleware/auth.rs index 696e30615a..93791fff62 100644 --- a/rust/src/server/src/middleware/auth.rs +++ b/rust/src/server/src/middleware/auth.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/middleware/cors.rs b/rust/src/server/src/middleware/cors.rs index bd158880e1..89d1b6f3b7 100644 --- a/rust/src/server/src/middleware/cors.rs +++ b/rust/src/server/src/middleware/cors.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! CORS support mirroring Python's Starlette `CORSMiddleware`. //! //! Built on `tower_http::cors::CorsLayer`, configured to reproduce Starlette's diff --git a/rust/src/server/src/middleware/load.rs b/rust/src/server/src/middleware/load.rs index d03b36fb5f..b5600cc8ce 100644 --- a/rust/src/server/src/middleware/load.rs +++ b/rust/src/server/src/middleware/load.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::pin::Pin; use std::sync::{Arc, Weak}; use std::task::{Context, Poll}; diff --git a/rust/src/server/src/middleware/metrics.rs b/rust/src/server/src/middleware/metrics.rs index 366d73dd3d..e45ae5f8e4 100644 --- a/rust/src/server/src/middleware/metrics.rs +++ b/rust/src/server/src/middleware/metrics.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::time::Instant; use axum::extract::{MatchedPath, Request}; diff --git a/rust/src/server/src/middleware/mod.rs b/rust/src/server/src/middleware/mod.rs index d61f8bc3cc..444099175d 100644 --- a/rust/src/server/src/middleware/mod.rs +++ b/rust/src/server/src/middleware/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod auth; mod cors; mod load; diff --git a/rust/src/server/src/middleware/offload.rs b/rust/src/server/src/middleware/offload.rs index 28cde754c4..edc6560bf2 100644 --- a/rust/src/server/src/middleware/offload.rs +++ b/rust/src/server/src/middleware/offload.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use std::task::{Context, Poll}; diff --git a/rust/src/server/src/middleware/request_id.rs b/rust/src/server/src/middleware/request_id.rs index f96b483a16..622085b94d 100644 --- a/rust/src/server/src/middleware/request_id.rs +++ b/rust/src/server/src/middleware/request_id.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use axum::extract::Request; use axum::http::HeaderValue; use axum::http::header::HeaderName; diff --git a/rust/src/server/src/routes.rs b/rust/src/server/src/routes.rs index 11918c4fbc..b9157f6ec9 100644 --- a/rust/src/server/src/routes.rs +++ b/rust/src/server/src/routes.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod abort_requests; mod cache; mod collective_rpc; diff --git a/rust/src/server/src/routes/abort_requests.rs b/rust/src/server/src/routes/abort_requests.rs index 1f300a09c2..2987703160 100644 --- a/rust/src/server/src/routes/abort_requests.rs +++ b/rust/src/server/src/routes/abort_requests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/cache.rs b/rust/src/server/src/routes/cache.rs index 0626d2ffff..243c431a63 100644 --- a/rust/src/server/src/routes/cache.rs +++ b/rust/src/server/src/routes/cache.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/collective_rpc.rs b/rust/src/server/src/routes/collective_rpc.rs index 965797f301..bd769bee43 100644 --- a/rust/src/server/src/routes/collective_rpc.rs +++ b/rust/src/server/src/routes/collective_rpc.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use std::sync::Arc; diff --git a/rust/src/server/src/routes/health.rs b/rust/src/server/src/routes/health.rs index ff91f85700..743c0a83f4 100644 --- a/rust/src/server/src/routes/health.rs +++ b/rust/src/server/src/routes/health.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::extract::State; diff --git a/rust/src/server/src/routes/http_client_tests.rs b/rust/src/server/src/routes/http_client_tests.rs index dd9af6f1d9..54fc4a04cd 100644 --- a/rust/src/server/src/routes/http_client_tests.rs +++ b/rust/src/server/src/routes/http_client_tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Integration tests that exercise the OpenAI-compatible HTTP API through a //! real TCP connection using the `async-openai` client library, backed by a //! mock engine. diff --git a/rust/src/server/src/routes/inference/generate.rs b/rust/src/server/src/routes/inference/generate.rs index 01dca44a22..6fcdb427cc 100644 --- a/rust/src/server/src/routes/inference/generate.rs +++ b/rust/src/server/src/routes/inference/generate.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod convert; mod types; mod validate; diff --git a/rust/src/server/src/routes/inference/generate/convert.rs b/rust/src/server/src/routes/inference/generate/convert.rs index 15cf32a2bf..02a52b0414 100644 --- a/rust/src/server/src/routes/inference/generate/convert.rs +++ b/rust/src/server/src/routes/inference/generate/convert.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use vllm_text::{Prompt, TextDecodeOptions, TextRequest}; use super::types::GenerateRequest; diff --git a/rust/src/server/src/routes/inference/generate/types.rs b/rust/src/server/src/routes/inference/generate/types.rs index 269338ee2b..18095d5288 100644 --- a/rust/src/server/src/routes/inference/generate/types.rs +++ b/rust/src/server/src/routes/inference/generate/types.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use serde::{Deserialize, Serialize}; diff --git a/rust/src/server/src/routes/inference/generate/validate.rs b/rust/src/server/src/routes/inference/generate/validate.rs index 3b925f3af2..772bcaf378 100644 --- a/rust/src/server/src/routes/inference/generate/validate.rs +++ b/rust/src/server/src/routes/inference/generate/validate.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::types::GenerateRequest; use crate::error::{ApiError, bail_invalid_request}; diff --git a/rust/src/server/src/routes/inference/mod.rs b/rust/src/server/src/routes/inference/mod.rs index d601d03874..7561fd953c 100644 --- a/rust/src/server/src/routes/inference/mod.rs +++ b/rust/src/server/src/routes/inference/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod generate; pub use generate::generate; diff --git a/rust/src/server/src/routes/load.rs b/rust/src/server/src/routes/load.rs index 0f666b24e4..de1bd2ee98 100644 --- a/rust/src/server/src/routes/load.rs +++ b/rust/src/server/src/routes/load.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/lora.rs b/rust/src/server/src/routes/lora.rs index 99f1c0fe32..dad817c69a 100644 --- a/rust/src/server/src/routes/lora.rs +++ b/rust/src/server/src/routes/lora.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::{Component, Path, PathBuf}; use std::sync::Arc; diff --git a/rust/src/server/src/routes/metrics.rs b/rust/src/server/src/routes/metrics.rs index f7017fadcc..b9cd522ba1 100644 --- a/rust/src/server/src/routes/metrics.rs +++ b/rust/src/server/src/routes/metrics.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use axum::http::header::CONTENT_TYPE; use axum::http::{HeaderValue, StatusCode}; use axum::response::{IntoResponse, Response}; diff --git a/rust/src/server/src/routes/openai/chat_completions.rs b/rust/src/server/src/routes/openai/chat_completions.rs index 56ef500c28..41ef192b73 100644 --- a/rust/src/server/src/routes/openai/chat_completions.rs +++ b/rust/src/server/src/routes/openai/chat_completions.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub(crate) mod convert; mod types; mod validate; diff --git a/rust/src/server/src/routes/openai/chat_completions/convert.rs b/rust/src/server/src/routes/openai/chat_completions/convert.rs index 8cf5a5dc77..9ed7af087a 100644 --- a/rust/src/server/src/routes/openai/chat_completions/convert.rs +++ b/rust/src/server/src/routes/openai/chat_completions/convert.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use itertools::Itertools as _; use vllm_chat::{ AssistantContentBlock, AssistantToolCall, ChatContent, ChatContentPart, diff --git a/rust/src/server/src/routes/openai/chat_completions/types.rs b/rust/src/server/src/routes/openai/chat_completions/types.rs index be3be36e5e..1ab2f4c604 100644 --- a/rust/src/server/src/routes/openai/chat_completions/types.rs +++ b/rust/src/server/src/routes/openai/chat_completions/types.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::fmt; diff --git a/rust/src/server/src/routes/openai/chat_completions/validate.rs b/rust/src/server/src/routes/openai/chat_completions/validate.rs index 2859b02274..3869b969ac 100644 --- a/rust/src/server/src/routes/openai/chat_completions/validate.rs +++ b/rust/src/server/src/routes/openai/chat_completions/validate.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::types::ChatCompletionRequest; use crate::error::{ApiError, bail_invalid_request}; use crate::routes::openai::utils::types::{ChatMessage, Tool}; diff --git a/rust/src/server/src/routes/openai/completions.rs b/rust/src/server/src/routes/openai/completions.rs index 16ceb6c169..cf15e138bf 100644 --- a/rust/src/server/src/routes/openai/completions.rs +++ b/rust/src/server/src/routes/openai/completions.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod convert; mod types; mod validate; diff --git a/rust/src/server/src/routes/openai/completions/convert.rs b/rust/src/server/src/routes/openai/completions/convert.rs index 80ae6b06b1..2030a4ad40 100644 --- a/rust/src/server/src/routes/openai/completions/convert.rs +++ b/rust/src/server/src/routes/openai/completions/convert.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror_ext::AsReport as _; use vllm_text::tokenizer::Tokenizer; use vllm_text::{Prompt, SamplingParams, TextDecodeOptions, TextRequest}; diff --git a/rust/src/server/src/routes/openai/completions/types.rs b/rust/src/server/src/routes/openai/completions/types.rs index ce13ca32b9..09d4021501 100644 --- a/rust/src/server/src/routes/openai/completions/types.rs +++ b/rust/src/server/src/routes/openai/completions/types.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use serde::{Deserialize, Serialize}; diff --git a/rust/src/server/src/routes/openai/completions/validate.rs b/rust/src/server/src/routes/openai/completions/validate.rs index 7db8a5878b..2261b05114 100644 --- a/rust/src/server/src/routes/openai/completions/validate.rs +++ b/rust/src/server/src/routes/openai/completions/validate.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::types::CompletionRequest; use crate::error::{ApiError, bail_invalid_request}; diff --git a/rust/src/server/src/routes/openai/mod.rs b/rust/src/server/src/routes/openai/mod.rs index 0cc8887dfa..086a2dedd3 100644 --- a/rust/src/server/src/routes/openai/mod.rs +++ b/rust/src/server/src/routes/openai/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod chat_completions; mod completions; mod models; diff --git a/rust/src/server/src/routes/openai/models.rs b/rust/src/server/src/routes/openai/models.rs index b06e2dc693..2a0f092be5 100644 --- a/rust/src/server/src/routes/openai/models.rs +++ b/rust/src/server/src/routes/openai/models.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/rust/src/server/src/routes/openai/utils/logprobs.rs b/rust/src/server/src/routes/openai/utils/logprobs.rs index aab02e46ec..19215755f5 100644 --- a/rust/src/server/src/routes/openai/utils/logprobs.rs +++ b/rust/src/server/src/routes/openai/utils/logprobs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use itertools::Itertools as _; diff --git a/rust/src/server/src/routes/openai/utils/mod.rs b/rust/src/server/src/routes/openai/utils/mod.rs index 70e9d1466d..fba435c6dc 100644 --- a/rust/src/server/src/routes/openai/utils/mod.rs +++ b/rust/src/server/src/routes/openai/utils/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod logprobs; pub mod structured_outputs; pub mod types; diff --git a/rust/src/server/src/routes/openai/utils/structured_outputs.rs b/rust/src/server/src/routes/openai/utils/structured_outputs.rs index e717765c51..2a7b78fe40 100644 --- a/rust/src/server/src/routes/openai/utils/structured_outputs.rs +++ b/rust/src/server/src/routes/openai/utils/structured_outputs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use serde::{Deserialize, Serialize}; use serde_json::Value; use vllm_engine_core_client::protocol::structured_outputs::StructuredOutputsParams; diff --git a/rust/src/server/src/routes/openai/utils/types.rs b/rust/src/server/src/routes/openai/utils/types.rs index e5b0deb940..471def4c6a 100644 --- a/rust/src/server/src/routes/openai/utils/types.rs +++ b/rust/src/server/src/routes/openai/utils/types.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::slice; diff --git a/rust/src/server/src/routes/openai/utils/usage.rs b/rust/src/server/src/routes/openai/utils/usage.rs index c8c9d1e726..845b7ddeb6 100644 --- a/rust/src/server/src/routes/openai/utils/usage.rs +++ b/rust/src/server/src/routes/openai/utils/usage.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use super::types::Usage; /// Tracks cumulative token counts for OpenAI streaming chunks. diff --git a/rust/src/server/src/routes/openai/utils/validated_json.rs b/rust/src/server/src/routes/openai/utils/validated_json.rs index d07158cc2e..1ddec3a9f5 100644 --- a/rust/src/server/src/routes/openai/utils/validated_json.rs +++ b/rust/src/server/src/routes/openai/utils/validated_json.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Validated JSON extractor for automatic request validation. //! Variation of https://github.com/lightseekorg/smg/blob/main/crates/protocols/src/validated.rs diff --git a/rust/src/server/src/routes/pause.rs b/rust/src/server/src/routes/pause.rs index 934846054e..1654c85b02 100644 --- a/rust/src/server/src/routes/pause.rs +++ b/rust/src/server/src/routes/pause.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/profile.rs b/rust/src/server/src/routes/profile.rs index d70db30d73..de793a7b3b 100644 --- a/rust/src/server/src/routes/profile.rs +++ b/rust/src/server/src/routes/profile.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::extract::State; diff --git a/rust/src/server/src/routes/server_info.rs b/rust/src/server/src/routes/server_info.rs index aefb17a25f..d5a5b42618 100644 --- a/rust/src/server/src/routes/server_info.rs +++ b/rust/src/server/src/routes/server_info.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/sleep.rs b/rust/src/server/src/routes/sleep.rs index 9df2e31e76..4bf9981402 100644 --- a/rust/src/server/src/routes/sleep.rs +++ b/rust/src/server/src/routes/sleep.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/tests.rs b/rust/src/server/src/routes/tests.rs index f36da7a360..c0d1e3dd79 100644 --- a/rust/src/server/src/routes/tests.rs +++ b/rust/src/server/src/routes/tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + // Route tests should use `Service::call` rather than `ServiceExt::oneshot`. // `oneshot` consumes the router and can drop `AppState` before a streaming // response body is fully drained, which closes the mock engine connection too diff --git a/rust/src/server/src/routes/tokenize.rs b/rust/src/server/src/routes/tokenize.rs index 3fb4f149e6..0825e295d7 100644 --- a/rust/src/server/src/routes/tokenize.rs +++ b/rust/src/server/src/routes/tokenize.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! `POST /tokenize` and `POST /detokenize` (root paths, matching Python). //! //! Encode/decode runs entirely in-process via [`DynTokenizer`]; the inference diff --git a/rust/src/server/src/routes/tokenize/types.rs b/rust/src/server/src/routes/tokenize/types.rs index f8c3e1cee8..242a7af473 100644 --- a/rust/src/server/src/routes/tokenize/types.rs +++ b/rust/src/server/src/routes/tokenize/types.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use itertools::Itertools as _; diff --git a/rust/src/server/src/routes/version.rs b/rust/src/server/src/routes/version.rs index 07a92e6d88..e4f6f3f1ea 100644 --- a/rust/src/server/src/routes/version.rs +++ b/rust/src/server/src/routes/version.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/routes/world_size.rs b/rust/src/server/src/routes/world_size.rs index da15757e8a..2347158477 100644 --- a/rust/src/server/src/routes/world_size.rs +++ b/rust/src/server/src/routes/world_size.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use axum::Json; diff --git a/rust/src/server/src/runtime.rs b/rust/src/server/src/runtime.rs index 4a8711a6af..320ca9a699 100644 --- a/rust/src/server/src/runtime.rs +++ b/rust/src/server/src/runtime.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use tokio::runtime::Builder; use tracing::{info, warn}; use vllm_engine_core_client::runtime::BackgroundShutdownRuntime; diff --git a/rust/src/server/src/server_info.rs b/rust/src/server/src/server_info.rs index cca1b0f379..24daa0ce8c 100644 --- a/rust/src/server/src/server_info.rs +++ b/rust/src/server/src/server_info.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use serde_json::{Value, json}; diff --git a/rust/src/server/src/state.rs b/rust/src/server/src/state.rs index bdfd83e576..722dede8dd 100644 --- a/rust/src/server/src/state.rs +++ b/rust/src/server/src/state.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, OnceLock}; diff --git a/rust/src/server/src/tls.rs b/rust/src/server/src/tls.rs index aa77e8191e..b03b33d941 100644 --- a/rust/src/server/src/tls.rs +++ b/rust/src/server/src/tls.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! OpenSSL server-config construction for TLS termination. //! //! Builds an OpenSSL [`SslContext`] from the uvicorn-style `ssl_*` arguments diff --git a/rust/src/server/src/tls_tests.rs b/rust/src/server/src/tls_tests.rs index c9bd063d77..32d5582100 100644 --- a/rust/src/server/src/tls_tests.rs +++ b/rust/src/server/src/tls_tests.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! TLS tests: `build_server_config` unit checks plus end-to-end OpenSSL handshakes //! through the production listener/connection path, with a trivial router since TLS //! terminates below the app. diff --git a/rust/src/server/src/utils.rs b/rust/src/server/src/utils.rs index 6e0b572b93..8879e0ef89 100644 --- a/rust/src/server/src/utils.rs +++ b/rust/src/server/src/utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use std::time::{SystemTime, UNIX_EPOCH}; diff --git a/rust/src/text/src/backend/hf/config.rs b/rust/src/text/src/backend/hf/config.rs index fbf796b5a7..140bfdc304 100644 --- a/rust/src/text/src/backend/hf/config.rs +++ b/rust/src/text/src/backend/hf/config.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; use std::fs; use std::path::Path; diff --git a/rust/src/text/src/backend/hf/mod.rs b/rust/src/text/src/backend/hf/mod.rs index 0e8a9bd3c0..a145ecc39b 100644 --- a/rust/src/text/src/backend/hf/mod.rs +++ b/rust/src/text/src/backend/hf/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + mod config; mod model_files; diff --git a/rust/src/text/src/backend/hf/model_files.rs b/rust/src/text/src/backend/hf/model_files.rs index bc1ebea962..d0b0caecce 100644 --- a/rust/src/text/src/backend/hf/model_files.rs +++ b/rust/src/text/src/backend/hf/model_files.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::{Path, PathBuf}; use hf_hub::Cache; diff --git a/rust/src/text/src/backend/mod.rs b/rust/src/text/src/backend/mod.rs index 8bc834aeae..98b709f118 100644 --- a/rust/src/text/src/backend/mod.rs +++ b/rust/src/text/src/backend/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + pub mod hf; use std::sync::Arc; diff --git a/rust/src/text/src/error.rs b/rust/src/text/src/error.rs index 76827ae581..e72e68196c 100644 --- a/rust/src/text/src/error.rs +++ b/rust/src/text/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error; use vllm_engine_core_client::Error as EngineCoreError; use vllm_llm::Error as LlmError; diff --git a/rust/src/text/src/lib.rs b/rust/src/text/src/lib.rs index 130eaec7f4..1ccd53127a 100644 --- a/rust/src/text/src/lib.rs +++ b/rust/src/text/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Shared text-generation support used by chat and future raw completions. //! //! This crate intentionally stays below chat semantics: diff --git a/rust/src/text/src/lower.rs b/rust/src/text/src/lower.rs index 164d2a3db0..bd43a1d141 100644 --- a/rust/src/text/src/lower.rs +++ b/rust/src/text/src/lower.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeSet; pub(crate) mod logprobs; diff --git a/rust/src/text/src/lower/logprobs.rs b/rust/src/text/src/lower/logprobs.rs index 116835560c..b2407f06ed 100644 --- a/rust/src/text/src/lower/logprobs.rs +++ b/rust/src/text/src/lower/logprobs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Python-compatible validation for logprobs sampling params. //! //! `-1` is expanded only for bounds checks. The original request values are diff --git a/rust/src/text/src/lower/token_ids.rs b/rust/src/text/src/lower/token_ids.rs index ad37d86490..8512a830e6 100644 --- a/rust/src/text/src/lower/token_ids.rs +++ b/rust/src/text/src/lower/token_ids.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::result::Result; use thiserror::Error; diff --git a/rust/src/text/src/output/decoded.rs b/rust/src/text/src/output/decoded.rs index 6f95a7c3ff..9d19741b7b 100644 --- a/rust/src/text/src/output/decoded.rs +++ b/rust/src/text/src/output/decoded.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use asynk_strim_attr::{TryYielder, try_stream}; diff --git a/rust/src/text/src/output/logprobs.rs b/rust/src/text/src/output/logprobs.rs index 069a8cba27..9979a61878 100644 --- a/rust/src/text/src/output/logprobs.rs +++ b/rust/src/text/src/output/logprobs.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use itertools::Itertools as _; use serde::{Deserialize, Serialize}; use vllm_llm::{Logprobs, PositionLogprobs}; diff --git a/rust/src/text/src/output/mod.rs b/rust/src/text/src/output/mod.rs index 2441650a63..c3499a9f35 100644 --- a/rust/src/text/src/output/mod.rs +++ b/rust/src/text/src/output/mod.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Output processing helpers shared by text and chat layers. pub use decoded::{DecodedTextEvent, Finished, TextDecodeOptions, decoded_text_event_stream}; diff --git a/rust/src/text/src/request.rs b/rust/src/text/src/request.rs index 0952286887..c12da81c71 100644 --- a/rust/src/text/src/request.rs +++ b/rust/src/text/src/request.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashMap; use enum_as_inner::EnumAsInner; diff --git a/rust/src/tokenizer/benches/hf.rs b/rust/src/tokenizer/benches/hf.rs index 950c4784a7..4359e349b0 100644 --- a/rust/src/tokenizer/benches/hf.rs +++ b/rust/src/tokenizer/benches/hf.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main}; use hf_hub::api::tokio::ApiBuilder; use tokio::runtime::Runtime; diff --git a/rust/src/tokenizer/benches/tiktoken.rs b/rust/src/tokenizer/benches/tiktoken.rs index 6540adf486..467b2f54ff 100644 --- a/rust/src/tokenizer/benches/tiktoken.rs +++ b/rust/src/tokenizer/benches/tiktoken.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main}; use hf_hub::api::tokio::ApiBuilder; use tokio::runtime::Runtime; diff --git a/rust/src/tokenizer/src/byte_level_decode.rs b/rust/src/tokenizer/src/byte_level_decode.rs index 8208e8e8d4..ad71f6decb 100644 --- a/rust/src/tokenizer/src/byte_level_decode.rs +++ b/rust/src/tokenizer/src/byte_level_decode.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + //! Fast GPT-2 byte-level detokenization that writes into a single `Vec`, //! avoiding the `Vec` / `String::join` assembly in fastokens' generic //! `Decoder::decode` pipeline. diff --git a/rust/src/tokenizer/src/error.rs b/rust/src/tokenizer/src/error.rs index cfe8253ffe..133e6e94ee 100644 --- a/rust/src/tokenizer/src/error.rs +++ b/rust/src/tokenizer/src/error.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use thiserror::Error; use thiserror_ext::Macro; diff --git a/rust/src/tokenizer/src/hf.rs b/rust/src/tokenizer/src/hf.rs index 2982f8c4aa..08ec5a22d6 100644 --- a/rust/src/tokenizer/src/hf.rs +++ b/rust/src/tokenizer/src/hf.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::Path; use std::sync::Arc; diff --git a/rust/src/tokenizer/src/hf/added_tokens.rs b/rust/src/tokenizer/src/hf/added_tokens.rs index ab0c015559..42cd18bfad 100644 --- a/rust/src/tokenizer/src/hf/added_tokens.rs +++ b/rust/src/tokenizer/src/hf/added_tokens.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::fs; use std::path::Path; diff --git a/rust/src/tokenizer/src/incremental.rs b/rust/src/tokenizer/src/incremental.rs index e4ed4ab265..cf2263d353 100644 --- a/rust/src/tokenizer/src/incremental.rs +++ b/rust/src/tokenizer/src/incremental.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::mem::take; use crate::{Result, Tokenizer}; diff --git a/rust/src/tokenizer/src/lib.rs b/rust/src/tokenizer/src/lib.rs index 4f459450c6..6c9fcd3fde 100644 --- a/rust/src/tokenizer/src/lib.rs +++ b/rust/src/tokenizer/src/lib.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::sync::Arc; use crate::incremental::DecodeStream; diff --git a/rust/src/tokenizer/src/tekken.rs b/rust/src/tokenizer/src/tekken.rs index 50981efdde..20b6c26ffc 100644 --- a/rust/src/tokenizer/src/tekken.rs +++ b/rust/src/tokenizer/src/tekken.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::path::Path; use tekken::Tekkenizer; diff --git a/rust/src/tokenizer/src/test_utils.rs b/rust/src/tokenizer/src/test_utils.rs index efc4c11717..36d1f3d18a 100644 --- a/rust/src/tokenizer/src/test_utils.rs +++ b/rust/src/tokenizer/src/test_utils.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::BTreeMap; use crate::{Result, Tokenizer, TokenizerError}; diff --git a/rust/src/tokenizer/src/tiktoken.rs b/rust/src/tokenizer/src/tiktoken.rs index 9b4c17a855..d5ca119b80 100644 --- a/rust/src/tokenizer/src/tiktoken.rs +++ b/rust/src/tokenizer/src/tiktoken.rs @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project + use std::collections::HashSet; use std::path::Path; use std::sync::Mutex; diff --git a/tools/pre_commit/check_spdx_header.py b/tools/pre_commit/check_spdx_header.py index 1fcca12519..2585e82b4e 100644 --- a/tools/pre_commit/check_spdx_header.py +++ b/tools/pre_commit/check_spdx_header.py @@ -2,7 +2,17 @@ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import sys +from dataclasses import dataclass from enum import Enum +from pathlib import Path + + +@dataclass(frozen=True) +class HeaderStyle: + """Comment syntax and preamble handling for an SPDX header.""" + + comment_prefix: str + preserve_shebang: bool = False class SPDXStatus(Enum): @@ -15,37 +25,56 @@ class SPDXStatus(Enum): MISSING_BOTH = "missing_both" # Completely missing -FULL_SPDX_HEADER = ( - "# SPDX-License-Identifier: Apache-2.0\n" - "# SPDX-FileCopyrightText: Copyright contributors to the vLLM project" -) +LICENSE_TEXT = "SPDX-License-Identifier: Apache-2.0" +COPYRIGHT_TEXT = "SPDX-FileCopyrightText: Copyright contributors to the vLLM project" +FILE_STYLES = { + ".py": HeaderStyle("#", preserve_shebang=True), + ".rs": HeaderStyle("//"), + ".proto": HeaderStyle("//"), +} -LICENSE_LINE = "# SPDX-License-Identifier: Apache-2.0" -COPYRIGHT_LINE = "# SPDX-FileCopyrightText: Copyright contributors to the vLLM project" # noqa: E501 + +def file_style(file_path): + """Return the declared header style for a file.""" + suffix = Path(file_path).suffix + try: + return FILE_STYLES[suffix] + except KeyError: + raise ValueError(f"Unsupported file type: {file_path}") from None + + +def spdx_header(style): + """Return the SPDX header for a file style.""" + license_line = f"{style.comment_prefix} {LICENSE_TEXT}" + copyright_line = f"{style.comment_prefix} {COPYRIGHT_TEXT}" + return license_line, copyright_line + + +def header_insertion_index(style, lines): + """Return the line index where a missing header should be inserted.""" + if style.preserve_shebang and lines and lines[0].startswith("#!"): + return 1 + return 0 def check_spdx_header_status(file_path): """Check SPDX header status of the file""" + license_line, copyright_line = spdx_header(file_style(file_path)) with open(file_path, encoding="UTF-8") as file: lines = file.readlines() if not lines: # Empty file return SPDXStatus.EMPTY - # Skip shebang line - start_idx = 0 - if lines and lines[0].startswith("#!"): - start_idx = 1 - has_license = False has_copyright = False # Check all lines for SPDX headers (not just the first two) - for i in range(start_idx, len(lines)): - line = lines[i].strip() - if line == LICENSE_LINE: + for raw_line in lines: + line = raw_line.strip() + if line == license_line: has_license = True - elif line == COPYRIGHT_LINE: + elif line == copyright_line: has_copyright = True # Determine status based on what we found @@ -54,8 +83,8 @@ def check_spdx_header_status(file_path): elif has_license and not has_copyright: # Only has license line return SPDXStatus.MISSING_COPYRIGHT - # Only has copyright line elif not has_license and has_copyright: + # Only has copyright line return SPDXStatus.MISSING_LICENSE else: # Completely missing both lines @@ -64,6 +93,9 @@ def check_spdx_header_status(file_path): def add_header(file_path, status): """Add or supplement SPDX header based on status""" + style = file_style(file_path) + license_line, copyright_line = spdx_header(style) + full_spdx_header = f"{license_line}\n{copyright_line}" with open(file_path, "r+", encoding="UTF-8") as file: lines = file.readlines() file.seek(0, 0) @@ -71,25 +103,23 @@ def add_header(file_path, status): if status == SPDXStatus.MISSING_BOTH: # Completely missing, add complete header - if lines and lines[0].startswith("#!"): - # Preserve shebang line - file.write(lines[0]) - file.write(FULL_SPDX_HEADER + "\n") - file.writelines(lines[1:]) - else: - # Add header directly - file.write(FULL_SPDX_HEADER + "\n") - file.writelines(lines) + insertion_index = header_insertion_index(style, lines) + file.writelines(lines[:insertion_index]) + file.write(full_spdx_header + "\n") + remaining_lines = lines[insertion_index:] + if remaining_lines and remaining_lines[0].strip(): + file.write("\n") + file.writelines(remaining_lines) elif status == SPDXStatus.MISSING_COPYRIGHT: # Only has license line, need to add copyright line # Find the license line and add copyright line after it for i, line in enumerate(lines): - if line.strip() == LICENSE_LINE: + if line.strip() == license_line: # Insert copyright line after license line lines.insert( i + 1, - f"{COPYRIGHT_LINE}\n", + f"{copyright_line}\n", ) break @@ -99,9 +129,9 @@ def add_header(file_path, status): # Only has copyright line, need to add license line # Find the copyright line and add license line before it for i, line in enumerate(lines): - if line.strip() == COPYRIGHT_LINE: + if line.strip() == copyright_line: # Insert license line before copyright line - lines.insert(i, f"{LICENSE_LINE}\n") + lines.insert(i, f"{license_line}\n") break file.writelines(lines)