[new model] add COLQwen3 code & Inference (#34398)

Signed-off-by: craftsangjae <craftsangjae@gmail.com>
Signed-off-by: katacoder <craftsangjae@gmail.com>
This commit is contained in:
Kata Coder
2026-02-14 12:15:19 +08:00
committed by GitHub
parent de42abb366
commit d1ea65d0a1
10 changed files with 935 additions and 0 deletions
+2
View File
@@ -74,6 +74,8 @@ _CONFIG_REGISTRY: dict[str, type[PretrainedConfig]] = LazyConfigDict(
afmoe="AfmoeConfig",
bagel="BagelConfig",
chatglm="ChatGLMConfig",
colqwen3="ColQwen3Config",
ops_colqwen3="OpsColQwen3Config",
deepseek_vl_v2="DeepseekVLV2Config",
deepseek_v32="DeepseekV3Config",
flex_olmo="FlexOlmoConfig",
@@ -18,6 +18,9 @@ _CLASS_TO_MODULE: dict[str, str] = {
"AfmoeConfig": "vllm.transformers_utils.configs.afmoe",
"BagelConfig": "vllm.transformers_utils.configs.bagel",
"ChatGLMConfig": "vllm.transformers_utils.configs.chatglm",
"ColQwen3Config": "vllm.transformers_utils.configs.colqwen3",
"OpsColQwen3Config": "vllm.transformers_utils.configs.colqwen3",
"Qwen3VLNemotronEmbedConfig": "vllm.transformers_utils.configs.colqwen3",
"DeepseekVLV2Config": "vllm.transformers_utils.configs.deepseek_vl2",
"DotsOCRConfig": "vllm.transformers_utils.configs.dotsocr",
"EAGLEConfig": "vllm.transformers_utils.configs.eagle",
@@ -68,6 +71,9 @@ __all__ = [
"AfmoeConfig",
"BagelConfig",
"ChatGLMConfig",
"ColQwen3Config",
"OpsColQwen3Config",
"Qwen3VLNemotronEmbedConfig",
"DeepseekVLV2Config",
"DeepseekV3Config",
"DotsOCRConfig",
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""
ColQwen3 configuration that extends Qwen3VLConfig with embedding projection
fields. This allows ColQwen3 models to be loaded without trust_remote_code
by mapping their custom model_type (colqwen3, ops_colqwen3, etc.) to a
standard config class that vLLM understands.
Supported model_types:
- colqwen3 (TomoroAI/tomoro-colqwen3-embed-8b)
- ops_colqwen3 (OpenSearch-AI/Ops-Colqwen3-4B)
- qwen3_vl_nemotron_embed (nvidia/nemotron-colembed-vl-8b-v2)
"""
from transformers.models.qwen3_vl.configuration_qwen3_vl import Qwen3VLConfig
class ColQwen3Config(Qwen3VLConfig):
"""Configuration class for ColQwen3 models.
Extends Qwen3VLConfig with additional fields used by ColQwen3 variants
for the embedding projection layer.
"""
# Accept any ColQwen3 variant model_type
model_type = "colqwen3"
def __init__(
self,
embed_dim: int | None = None,
dims: int | None = None,
dim: int | None = None,
projection_dim: int | None = None,
colbert_dim: int | None = None,
pooling: str | None = None,
**kwargs,
):
# Store embedding projection config fields
self.embed_dim = embed_dim
self.dims = dims
self.dim = dim
self.projection_dim = projection_dim
self.colbert_dim = colbert_dim
self.pooling = pooling
super().__init__(**kwargs)
class OpsColQwen3Config(ColQwen3Config):
"""Configuration for OpenSearch-AI ColQwen3 variants."""
model_type = "ops_colqwen3"
class Qwen3VLNemotronEmbedConfig(ColQwen3Config):
"""Configuration for NVIDIA Nemotron ColEmbed variants."""
model_type = "qwen3_vl_nemotron_embed"