From 13025e71e888330aa3277948120051ebbc2674c7 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Wed, 25 Feb 2026 20:42:40 -0800 Subject: [PATCH] [Model Runner V2] Add coding style guide (#35325) Signed-off-by: Woosuk Kwon --- vllm/v1/worker/gpu/model_runner.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vllm/v1/worker/gpu/model_runner.py b/vllm/v1/worker/gpu/model_runner.py index ccab6cec8c..9e0cae6fee 100644 --- a/vllm/v1/worker/gpu/model_runner.py +++ b/vllm/v1/worker/gpu/model_runner.py @@ -1,5 +1,22 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +""" +NOTE: Coding style guide for this file: +This model runner is shared by all models: text and multimodal, generative +and embedding, public and private. As a result, this file must only contain +code that is common to every model. Model-specific behavior belongs in the +appropriate model-specific files. + +In other words: +* Be paranoid about changing this file. It should remain stable. +* Be even more paranoid about adding new lines. It should remain minimal. + +Even for shared features (for example, different parallelism modes), keep the +complexity out of this path. The less common the feature, the more it should be +hidden. Prefer utility functions defined elsewhere and call them from here, +instead of embedding feature-specific logic directly. +""" + import functools import gc import time