vllm.model_executor.models.colqwen3 ¶
ColQwen3 late interaction model for multi-modal retrieval and reranking.
ColQwen3 extends Qwen3-VL with a ColBERT-style late interaction head, producing per-token embeddings for both text and image inputs. It uses MaxSim scoring for retrieval/reranking tasks.
This model supports the "token_embed" pooling task and is designed for multi-vector retrieval of documents containing both text and images.
Reference: https://arxiv.org/abs/2407.01449 (ColPali) Based on: Qwen3-VL backbone with custom text projection
Target models: - TomoroAI/tomoro-colqwen3-embed-8b - OpenSearch-AI/Ops-Colqwen3-4B
ColQwen3Model ¶
Bases: Qwen3VLForConditionalGeneration
ColQwen3 late interaction model for multi-modal retrieval/reranking.
This model extends Qwen3VLForConditionalGeneration with a ColBERT-style linear projection layer for per-token embeddings. It supports: - "token_embed" task: Per-token embeddings for late interaction scoring
The model produces L2-normalized per-token embeddings by: 1. Running the Qwen3-VL backbone (vision + language) to get hidden states 2. Projecting hidden states through a linear layer (hidden_size -> embed_dim) 3. L2-normalizing the projected embeddings
ColBERT-style MaxSim scoring is computed externally, either client-side or via the late interaction scoring path in ServingScores.
Attributes:
| Name | Type | Description |
|---|---|---|
custom_text_proj | Linear projection from hidden_size to embed_dim | |
supports_late_interaction | Literal[True] | Flag indicating this model uses late interaction scoring |
Source code in vllm/model_executor/models/colqwen3.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
_is_proj_weight ¶
forward ¶
forward(
input_ids: Tensor | None,
positions: Tensor,
intermediate_tensors=None,
inputs_embeds: Tensor | None = None,
**kwargs: object,
) -> Tensor
Run forward pass producing per-token embeddings.
Source code in vllm/model_executor/models/colqwen3.py
load_weights ¶
Load weights with special handling for ColQwen3 projection layer.
Source code in vllm/model_executor/models/colqwen3.py
ColQwen3ProcessingInfo ¶
Bases: Qwen3VLProcessingInfo
Processing info for ColQwen3 models.
ColQwen3 models (TomoroAI, OpenSearch-AI, etc.) use custom HuggingFace configs (e.g. ColQwen3Config, OpsColQwen3Config) that are not instances of Qwen3VLConfig. We override get_hf_config() and get_hf_processor() to skip the strict type check, similar to OpenCUAProcessingInfo.