[CI] Add SPDX license header to Rust/Protobuf sources (#48472)

Signed-off-by: Bugen Zhao <i@bugenzhao.com>

Bugen Zhao committed Jul 13, 2026 at 17:22 UTC 487dfb34185e12177ed9eb8f8b0fe337e85b591a
253 files changed +813 -30
.pre-commit-config.yaml
+1 -1
@@ -210,7 +210,7 @@ repos:
210 name: Check SPDX headers
211 entry: python tools/pre_commit/check_spdx_header.py
212 language: python
213 - types: [python]
213 + types_or: [python, rust, proto]
214 - id: check-root-lazy-imports
215 name: Check root lazy imports
216 entry: python tools/pre_commit/check_init_lazy_imports.py
rust/proto/vllm_grpc.proto
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 syntax = "proto3";
5 package vllm;
6
rust/src/chat/examples/external_engine_chat_qwen.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use anyhow::{Context, Result, bail};
rust/src/chat/src/backend/hf.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use tracing::info;
rust/src/chat/src/backend/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::sync::Arc;
6
rust/src/chat/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error;
5 use thiserror_ext::{AsReport as _, Macro};
6
rust/src/chat/src/event.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::ops::Deref;
5 use std::sync::Arc;
6
rust/src/chat/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Minimal chat facade above [`vllm_text`].
5 //!
6 //! This crate keeps the northbound boundary intentionally small:
rust/src/chat/src/multimodal.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Chat-layer multimodal media preparation.
5 //!
6 //! This module owns the multimodal path for chat requests: it extracts media
rust/src/chat/src/multimodal/expand.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Prompt placeholder expansion shared across modalities.
5
6 use std::collections::{HashMap, VecDeque};
rust/src/chat/src/multimodal/image.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Image-modality preparation: batch preprocessing and per-item feature
5 //! build.
6
rust/src/chat/src/multimodal/tensor.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use half::{bf16, f16};
rust/src/chat/src/multimodal/video.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Video-modality preparation: per-clip preprocessing, config resolution,
5 //! and per-item feature build.
6
rust/src/chat/src/output/default/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Default output processing pipeline.
5
6 mod structural_tag;
rust/src/chat/src/output/default/structural_tag.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Applies xgrammar structural-tag constraints for strict tool calling.
5
6 use thiserror_ext::AsReport;
rust/src/chat/src/output/default/unified.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Adapts decoded text updates into parsed assistant deltas.
5 //!
6 //! This stage sits between low-level token decoding and final block assembly.
rust/src/chat/src/output/harmony/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Native Harmony output processing for `gpt_oss`.
5 //!
6 //! Unlike the default text-first pipeline, this processor consumes
rust/src/chat/src/output/harmony/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use futures::executor::block_on;
rust/src/chat/src/output/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::pin::Pin;
5 use std::sync::Arc;
6
rust/src/chat/src/output/structured.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Adapts parsed assistant updates into structured chat events.
5 //!
6 //! This module remains the final assembly stage in `vllm-chat`. Token-to-text
rust/src/chat/src/parser/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod reasoning;
5 pub mod tool;
6 pub mod unified;
rust/src/chat/src/parser/reasoning/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Reasoning parser registration and selection boundary for `vllm-chat`.
5
6 use std::sync::{Arc, LazyLock};
rust/src/chat/src/parser/reasoning/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use vllm_tokenizer::test_utils::TestTokenizer;
rust/src/chat/src/parser/tool/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Tool parser registration and selection boundary for `vllm-chat`.
5
6 use std::sync::{Arc, LazyLock};
rust/src/chat/src/parser/tool/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_parser::tool::{Result, ToolParserOutput};
5
6 use super::{ToolParser, ToolParserFactory, names};
rust/src/chat/src/parser/unified.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Unified parser registration and selection boundary for `vllm-chat`.
5
6 use std::sync::LazyLock;
rust/src/chat/src/renderer/deepseek_v32/encoding.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! DeepSeek V3.2 prompt renderer.
5
6 use std::collections::{HashMap, HashSet};
rust/src/chat/src/renderer/deepseek_v32/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod encoding;
5
6 use vllm_text::Prompt;
rust/src/chat/src/renderer/deepseek_v32/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::PathBuf;
5
6 use expect_test::{ExpectFile, expect, expect_file};
rust/src/chat/src/renderer/deepseek_v4/encoding.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! DeepSeek V4 prompt renderer.
5 //!
6 //! Original Python implementation:
rust/src/chat/src/renderer/deepseek_v4/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod encoding;
5
6 use vllm_text::Prompt;
rust/src/chat/src/renderer/deepseek_v4/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::PathBuf;
5
6 use expect_test::{ExpectFile, expect, expect_file};
rust/src/chat/src/renderer/harmony/encoding.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Shared Harmony encoding helper for the GPT-OSS renderer and output parser.
5
6 use std::sync::LazyLock;
rust/src/chat/src/renderer/harmony/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Native Harmony chat renderer for `gpt_oss`.
5
6 pub(crate) mod encoding;
rust/src/chat/src/renderer/harmony/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::PathBuf;
5
6 use expect_test::{ExpectFile, expect, expect_file};
rust/src/chat/src/renderer/hf/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error as ThisError;
5
6 #[derive(Debug, ThisError)]
rust/src/chat/src/renderer/hf/format.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{HashSet, VecDeque};
5 use std::fmt;
6 use std::str::FromStr;
rust/src/chat/src/renderer/hf/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use serde::Serialize;
rust/src/chat/src/renderer/hf/template.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Chat template support for tokenizers using Jinja2 templates.
5 //!
6 //! This module is inlined from SMG's tokenizer crate with local adaptations:
rust/src/chat/src/renderer/hf/tojson.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use minijinja::value::{Kwargs, ViaDeserialize};
5 use minijinja::{Error as MinijinjaError, ErrorKind, Value};
6 use serde::Deserialize;
rust/src/chat/src/renderer/hf/value.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use indexmap::IndexMap;
rust/src/chat/src/renderer/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::sync::Arc;
6
rust/src/chat/src/renderer/selection.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::fmt;
5 use std::str::FromStr;
6
rust/src/chat/src/renderer/test_utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::fs;
5 use std::path::Path;
6
rust/src/chat/src/request.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use llm_multimodal::ImageDetail;
rust/src/chat/src/stream.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::pin::Pin;
5 use std::sync::Arc;
6 use std::task::{Context, Poll};
rust/src/chat/tests/chat.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5 use std::fmt;
6 use std::sync::Arc;
rust/src/chat/tests/roundtrip.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Roundtrip tests for the real chat-template and output-processor pairing.
5 //!
6 //! The invariant under test is that a structured assistant message rendered as history can be
rust/src/cmd/src/cli.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! CLI argument definitions for the `vllm-rs` binary.
5 //!
6 //! Python vLLM references:
rust/src/cmd/src/cli/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use expect_test::expect;
5 use vllm_engine_core_client::TransportMode;
6 use vllm_server::{Config, HttpListenerMode, ParserSelection, RendererSelection};
rust/src/cmd/src/cli/unsupported.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 #![allow(clippy::doc_lazy_continuation)]
5
6 use std::fmt::Display;
rust/src/cmd/src/logging.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::{env, fmt, process};
5
6 use time::UtcOffset;
rust/src/cmd/src/main.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod cli;
5 mod logging;
6
rust/src/engine-core-client/examples/external_engine_logprobs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use anyhow::{Context, Result, bail};
rust/src/engine-core-client/examples/external_engine_utility_call.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use anyhow::{Context, Result, bail};
rust/src/engine-core-client/src/client.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5 use std::time::Duration;
6
rust/src/engine-core-client/src/client/imp.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet};
5 use std::sync::Arc;
6 use std::time::{SystemTime, UNIX_EPOCH};
rust/src/engine-core-client/src/client/state.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet, HashMap};
5 use std::sync::atomic::{AtomicU64, Ordering};
6
rust/src/engine-core-client/src/client/stream.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::ops::Deref;
5 use std::pin::Pin;
6 use std::task::{Context, Poll};
rust/src/engine-core-client/src/coordinator/bootstrap.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use bytes::Bytes;
rust/src/engine-core-client/src/coordinator/external.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use serde_tuple::{Deserialize_tuple, Serialize_tuple};
rust/src/engine-core-client/src/coordinator/handle.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use parking_lot::Mutex;
rust/src/engine-core-client/src/coordinator/inproc.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use serde_tuple::{Deserialize_tuple, Serialize_tuple};
rust/src/engine-core-client/src/coordinator/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod bootstrap;
5 mod external;
6 mod handle;
rust/src/engine-core-client/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5 use std::time::Duration;
6
rust/src/engine-core-client/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod client;
5 mod coordinator;
6 mod error;
rust/src/engine-core-client/src/metrics.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5 use std::collections::BTreeSet;
6 use std::time::{SystemTime, UNIX_EPOCH};
rust/src/engine-core-client/src/mock_engine.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::Path;
5 use std::time::Duration;
6
rust/src/engine-core-client/src/protocol/dtype.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde::{Deserialize, Serialize};
5
6 /// Effective model dtype reported by the engine after config resolution.
rust/src/engine-core-client/src/protocol/handshake.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use serde::{Deserialize, Serialize};
rust/src/engine-core-client/src/protocol/logprobs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod array;
5 #[cfg(test)]
6 mod tests;
rust/src/engine-core-client/src/protocol/logprobs/array.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::io::Cursor;
5
6 use byteorder::{BigEndian, LittleEndian, NativeEndian, ReadBytesExt};
rust/src/engine-core-client/src/protocol/logprobs/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5
6 use bytes::Bytes;
rust/src/engine-core-client/src/protocol/logprobs/wire.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde_tuple::{Deserialize_tuple, Serialize_tuple};
5
6 use crate::protocol::tensor::WireNdArray;
rust/src/engine-core-client/src/protocol/lora.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde_tuple::{Deserialize_tuple, Serialize_tuple};
5
6 use crate::protocol::OpaqueValue;
rust/src/engine-core-client/src/protocol/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::any::type_name;
5 use std::io::Cursor;
6
rust/src/engine-core-client/src/protocol/multimodal.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use serde::{Deserialize, Serialize};
rust/src/engine-core-client/src/protocol/output.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5
6 use enum_as_inner::EnumAsInner;
rust/src/engine-core-client/src/protocol/request.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, HashMap};
5
6 use bytes::Bytes;
rust/src/engine-core-client/src/protocol/sampling.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeSet, HashMap};
5
6 use serde::{Deserialize, Serialize};
rust/src/engine-core-client/src/protocol/stats.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use serde::{Deserialize, Serialize};
rust/src/engine-core-client/src/protocol/structured_outputs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use enum_as_inner::EnumAsInner;
5 use serde::{Deserialize, Deserializer, Serialize, Serializer};
6 use serde_json::Value;
rust/src/engine-core-client/src/protocol/tensor.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use bytemuck::allocation::pod_collect_to_vec;
5 use enum_as_inner::EnumAsInner;
6 use half::{bf16, f16};
rust/src/engine-core-client/src/protocol/utility.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::any::type_name;
5 use std::fmt;
6 use std::str::FromStr;
rust/src/engine-core-client/src/runtime.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::mem::ManuallyDrop;
5 use std::ops::{Deref, DerefMut};
6 use std::sync::OnceLock;
rust/src/engine-core-client/src/test_utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::future::Future;
5 use std::path::Path;
6 use std::pin::Pin;
rust/src/engine-core-client/src/tests/client.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet};
5 use std::convert::TryFrom;
6 use std::io::Cursor;
rust/src/engine-core-client/src/tests/mod.rs
+3
@@ -1 +1,4 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod client;
rust/src/engine-core-client/src/transport.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet};
5 use std::fmt::Debug;
6 use std::ops::Deref;
rust/src/llm/examples/external_engine_smoke.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use anyhow::{Context, Result, bail};
rust/src/llm/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error;
5
6 pub type Result<T> = std::result::Result<T, Error>;
rust/src/llm/src/inflight.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Tracking of the external→internal request-id mapping for in-flight requests.
5 //!
6 //! When request-id randomization is enabled (the default), [`crate::Llm`]
rust/src/llm/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use tracing::Span;
5 use vllm_engine_core_client::EngineCoreClient;
6
rust/src/llm/src/log_stats.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::fmt::Write;
5 use std::time::{Duration, Instant};
6
rust/src/llm/src/output.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::future::Future;
5 use std::pin::Pin;
6 use std::sync::Arc;
rust/src/llm/src/request.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use uuid::Uuid;
rust/src/llm/src/request_metrics.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::{SystemTime, UNIX_EPOCH};
5
6 use vllm_engine_core_client::protocol::output::{
rust/src/llm/tests/generate.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5 use std::sync::Once;
6 use std::time::Duration;
rust/src/managed-engine/src/cli.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashSet;
5 use std::ffi::OsString;
6
rust/src/managed-engine/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod cli;
5 mod process;
6
rust/src/managed-engine/src/process.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::io;
5 use std::net::TcpListener;
6 use std::process::{Command as StdCommand, ExitStatus, Stdio};
rust/src/metrics/src/api_server.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use prometheus_client::encoding::EncodeLabelSet;
5 use prometheus_client::metrics::family::Family;
6 use prometheus_client::metrics::histogram::Histogram;
rust/src/metrics/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::fmt;
5 use std::sync::LazyLock;
6 use std::sync::atomic::AtomicU64;
rust/src/metrics/src/request.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use prometheus_client::encoding::EncodeLabelSet;
5 use prometheus_client::metrics::family::Family;
6 use prometheus_client::metrics::histogram::Histogram;
rust/src/metrics/src/scheduler.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet};
5 use std::sync::{Arc, Mutex};
6
rust/src/mock-engine/src/engine.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::{BTreeMap, BTreeSet, HashMap};
5 use std::hash::{Hash as _, Hasher as _};
6 use std::time::{SystemTime, UNIX_EPOCH};
rust/src/mock-engine/src/io.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use anyhow::{Context as _, Result, anyhow, bail};
5 use futures::{Stream, StreamExt as _, stream};
6 use tokio::sync::mpsc;
rust/src/mock-engine/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use anyhow::{Context, Result, bail};
5 use clap::Parser;
6 use tokio::sync::mpsc;
rust/src/mock-engine/src/main.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use anyhow::{Context, Result};
5 use clap::Parser as _;
6 use tokio_util::sync::CancellationToken;
rust/src/mock-engine/src/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::net::TcpListener;
5 use std::time::Duration;
6
rust/src/parser/benches/deepseek_v3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/deepseek_v31.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/deepseek_v32.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/gemma4.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/glm45_moe.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/granite4.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/kimi_k2.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/llama3_json.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/minimax_m2.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/qwen3_coder.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/qwen3_xml.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use criterion::{BatchSize, Criterion, Throughput, black_box, criterion_group, criterion_main};
rust/src/parser/benches/utils/adapter.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use vllm_parser::tool::{
rust/src/parser/benches/utils/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 // This module is shared by multiple benchmark targets.
5 // There could be false positives for unused code or imports, and fixing them would lead to some other benchmarks failing to compile.
6 #![allow(dead_code)]
rust/src/parser/python/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Thin PyO3 bindings for `vllm_parser::tool`.
5 //!
6 //! This crate exposes the Rust tool parser trait and data shapes to Python
rust/src/parser/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Streaming parsers for chat completions.
5
6 pub mod reasoning;
rust/src/parser/src/reasoning/cohere_cmd.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/deepseek_r1.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/delimited.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::{DynTokenizer, Tokenizer};
5
6 use super::{ReasoningDelta, ReasoningError, Result};
rust/src/parser/src/reasoning/kimi.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/minimax_m3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Streaming reasoning parsers for chat completions.
5 //!
6 //! The key design choice here is that parser initialization prefers the
rust/src/parser/src/reasoning/qwen3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/seed_oss.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/step3p5.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_tokenizer::DynTokenizer;
5
6 use super::{DelimitedReasoningParser, ReasoningDelta, ReasoningParser, Result};
rust/src/parser/src/reasoning/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use vllm_tokenizer::test_utils::TestTokenizer;
rust/src/parser/src/tool/deepseek_dsml/deepseek_v32.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{DeepSeekDsmlToolParser, DsmlTokens};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/deepseek_dsml/deepseek_v4.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{DeepSeekDsmlToolParser, DsmlTokens};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/deepseek_dsml/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::{multispace0 as ws0, multispace1 as ws1};
5 use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated};
6 use winnow::prelude::*;
rust/src/parser/src/tool/deepseek_json/deepseek_v3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{DeepSeekJsonFormat, DeepSeekJsonToolParser};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/deepseek_json/deepseek_v31.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{DeepSeekJsonFormat, DeepSeekJsonToolParser};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/deepseek_json/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod deepseek_v3;
5 mod deepseek_v31;
6
rust/src/parser/src/tool/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error;
5 use thiserror_ext::Macro;
6
rust/src/parser/src/tool/glm_xml/glm45_moe.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{GlmXmlToolParser, Separator};
5 use crate::tool::{Result, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/glm_xml/glm47_moe.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{GlmXmlToolParser, Separator};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/glm_xml/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::multispace0 as ws0;
5 use winnow::combinator::{alt, eof, repeat, seq, terminated};
6 use winnow::prelude::*;
rust/src/parser/src/tool/hy_v3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::multispace0 as ws0;
5 use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated};
6 use winnow::prelude::*;
rust/src/parser/src/tool/json/granite4.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::multispace0 as ws0;
5 use winnow::combinator::{alt, peek, seq};
6 use winnow::error::{ContextError, ErrMode, ModalResult, StrContext};
rust/src/parser/src/tool/json/hermes.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/json/internlm2.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace};
5 use crate::tool::{Result, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/json/llama.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::multispace0 as ws0;
5 use winnow::combinator::seq;
6 use winnow::error::{ModalResult, StrContext};
rust/src/parser/src/tool/json/mistral.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace};
5 use crate::tool::{Result, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/json/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Shared parser core for JSON tool calls wrapped by text markers.
5
6 pub use granite4::Granite4ToolParser;
rust/src/parser/src/tool/json/phi4mini.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace};
5 use crate::tool::{Result, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/json/qwen.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{JsonToolCallConfig, JsonToolCallParser, JsonToolCallWhitespace};
5 use crate::tool::{Result, StructuralTagModel, Tool, ToolParser, ToolParserOutput};
6
rust/src/parser/src/tool/kimi_k2.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use winnow::ascii::{digit1, multispace0 as ws0};
rust/src/parser/src/tool/minimax_m2.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::{multispace0 as ws0, multispace1 as ws1};
5 use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated};
6 use winnow::prelude::*;
rust/src/parser/src/tool/minimax_m3.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::{multispace0 as ws0, multispace1 as ws1};
5 use winnow::combinator::{alt, delimited, seq};
6 use winnow::error::{ContextError, ErrMode};
rust/src/parser/src/tool/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Streaming tool parsers for chat completions.
5
6 #[macro_use]
rust/src/parser/src/tool/parameters.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use serde_json::{Map, Number, Value};
rust/src/parser/src/tool/qwen_coder.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use winnow::ascii::multispace0 as ws0;
5 use winnow::combinator::{alt, delimited, eof, repeat, seq, terminated};
6 use winnow::prelude::*;
rust/src/parser/src/tool/test_utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde_json::json;
5
6 use super::{ToolParser, ToolParserOutput};
rust/src/parser/src/tool/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::{Result, Tool, ToolCallDelta, ToolParser, ToolParserEvent, ToolParserOutput};
5 use crate::tool::ToolParserTestExt as _;
6
rust/src/parser/src/unified/combined.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Adapter that combines reasoning and tool parsers.
5
6 use vllm_tokenizer::DynTokenizer;
rust/src/parser/src/unified/gemma4.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde_json::{Map, Number, Value};
5 use vllm_tokenizer::DynTokenizer;
6 use winnow::ascii::multispace0 as ws0;
rust/src/parser/src/unified/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Unified parser interface for reasoning and tool-call deltas.
5
6 mod combined;
rust/src/parser/src/utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Shared helpers for streaming parsers.
5
6 use winnow::Parser;
rust/src/server/build.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
6 let proto_dir = format!("{manifest_dir}/../../proto");
rust/src/server/examples/external_engine_openai_qwen.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Duration;
5
6 use anyhow::{Context, Result, bail};
rust/src/server/src/config.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::fmt;
6 use std::time::Duration;
rust/src/server/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use axum::Json;
5 use axum::http::StatusCode;
6 use axum::response::{IntoResponse, Response};
rust/src/server/src/grpc/convert.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Conversion between gRPC protobuf types and internal `vllm-text`
5 //! request/response types.
6
rust/src/server/src/grpc/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! gRPC Generate service backed by the shared [`vllm_text::TextLlm`] facade.
5
6 mod convert;
rust/src/server/src/grpc/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::future::Future;
5 use std::io;
6 use std::pin::Pin;
rust/src/server/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Minimal OpenAI-compatible HTTP server above [`vllm_chat`].
5
6 mod config;
rust/src/server/src/listener.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Unified listener wrapper for the Rust frontend.
5 //!
6 //! This module hides the difference between TCP and Unix-domain listeners so
rust/src/server/src/lora.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::atomic::{AtomicU64, Ordering};
5
6 use indexmap::IndexMap;
rust/src/server/src/middleware/auth.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/middleware/cors.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! CORS support mirroring Python's Starlette `CORSMiddleware`.
5 //!
6 //! Built on `tower_http::cors::CorsLayer`, configured to reproduce Starlette's
rust/src/server/src/middleware/load.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::pin::Pin;
5 use std::sync::{Arc, Weak};
6 use std::task::{Context, Poll};
rust/src/server/src/middleware/metrics.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::time::Instant;
5
6 use axum::extract::{MatchedPath, Request};
rust/src/server/src/middleware/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod auth;
5 mod cors;
6 mod load;
rust/src/server/src/middleware/offload.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5 use std::task::{Context, Poll};
6
rust/src/server/src/middleware/request_id.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use axum::extract::Request;
5 use axum::http::HeaderValue;
6 use axum::http::header::HeaderName;
rust/src/server/src/routes.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod abort_requests;
5 mod cache;
6 mod collective_rpc;
rust/src/server/src/routes/abort_requests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/cache.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/collective_rpc.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5 use std::sync::Arc;
6
rust/src/server/src/routes/health.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::extract::State;
rust/src/server/src/routes/http_client_tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Integration tests that exercise the OpenAI-compatible HTTP API through a
5 //! real TCP connection using the `async-openai` client library, backed by a
6 //! mock engine.
rust/src/server/src/routes/inference/generate.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod convert;
5 mod types;
6 mod validate;
rust/src/server/src/routes/inference/generate/convert.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use vllm_text::{Prompt, TextDecodeOptions, TextRequest};
5
6 use super::types::GenerateRequest;
rust/src/server/src/routes/inference/generate/types.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use serde::{Deserialize, Serialize};
rust/src/server/src/routes/inference/generate/validate.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::types::GenerateRequest;
5 use crate::error::{ApiError, bail_invalid_request};
6
rust/src/server/src/routes/inference/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod generate;
5
6 pub use generate::generate;
rust/src/server/src/routes/load.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/lora.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::{Component, Path, PathBuf};
5 use std::sync::Arc;
6
rust/src/server/src/routes/metrics.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use axum::http::header::CONTENT_TYPE;
5 use axum::http::{HeaderValue, StatusCode};
6 use axum::response::{IntoResponse, Response};
rust/src/server/src/routes/openai/chat_completions.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub(crate) mod convert;
5 mod types;
6 mod validate;
rust/src/server/src/routes/openai/chat_completions/convert.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use itertools::Itertools as _;
5 use vllm_chat::{
6 AssistantContentBlock, AssistantToolCall, ChatContent, ChatContentPart,
rust/src/server/src/routes/openai/chat_completions/types.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::fmt;
6
rust/src/server/src/routes/openai/chat_completions/validate.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::types::ChatCompletionRequest;
5 use crate::error::{ApiError, bail_invalid_request};
6 use crate::routes::openai::utils::types::{ChatMessage, Tool};
rust/src/server/src/routes/openai/completions.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod convert;
5 mod types;
6 mod validate;
rust/src/server/src/routes/openai/completions/convert.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror_ext::AsReport as _;
5 use vllm_text::tokenizer::Tokenizer;
6 use vllm_text::{Prompt, SamplingParams, TextDecodeOptions, TextRequest};
rust/src/server/src/routes/openai/completions/types.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use serde::{Deserialize, Serialize};
rust/src/server/src/routes/openai/completions/validate.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::types::CompletionRequest;
5 use crate::error::{ApiError, bail_invalid_request};
6
rust/src/server/src/routes/openai/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod chat_completions;
5 mod completions;
6 mod models;
rust/src/server/src/routes/openai/models.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5 use std::time::{SystemTime, UNIX_EPOCH};
6
rust/src/server/src/routes/openai/utils/logprobs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use itertools::Itertools as _;
rust/src/server/src/routes/openai/utils/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod logprobs;
5 pub mod structured_outputs;
6 pub mod types;
rust/src/server/src/routes/openai/utils/structured_outputs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use serde::{Deserialize, Serialize};
5 use serde_json::Value;
6 use vllm_engine_core_client::protocol::structured_outputs::StructuredOutputsParams;
rust/src/server/src/routes/openai/utils/types.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::slice;
6
rust/src/server/src/routes/openai/utils/usage.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use super::types::Usage;
5
6 /// Tracks cumulative token counts for OpenAI streaming chunks.
rust/src/server/src/routes/openai/utils/validated_json.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Validated JSON extractor for automatic request validation.
5 //! Variation of https://github.com/lightseekorg/smg/blob/main/crates/protocols/src/validated.rs
6
rust/src/server/src/routes/pause.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/profile.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::extract::State;
rust/src/server/src/routes/server_info.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/sleep.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 // Route tests should use `Service::call` rather than `ServiceExt::oneshot`.
5 // `oneshot` consumes the router and can drop `AppState` before a streaming
6 // response body is fully drained, which closes the mock engine connection too
rust/src/server/src/routes/tokenize.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! `POST /tokenize` and `POST /detokenize` (root paths, matching Python).
5 //!
6 //! Encode/decode runs entirely in-process via [`DynTokenizer`]; the inference
rust/src/server/src/routes/tokenize/types.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use itertools::Itertools as _;
rust/src/server/src/routes/version.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/routes/world_size.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use axum::Json;
rust/src/server/src/runtime.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use tokio::runtime::Builder;
5 use tracing::{info, warn};
6 use vllm_engine_core_client::runtime::BackgroundShutdownRuntime;
rust/src/server/src/server_info.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use serde_json::{Value, json};
rust/src/server/src/state.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::atomic::{AtomicU64, Ordering};
5 use std::sync::{Arc, OnceLock};
6
rust/src/server/src/tls.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! OpenSSL server-config construction for TLS termination.
5 //!
6 //! Builds an OpenSSL [`SslContext`] from the uvicorn-style `ssl_*` arguments
rust/src/server/src/tls_tests.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! TLS tests: `build_server_config` unit checks plus end-to-end OpenSSL handshakes
5 //! through the production listener/connection path, with a trivial router since TLS
6 //! terminates below the app.
rust/src/server/src/utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5 use std::time::{SystemTime, UNIX_EPOCH};
6
rust/src/text/src/backend/hf/config.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5 use std::fs;
6 use std::path::Path;
rust/src/text/src/backend/hf/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 mod config;
5 mod model_files;
6
rust/src/text/src/backend/hf/model_files.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::{Path, PathBuf};
5
6 use hf_hub::Cache;
rust/src/text/src/backend/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 pub mod hf;
5
6 use std::sync::Arc;
rust/src/text/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error;
5 use vllm_engine_core_client::Error as EngineCoreError;
6 use vllm_llm::Error as LlmError;
rust/src/text/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Shared text-generation support used by chat and future raw completions.
5 //!
6 //! This crate intentionally stays below chat semantics:
rust/src/text/src/lower.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeSet;
5
6 pub(crate) mod logprobs;
rust/src/text/src/lower/logprobs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Python-compatible validation for logprobs sampling params.
5 //!
6 //! `-1` is expanded only for bounds checks. The original request values are
rust/src/text/src/lower/token_ids.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::result::Result;
5
6 use thiserror::Error;
rust/src/text/src/output/decoded.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use asynk_strim_attr::{TryYielder, try_stream};
rust/src/text/src/output/logprobs.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use itertools::Itertools as _;
5 use serde::{Deserialize, Serialize};
6 use vllm_llm::{Logprobs, PositionLogprobs};
rust/src/text/src/output/mod.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Output processing helpers shared by text and chat layers.
5
6 pub use decoded::{DecodedTextEvent, Finished, TextDecodeOptions, decoded_text_event_stream};
rust/src/text/src/request.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashMap;
5
6 use enum_as_inner::EnumAsInner;
rust/src/tokenizer/benches/hf.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main};
5 use hf_hub::api::tokio::ApiBuilder;
6 use tokio::runtime::Runtime;
rust/src/tokenizer/benches/tiktoken.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use criterion::{Criterion, Throughput, black_box, criterion_group, criterion_main};
5 use hf_hub::api::tokio::ApiBuilder;
6 use tokio::runtime::Runtime;
rust/src/tokenizer/src/byte_level_decode.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 //! Fast GPT-2 byte-level detokenization that writes into a single `Vec<u8>`,
5 //! avoiding the `Vec<String>` / `String::join` assembly in fastokens' generic
6 //! `Decoder::decode` pipeline.
rust/src/tokenizer/src/error.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use thiserror::Error;
5 use thiserror_ext::Macro;
6
rust/src/tokenizer/src/hf.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::Path;
5 use std::sync::Arc;
6
rust/src/tokenizer/src/hf/added_tokens.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::fs;
5 use std::path::Path;
6
rust/src/tokenizer/src/incremental.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::mem::take;
5
6 use crate::{Result, Tokenizer};
rust/src/tokenizer/src/lib.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::sync::Arc;
5
6 use crate::incremental::DecodeStream;
rust/src/tokenizer/src/tekken.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::path::Path;
5
6 use tekken::Tekkenizer;
rust/src/tokenizer/src/test_utils.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::BTreeMap;
5
6 use crate::{Result, Tokenizer, TokenizerError};
rust/src/tokenizer/src/tiktoken.rs
+3
@@ -1,3 +1,6 @@
1 +// SPDX-License-Identifier: Apache-2.0
2 +// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 +
4 use std::collections::HashSet;
5 use std::path::Path;
6 use std::sync::Mutex;
tools/pre_commit/check_spdx_header.py
+59 -29
@@ -2,7 +2,17 @@
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 import sys
5 +from dataclasses import dataclass
6 from enum import Enum
7 +from pathlib import Path
8 +
9 +
10 +@dataclass(frozen=True)
11 +class HeaderStyle:
12 + """Comment syntax and preamble handling for an SPDX header."""
13 +
14 + comment_prefix: str
15 + preserve_shebang: bool = False
16
17
18 class SPDXStatus(Enum):
@@ -15,37 +25,56 @@ class SPDXStatus(Enum):
25 MISSING_BOTH = "missing_both" # Completely missing
26
27
18 -FULL_SPDX_HEADER = (
19 - "# SPDX-License-Identifier: Apache-2.0\n"
20 - "# SPDX-FileCopyrightText: Copyright contributors to the vLLM project"
21 -)
28 +LICENSE_TEXT = "SPDX-License-Identifier: Apache-2.0"
29 +COPYRIGHT_TEXT = "SPDX-FileCopyrightText: Copyright contributors to the vLLM project"
30 +FILE_STYLES = {
31 + ".py": HeaderStyle("#", preserve_shebang=True),
32 + ".rs": HeaderStyle("//"),
33 + ".proto": HeaderStyle("//"),
34 +}
35 +
36 +
37 +def file_style(file_path):
38 + """Return the declared header style for a file."""
39 + suffix = Path(file_path).suffix
40 + try:
41 + return FILE_STYLES[suffix]
42 + except KeyError:
43 + raise ValueError(f"Unsupported file type: {file_path}") from None
44 +
45
23 -LICENSE_LINE = "# SPDX-License-Identifier: Apache-2.0"
24 -COPYRIGHT_LINE = "# SPDX-FileCopyrightText: Copyright contributors to the vLLM project" # noqa: E501
46 +def spdx_header(style):
47 + """Return the SPDX header for a file style."""
48 + license_line = f"{style.comment_prefix} {LICENSE_TEXT}"
49 + copyright_line = f"{style.comment_prefix} {COPYRIGHT_TEXT}"
50 + return license_line, copyright_line
51 +
52 +
53 +def header_insertion_index(style, lines):
54 + """Return the line index where a missing header should be inserted."""
55 + if style.preserve_shebang and lines and lines[0].startswith("#!"):
56 + return 1
57 + return 0
58
59
60 def check_spdx_header_status(file_path):
61 """Check SPDX header status of the file"""
62 + license_line, copyright_line = spdx_header(file_style(file_path))
63 with open(file_path, encoding="UTF-8") as file:
64 lines = file.readlines()
65 if not lines:
66 # Empty file
67 return SPDXStatus.EMPTY
68
35 - # Skip shebang line
36 - start_idx = 0
37 - if lines and lines[0].startswith("#!"):
38 - start_idx = 1
39 -
69 has_license = False
70 has_copyright = False
71
72 # Check all lines for SPDX headers (not just the first two)
44 - for i in range(start_idx, len(lines)):
45 - line = lines[i].strip()
46 - if line == LICENSE_LINE:
73 + for raw_line in lines:
74 + line = raw_line.strip()
75 + if line == license_line:
76 has_license = True
48 - elif line == COPYRIGHT_LINE:
77 + elif line == copyright_line:
78 has_copyright = True
79
80 # Determine status based on what we found
@@ -54,8 +83,8 @@ def check_spdx_header_status(file_path):
83 elif has_license and not has_copyright:
84 # Only has license line
85 return SPDXStatus.MISSING_COPYRIGHT
57 - # Only has copyright line
86 elif not has_license and has_copyright:
87 + # Only has copyright line
88 return SPDXStatus.MISSING_LICENSE
89 else:
90 # Completely missing both lines
@@ -64,6 +93,9 @@ def check_spdx_header_status(file_path):
93
94 def add_header(file_path, status):
95 """Add or supplement SPDX header based on status"""
96 + style = file_style(file_path)
97 + license_line, copyright_line = spdx_header(style)
98 + full_spdx_header = f"{license_line}\n{copyright_line}"
99 with open(file_path, "r+", encoding="UTF-8") as file:
100 lines = file.readlines()
101 file.seek(0, 0)
@@ -71,25 +103,23 @@ def add_header(file_path, status):
103
104 if status == SPDXStatus.MISSING_BOTH:
105 # Completely missing, add complete header
74 - if lines and lines[0].startswith("#!"):
75 - # Preserve shebang line
76 - file.write(lines[0])
77 - file.write(FULL_SPDX_HEADER + "\n")
78 - file.writelines(lines[1:])
79 - else:
80 - # Add header directly
81 - file.write(FULL_SPDX_HEADER + "\n")
82 - file.writelines(lines)
106 + insertion_index = header_insertion_index(style, lines)
107 + file.writelines(lines[:insertion_index])
108 + file.write(full_spdx_header + "\n")
109 + remaining_lines = lines[insertion_index:]
110 + if remaining_lines and remaining_lines[0].strip():
111 + file.write("\n")
112 + file.writelines(remaining_lines)
113
114 elif status == SPDXStatus.MISSING_COPYRIGHT:
115 # Only has license line, need to add copyright line
116 # Find the license line and add copyright line after it
117 for i, line in enumerate(lines):
88 - if line.strip() == LICENSE_LINE:
118 + if line.strip() == license_line:
119 # Insert copyright line after license line
120 lines.insert(
121 i + 1,
92 - f"{COPYRIGHT_LINE}\n",
122 + f"{copyright_line}\n",
123 )
124 break
125
@@ -99,9 +129,9 @@ def add_header(file_path, status):
129 # Only has copyright line, need to add license line
130 # Find the copyright line and add license line before it
131 for i, line in enumerate(lines):
102 - if line.strip() == COPYRIGHT_LINE:
132 + if line.strip() == copyright_line:
133 # Insert license line before copyright line
104 - lines.insert(i, f"{LICENSE_LINE}\n")
134 + lines.insert(i, f"{license_line}\n")
135 break
136 file.writelines(lines)
137