A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 7, 17:45 UTC
[Model Runner V2] Add coding style guide (#35325)
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai>
Woosuk Kwon committed
Feb 25, 2026 at 20:42 UTC
13025e71e888330aa3277948120051ebbc2674c7
1 file changed
+17
vllm/v1/worker/gpu/model_runner.py
+17
@@ -1,5 +1,22 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+"""
4
+NOTE: Coding style guide for this file:
5
+This model runner is shared by all models: text and multimodal, generative
6
+and embedding, public and private. As a result, this file must only contain
7
+code that is common to every model. Model-specific behavior belongs in the
8
+appropriate model-specific files.
9
+
10
+In other words:
11
+* Be paranoid about changing this file. It should remain stable.
12
+* Be even more paranoid about adding new lines. It should remain minimal.
13
+
14
+Even for shared features (for example, different parallelism modes), keep the
15
+complexity out of this path. The less common the feature, the more it should be
16
+hidden. Prefer utility functions defined elsewhere and call them from here,
17
+instead of embedding feature-specific logic directly.
18
+"""
19
+
20
import functools
21
import gc
22
import time