跳到内容

支持的模型

vLLM 支持跨多种任务的生成式池化模型。

对于每项任务,我们列出了 vLLM 中已实现的模型架构。在每种架构旁边,我们还包含了一些使用该架构的流行模型。

模型实现

vLLM

如果 vLLM 原生支持某个模型,其实现可以在 vllm/model_executor/models 中找到。

这些模型是我们列在支持的文本模型支持的多模态模型中的模型。

Transformers

vLLM 还支持 Transformers 中提供的模型实现。您应该期望在 vLLM 中使用的 Transformers 模型实现的性能与 vLLM 原生模型实现的性能相差不超过 5%。我们将此功能称为“Transformers 模型后端”。

目前,Transformers 模型后端适用于以下

  • 模态:嵌入模型、语言模型和视觉语言模型*
  • 架构:编码器-Only、解码器-Only、混合专家 (Mixture-of-Experts)
  • 注意力类型:全注意力及/或滑动注意力

*视觉语言模型目前仅接受图像输入。视频输入的更多支持将在未来的版本中添加。

如果 Transformers 模型实现遵循编写自定义模型中的所有步骤,那么在使用 Transformers 模型后端时,它将与 vLLM 的以下功能兼容

  • 兼容性矩阵中列出的所有功能
  • 以下 vLLM 并行化方案的任何组合
    • 数据并行
    • 张量并行
    • 专家并行
    • 管道并行

检查模型后端是否为 Transformers 非常简单

from vllm import LLM
llm = LLM(model=...)  # Name or path of your model
llm.apply_model(lambda model: print(type(model)))

如果打印的类型以 Transformers... 开头,则表示它正在使用 Transformers 模型实现!

如果模型具有 vLLM 实现,但您更愿意通过 Transformers 模型后端使用 Transformers 实现,请在离线推理中设置为 model_impl="transformers",或在在线服务中设置为 --model-impl transformers

注意

对于视觉语言模型,如果您使用 dtype="auto" 加载,vLLM 会用配置文件的 dtype 加载整个模型(如果存在)。相比之下,原生 Transformers 将尊重模型中每个骨干网络的 dtype 属性。这可能会导致性能上的一些细微差异。

自定义模型

如果一个模型既不被 vLLM 原生支持,也不被 Transformers 支持,它仍然可以在 vLLM 中使用!

要使模型与 vLLM 的 Transformers 模型后端兼容,它必须

  • 是一个 Transformers 兼容的自定义模型(参见Transformers - 自定义模型
    • 模型目录必须具有正确的结构(例如,存在 config.json)。
    • config.json 必须包含 auto_map.AutoModel
  • 是一个 vLLM 兼容的 Transformers 模型后端模型(参见编写自定义模型
    • 定制应在基础模型中进行(例如,在 MyModel 中,而不是 MyModelForCausalLM)。

如果兼容模型是

这意味着,通过 vLLM 的 Transformers 模型后端,新模型可以在它们正式在 Transformers 或 vLLM 中支持之前就被使用!

编写自定义模型

本节详细介绍了使 Transformers 兼容的自定义模型能够与 vLLM 的 Transformers 模型后端兼容所需的修改。(我们假设一个 Transformers 兼容的自定义模型已经创建,请参见Transformers - 自定义模型)。

为了使您的模型与 Transformers 模型后端兼容,它需要

  1. kwargs 通过所有模块从 MyModel 传递到 MyAttention
    • 如果您的模型是编码器-Only
      1. MyAttention 添加 is_causal = False
    • 如果您的模型是混合专家(MoE)
      1. 您的稀疏 MoE 块必须有一个名为 experts 的属性。
      2. experts 的类(MyExperts)必须
        • 继承自 nn.ModuleList(朴素)。
        • 或者包含所有 3D nn.Parameters(打包)。
      3. MyExperts.forward 必须接受 hidden_statestop_k_indextop_k_weights
  2. MyAttention 必须使用 ALL_ATTENTION_FUNCTIONS 来调用注意力。
  3. MyModel 必须包含 _supports_attention_backend = True
modeling_my_model.py
from transformers import PreTrainedModel
from torch import nn

class MyAttention(nn.Module):
    is_causal = False  # Only do this for encoder-only models

    def forward(self, hidden_states, **kwargs):
        ...
        attention_interface = ALL_ATTENTION_FUNCTIONS[self.config._attn_implementation]
        attn_output, attn_weights = attention_interface(
            self,
            query_states,
            key_states,
            value_states,
            **kwargs,
        )
        ...

# Only do this for mixture-of-experts models
class MyExperts(nn.ModuleList):
    def forward(self, hidden_states, top_k_index, top_k_weights):
        ...

# Only do this for mixture-of-experts models
class MySparseMoEBlock(nn.Module):
    def __init__(self, config):
        ...
        self.experts = MyExperts(config)
        ...

    def forward(self, hidden_states: torch.Tensor):
        ...
        hidden_states = self.experts(hidden_states, top_k_index, top_k_weights)
        ...

class MyModel(PreTrainedModel):
    _supports_attention_backend = True

在加载此模型时,后台会发生以下情况

  1. 加载配置。
  2. 从配置中的 auto_map 加载 MyModel Python 类,并检查模型 is_backend_compatible()
  3. MyModel 加载到 Transformers 模型后端类之一,它会设置 self.config._attn_implementation = "vllm",以便使用 vLLM 的注意力层。

搞定!

为了使您的模型与 vLLM 的张量并行及/或管道并行功能兼容,您必须在模型的配置类中添加 base_model_tp_plan 和/或 base_model_pp_plan

configuration_my_model.py
from transformers import PretrainedConfig

class MyConfig(PretrainedConfig):
    base_model_tp_plan = {
        "layers.*.self_attn.k_proj": "colwise",
        "layers.*.self_attn.v_proj": "colwise",
        "layers.*.self_attn.o_proj": "rowwise",
        "layers.*.mlp.gate_proj": "colwise",
        "layers.*.mlp.up_proj": "colwise",
        "layers.*.mlp.down_proj": "rowwise",
    }
    base_model_pp_plan = {
        "embed_tokens": (["input_ids"], ["inputs_embeds"]),
        "layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
        "norm": (["hidden_states"], ["hidden_states"]),
    }
  • base_model_tp_plan 是一个 dict,它将完全限定的层名模式映射到张量并行样式(目前只支持 "colwise""rowwise")。
  • base_model_pp_plan 是一个 dict,它将直接子层名映射到 tuplelists of strs。
    • 您只需要对不在所有管道阶段的层执行此操作。
    • vLLM 假定只有一个 nn.ModuleList,它分布在各个管道阶段。
    • tuple 第一个元素中的 list 包含输入参数的名称。
    • tuple 最后一个元素中的 list 包含层在您的建模代码中输出的变量名称。

加载模型

Hugging Face Hub

默认情况下,vLLM 从Hugging Face (HF) Hub 加载模型。要更改模型的下载路径,您可以设置 HF_HOME 环境变量;有关更多详细信息,请参阅他们的官方文档

要确定给定模型是否受原生支持,您可以检查 HF 存储库中的 config.json 文件。如果 "architectures" 字段包含下面列出的模型架构,那么它应该受到原生支持。

模型不一定需要受原生支持才能在 vLLM 中使用。Transformers 模型后端使您能够直接使用其 Transformers 实现(甚至可以直接使用 Hugging Face Model Hub 上的远程代码!)来运行模型。

提示

在运行时检查您的模型是否真正受支持的最简单方法是运行下面的程序

from vllm import LLM

# For generative models (runner=generate) only
llm = LLM(model=..., runner="generate")  # Name or path of your model
output = llm.generate("Hello, my name is")
print(output)

# For pooling models (runner=pooling) only
llm = LLM(model=..., runner="pooling")  # Name or path of your model
output = llm.encode("Hello, my name is")
print(output)

如果 vLLM 成功返回文本(对于生成式模型)或隐藏状态(对于池化模型),则表示您的模型受支持。

否则,请参阅添加新模型以获取有关如何在 vLLM 中实现您的模型的说明。或者,您可以在 GitHub 上创建一个 issue 来请求 vLLM 支持。

下载模型

如果您愿意,可以使用 Hugging Face CLI 来下载模型或模型存储库中的特定文件。

# Download a model
huggingface-cli download HuggingFaceH4/zephyr-7b-beta

# Specify a custom cache directory
huggingface-cli download HuggingFaceH4/zephyr-7b-beta --cache-dir ./path/to/cache

# Download a specific file from a model repo
huggingface-cli download HuggingFaceH4/zephyr-7b-beta eval_results.json

列出已下载的模型

使用 Hugging Face CLI 来管理存储在本地缓存中的模型

# List cached models
huggingface-cli scan-cache

# Show detailed (verbose) output
huggingface-cli scan-cache -v

# Specify a custom cache directory
huggingface-cli scan-cache --dir ~/.cache/huggingface/hub

删除缓存的模型

使用 Hugging Face CLI 来交互式地从缓存中删除已下载的模型

命令
# The `delete-cache` command requires extra dependencies to work with the TUI.
# Please run `pip install huggingface_hub[cli]` to install them.

# Launch the interactive TUI to select models to delete
$ huggingface-cli delete-cache
? Select revisions to delete: 1 revisions selected counting for 438.9M.
  ○ None of the following (if selected, nothing will be deleted).
Model BAAI/bge-base-en-v1.5 (438.9M, used 1 week ago)
❯ ◉ a5beb1e3: main # modified 1 week ago

Model BAAI/bge-large-en-v1.5 (1.3G, used 1 week ago)
  ○ d4aa6901: main # modified 1 week ago

Model BAAI/bge-reranker-base (1.1G, used 4 weeks ago)
  ○ 2cfc18c9: main # modified 4 weeks ago

Press <space> to select, <enter> to validate and <ctrl+c> to quit without modification.

# Need to confirm after selected
? Select revisions to delete: 1 revision(s) selected.
? 1 revisions selected counting for 438.9M. Confirm deletion ? Yes
Start deletion.
Done. Deleted 1 repo(s) and 0 revision(s) for a total of 438.9M.

使用代理

以下是一些使用代理从 Hugging Face 加载/下载模型的技巧。

  • 为您的会话全局设置代理(或在配置文件中设置)
export http_proxy=http://your.proxy.server:port
export https_proxy=http://your.proxy.server:port
  • 仅为当前命令设置代理
https_proxy=http://your.proxy.server:port huggingface-cli download <model_name>

# or use vllm cmd directly
https_proxy=http://your.proxy.server:port  vllm serve <model_name>
  • 在 Python 解释器中设置代理
import os

os.environ["http_proxy"] = "http://your.proxy.server:port"
os.environ["https_proxy"] = "http://your.proxy.server:port"

ModelScope

要使用ModelScope而不是 Hugging Face Hub 中的模型,请设置一个环境变量。

export VLLM_USE_MODELSCOPE=True

并与 trust_remote_code=True 一起使用。

from vllm import LLM

llm = LLM(model=..., revision=..., runner=..., trust_remote_code=True)

# For generative models (runner=generate) only
output = llm.generate("Hello, my name is")
print(output)

# For pooling models (runner=pooling) only
output = llm.encode("Hello, my name is")
print(output)

功能状态图例

  • ✅︎ 表示该功能对模型可用。

  • 🚧 表示该功能已计划但尚未对模型可用。

  • ⚠️ 表示该功能可用,但可能存在已知问题或限制。

纯文本语言模型列表

生成式模型

有关如何使用生成式模型的更多信息,请参阅此页面

文本生成

这些模型主要支持 LLM.generate API。聊天/指令模型还额外支持 LLM.chat API。

架构 模型 示例 HF 模型 LoRA PP
AfmoeForCausalLM Afmoe TBA ✅︎ ✅︎
ApertusForCausalLM Apertus swiss-ai/Apertus-8B-2509, swiss-ai/Apertus-70B-Instruct-2509, etc. ✅︎ ✅︎
AquilaForCausalLM Aquila, Aquila2 BAAI/Aquila-7B, BAAI/AquilaChat-7B, etc. ✅︎ ✅︎
ArceeForCausalLM Arcee (AFM) arcee-ai/AFM-4.5B-Base, etc. ✅︎ ✅︎
ArcticForCausalLM Arctic Snowflake/snowflake-arctic-base, Snowflake/snowflake-arctic-instruct, etc. ✅︎
BaiChuanForCausalLM Baichuan2, Baichuan baichuan-inc/Baichuan2-13B-Chat, baichuan-inc/Baichuan-7B, etc. ✅︎ ✅︎
BailingMoeForCausalLM Ling inclusionAI/Ling-lite-1.5, inclusionAI/Ling-plus, etc. ✅︎ ✅︎
BailingMoeV2ForCausalLM Ling inclusionAI/Ling-mini-2.0, etc. ✅︎ ✅︎
BambaForCausalLM Bamba ibm-ai-platform/Bamba-9B-fp8, ibm-ai-platform/Bamba-9B ✅︎ ✅︎
BloomForCausalLM BLOOM, BLOOMZ, BLOOMChat bigscience/bloom, bigscience/bloomz, etc. ✅︎
ChatGLMModel, ChatGLMForConditionalGeneration ChatGLM zai-org/chatglm2-6b, zai-org/chatglm3-6b, ShieldLM-6B-chatglm3, etc. ✅︎ ✅︎
CohereForCausalLM, Cohere2ForCausalLM Command-R, Command-A CohereLabs/c4ai-command-r-v01, CohereLabs/c4ai-command-r7b-12-2024, CohereLabs/c4ai-command-a-03-2025, CohereLabs/command-a-reasoning-08-2025, etc. ✅︎ ✅︎
DbrxForCausalLM DBRX databricks/dbrx-base, databricks/dbrx-instruct, etc. ✅︎
DeciLMForCausalLM DeciLM nvidia/Llama-3_3-Nemotron-Super-49B-v1, etc. ✅︎ ✅︎
DeepseekForCausalLM DeepSeek deepseek-ai/deepseek-llm-67b-base, deepseek-ai/deepseek-llm-7b-chat, etc. ✅︎ ✅︎
DeepseekV2ForCausalLM DeepSeek-V2 deepseek-ai/DeepSeek-V2, deepseek-ai/DeepSeek-V2-Chat, etc. ✅︎ ✅︎
DeepseekV3ForCausalLM DeepSeek-V3 deepseek-ai/DeepSeek-V3, deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3.1, etc. ✅︎ ✅︎
Dots1ForCausalLM dots.llm1 rednote-hilab/dots.llm1.base, rednote-hilab/dots.llm1.inst, etc. ✅︎
DotsOCRForCausalLM dots_ocr rednote-hilab/dots.ocr ✅︎
Ernie4_5ForCausalLM Ernie4.5 baidu/ERNIE-4.5-0.3B-PT, etc. ✅︎ ✅︎
Ernie4_5_MoeForCausalLM Ernie4.5MoE baidu/ERNIE-4.5-21B-A3B-PT, baidu/ERNIE-4.5-300B-A47B-PT, etc. ✅︎ ✅︎
ExaoneForCausalLM EXAONE-3 LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct, etc. ✅︎ ✅︎
Exaone4ForCausalLM EXAONE-4 LGAI-EXAONE/EXAONE-4.0-32B, etc. ✅︎ ✅︎
Fairseq2LlamaForCausalLM Llama (fairseq2 format) mgleize/fairseq2-dummy-Llama-3.2-1B, etc. ✅︎ ✅︎
FalconForCausalLM Falcon tiiuae/falcon-7b, tiiuae/falcon-40b, tiiuae/falcon-rw-7b, etc. ✅︎
FalconMambaForCausalLM FalconMamba tiiuae/falcon-mamba-7b, tiiuae/falcon-mamba-7b-instruct, etc. ✅︎
FalconH1ForCausalLM Falcon-H1 tiiuae/Falcon-H1-34B-Base, tiiuae/Falcon-H1-34B-Instruct, etc. ✅︎ ✅︎
FlexOlmoForCausalLM FlexOlmo allenai/FlexOlmo-7x7B-1T, allenai/FlexOlmo-7x7B-1T-RT, etc. ✅︎
GemmaForCausalLM Gemma google/gemma-2b, google/gemma-1.1-2b-it, etc. ✅︎ ✅︎
Gemma2ForCausalLM Gemma 2 google/gemma-2-9b, google/gemma-2-27b, etc. ✅︎ ✅︎
Gemma3ForCausalLM Gemma 3 google/gemma-3-1b-it, etc. ✅︎ ✅︎
Gemma3nForCausalLM Gemma 3n google/gemma-3n-E2B-it, google/gemma-3n-E4B-it, etc.
GlmForCausalLM GLM-4 zai-org/glm-4-9b-chat-hf, etc. ✅︎ ✅︎
Glm4ForCausalLM GLM-4-0414 zai-org/GLM-4-32B-0414, etc. ✅︎ ✅︎
Glm4MoeForCausalLM GLM-4.5, GLM-4.6, GLM-4.7 zai-org/GLM-4.5, etc. ✅︎ ✅︎
GPT2LMHeadModel GPT-2 gpt2, gpt2-xl, etc. ✅︎
GPTBigCodeForCausalLM StarCoder, SantaCoder, WizardCoder bigcode/starcoder, bigcode/gpt_bigcode-santacoder, WizardLM/WizardCoder-15B-V1.0, etc. ✅︎ ✅︎
GPTJForCausalLM GPT-J EleutherAI/gpt-j-6b, nomic-ai/gpt4all-j, etc. ✅︎
GPTNeoXForCausalLM GPT-NeoX, Pythia, OpenAssistant, Dolly V2, StableLM EleutherAI/gpt-neox-20b, EleutherAI/pythia-12b, OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5, databricks/dolly-v2-12b, stabilityai/stablelm-tuned-alpha-7b, etc. ✅︎
GptOssForCausalLM GPT-OSS openai/gpt-oss-120b, openai/gpt-oss-20b ✅︎
GraniteForCausalLM Granite 3.0, Granite 3.1, PowerLM ibm-granite/granite-3.0-2b-base, ibm-granite/granite-3.1-8b-instruct, ibm/PowerLM-3b, etc. ✅︎ ✅︎
GraniteMoeForCausalLM Granite 3.0 MoE, PowerMoE ibm-granite/granite-3.0-1b-a400m-base, ibm-granite/granite-3.0-3b-a800m-instruct, ibm/PowerMoE-3b, etc. ✅︎ ✅︎
GraniteMoeHybridForCausalLM Granite 4.0 MoE Hybrid ibm-granite/granite-4.0-tiny-preview, etc. ✅︎ ✅︎
GraniteMoeSharedForCausalLM Granite MoE Shared ibm-research/moe-7b-1b-active-shared-experts (test model) ✅︎ ✅︎
GritLM GritLM parasail-ai/GritLM-7B-vllm. ✅︎ ✅︎
Grok1ModelForCausalLM Grok1 hpcai-tech/grok-1. ✅︎ ✅︎
HunYuanDenseV1ForCausalLM Hunyuan Dense tencent/Hunyuan-7B-Instruct ✅︎ ✅︎
HunYuanMoEV1ForCausalLM Hunyuan-A13B tencent/Hunyuan-A13B-Instruct, tencent/Hunyuan-A13B-Pretrain, tencent/Hunyuan-A13B-Instruct-FP8, etc. ✅︎ ✅︎
HCXVisionForCausalLM HyperCLOVAX-SEED-Vision-Instruct-3B naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B
InternLMForCausalLM InternLM internlm/internlm-7b, internlm/internlm-chat-7b, etc. ✅︎ ✅︎
InternLM2ForCausalLM InternLM2 internlm/internlm2-7b, internlm/internlm2-chat-7b, etc. ✅︎ ✅︎
InternLM3ForCausalLM InternLM3 internlm/internlm3-8b-instruct, etc. ✅︎ ✅︎
JAISLMHeadModel Jais inceptionai/jais-13b, inceptionai/jais-13b-chat, inceptionai/jais-30b-v3, inceptionai/jais-30b-chat-v3, etc. ✅︎
Jais2ForCausalLM Jais2 inceptionai/Jais-2-8B-Chat, inceptionai/Jais-2-70B-Chat, etc. ✅︎
JambaForCausalLM Jamba ai21labs/AI21-Jamba-1.5-Large, ai21labs/AI21-Jamba-1.5-Mini, ai21labs/Jamba-v0.1, etc. ✅︎ ✅︎
KimiLinearForCausalLM Kimi-Linear-48B-A3B-Base, Kimi-Linear-48B-A3B-Instruct moonshotai/Kimi-Linear-48B-A3B-Base, moonshotai/Kimi-Linear-48B-A3B-Instruct ✅︎
Lfm2ForCausalLM LFM2 LiquidAI/LFM2-1.2B, LiquidAI/LFM2-700M, LiquidAI/LFM2-350M, etc. ✅︎ ✅︎
Lfm2MoeForCausalLM LFM2MoE LiquidAI/LFM2-8B-A1B-preview, etc. ✅︎ ✅︎
LlamaForCausalLM Llama 3.1, Llama 3, Llama 2, LLaMA, Yi meta-llama/Meta-Llama-3.1-405B-Instruct, meta-llama/Meta-Llama-3.1-70B, meta-llama/Meta-Llama-3-70B-Instruct, meta-llama/Llama-2-70b-hf, 01-ai/Yi-34B, etc. ✅︎ ✅︎
MambaForCausalLM Mamba state-spaces/mamba-130m-hf, state-spaces/mamba-790m-hf, state-spaces/mamba-2.8b-hf, etc. ✅︎
Mamba2ForCausalLM Mamba2 mistralai/Mamba-Codestral-7B-v0.1, etc. ✅︎
MiMoForCausalLM MiMo XiaomiMiMo/MiMo-7B-RL, etc. ✅︎ ✅︎
MiMoV2FlashForCausalLM MiMoV2Flash XiaomiMiMo/MiMo-V2-Flash, etc. ✅︎
MiniCPMForCausalLM MiniCPM openbmb/MiniCPM-2B-sft-bf16, openbmb/MiniCPM-2B-dpo-bf16, openbmb/MiniCPM-S-1B-sft, etc. ✅︎ ✅︎
MiniCPM3ForCausalLM MiniCPM3 openbmb/MiniCPM3-4B, etc. ✅︎ ✅︎
MiniMaxM2ForCausalLM MiniMax-M2 MiniMaxAI/MiniMax-M2, etc. ✅︎
MistralForCausalLM Ministral-3, Mistral, Mistral-Instruct mistralai/Ministral-3-3B-Instruct-2512, mistralai/Mistral-7B-v0.1, mistralai/Mistral-7B-Instruct-v0.1, etc. ✅︎ ✅︎
MistralLarge3ForCausalLM Mistral-Large-3-675B-Base-2512, Mistral-Large-3-675B-Instruct-2512 mistralai/Mistral-Large-3-675B-Base-2512, mistralai/Mistral-Large-3-675B-Instruct-2512, etc. ✅︎ ✅︎
MixtralForCausalLM Mixtral-8x7B, Mixtral-8x7B-Instruct mistralai/Mixtral-8x7B-v0.1, mistralai/Mixtral-8x7B-Instruct-v0.1, mistral-community/Mixtral-8x22B-v0.1, etc. ✅︎ ✅︎
MPTForCausalLM MPT, MPT-Instruct, MPT-Chat, MPT-StoryWriter mosaicml/mpt-7b, mosaicml/mpt-7b-storywriter, mosaicml/mpt-30b, etc. ✅︎
NemotronForCausalLM Nemotron-3, Nemotron-4, Minitron nvidia/Minitron-8B-Base, mgoin/Nemotron-4-340B-Base-hf-FP8, etc. ✅︎ ✅︎
NemotronHForCausalLM Nemotron-H nvidia/Nemotron-H-8B-Base-8K, nvidia/Nemotron-H-47B-Base-8K, nvidia/Nemotron-H-56B-Base-8K, etc. ✅︎ ✅︎
OLMoForCausalLM OLMo allenai/OLMo-1B-hf, allenai/OLMo-7B-hf, etc. ✅︎ ✅︎
OLMo2ForCausalLM OLMo2 allenai/OLMo-2-0425-1B, etc. ✅︎ ✅︎
OLMo3ForCausalLM OLMo3 allenai/Olmo-3-7B-Instruct, allenai/Olmo-3-32B-Think, etc. ✅︎ ✅︎
OLMoEForCausalLM OLMoE allenai/OLMoE-1B-7B-0924, allenai/OLMoE-1B-7B-0924-Instruct, etc. ✅︎
OPTForCausalLM OPT, OPT-IML facebook/opt-66b, facebook/opt-iml-max-30b, etc. ✅︎ ✅︎
OrionForCausalLM Orion OrionStarAI/Orion-14B-Base, OrionStarAI/Orion-14B-Chat, etc. ✅︎
OuroForCausalLM ouro ByteDance/Ouro-1.4B, ByteDance/Ouro-2.6B, etc. ✅︎
PanguEmbeddedForCausalLM openPangu-Embedded-7B FreedomIntelligence/openPangu-Embedded-7B-V1.1 ✅︎ ✅︎
PanguUltraMoEForCausalLM openpangu-ultra-moe-718b-model FreedomIntelligence/openPangu-Ultra-MoE-718B-V1.1 ✅︎ ✅︎
PhiForCausalLM Phi microsoft/phi-1_5, microsoft/phi-2, etc. ✅︎ ✅︎
Phi3ForCausalLM Phi-4, Phi-3 microsoft/Phi-4-mini-instruct, microsoft/Phi-4, microsoft/Phi-3-mini-4k-instruct, microsoft/Phi-3-mini-128k-instruct, microsoft/Phi-3-medium-128k-instruct, etc. ✅︎ ✅︎
PhiMoEForCausalLM Phi-3.5-MoE microsoft/Phi-3.5-MoE-instruct, etc. ✅︎ ✅︎
PersimmonForCausalLM Persimmon adept/persimmon-8b-base, adept/persimmon-8b-chat, etc. ✅︎
Plamo2ForCausalLM PLaMo2 pfnet/plamo-2-1b, pfnet/plamo-2-8b, etc. ✅︎
Plamo3ForCausalLM PLaMo3 pfnet/plamo-3-nict-2b-base, pfnet/plamo-3-nict-8b-base, etc. ✅︎
QwenLMHeadModel Qwen Qwen/Qwen-7B, Qwen/Qwen-7B-Chat, etc. ✅︎ ✅︎
Qwen2ForCausalLM QwQ, Qwen2 Qwen/QwQ-32B-Preview, Qwen/Qwen2-7B-Instruct, Qwen/Qwen2-7B, etc. ✅︎ ✅︎
Qwen2MoeForCausalLM Qwen2MoE Qwen/Qwen1.5-MoE-A2.7B, Qwen/Qwen1.5-MoE-A2.7B-Chat, etc. ✅︎ ✅︎
Qwen3ForCausalLM Qwen3 Qwen/Qwen3-8B, etc. ✅︎ ✅︎
Qwen3MoeForCausalLM Qwen3MoE Qwen/Qwen3-30B-A3B, etc. ✅︎ ✅︎
Qwen3NextForCausalLM Qwen3NextMoE Qwen/Qwen3-Next-80B-A3B-Instruct, etc. ✅︎ ✅︎
SeedOssForCausalLM SeedOss ByteDance-Seed/Seed-OSS-36B-Instruct, etc. ✅︎ ✅︎
StableLmForCausalLM StableLM stabilityai/stablelm-3b-4e1t, stabilityai/stablelm-base-alpha-7b-v2, etc.
Starcoder2ForCausalLM Starcoder2 bigcode/starcoder2-3b, bigcode/starcoder2-7b, bigcode/starcoder2-15b, etc. ✅︎
SolarForCausalLM Solar Pro upstage/solar-pro-preview-instruct, etc. ✅︎ ✅︎
TeleChat2ForCausalLM TeleChat2 Tele-AI/TeleChat2-3B, Tele-AI/TeleChat2-7B, Tele-AI/TeleChat2-35B, etc. ✅︎ ✅︎
TeleFLMForCausalLM TeleFLM CofeAI/FLM-2-52B-Instruct-2407, CofeAI/Tele-FLM, etc. ✅︎ ✅︎
XverseForCausalLM XVERSE xverse/XVERSE-7B-Chat, xverse/XVERSE-13B-Chat, xverse/XVERSE-65B-Chat, etc. ✅︎ ✅︎
MiniMaxM1ForCausalLM MiniMax-Text MiniMaxAI/MiniMax-M1-40k, MiniMaxAI/MiniMax-M1-80k, etc.
MiniMaxText01ForCausalLM MiniMax-Text MiniMaxAI/MiniMax-Text-01, etc.
Zamba2ForCausalLM Zamba2 Zyphra/Zamba2-7B-instruct, Zyphra/Zamba2-2.7B-instruct, Zyphra/Zamba2-1.2B-instruct, etc.
LongcatFlashForCausalLM LongCat-Flash meituan-longcat/LongCat-Flash-Chat, meituan-longcat/LongCat-Flash-Chat-FP8 ✅︎ ✅︎

有些模型仅通过Transformers 模型后端支持。下表旨在列出我们通过这种方式官方支持的模型。日志将显示正在使用 Transformers 模型后端,并且您不会看到关于这是回退行为的警告。这意味着,如果您对下方列出的任何模型遇到问题,请创建一个 issue,我们将尽力修复它!

架构 模型 示例 HF 模型 LoRA PP
SmolLM3ForCausalLM SmolLM3 HuggingFaceTB/SmolLM3-3B ✅︎ ✅︎

注意

目前,vLLM 的 ROCm 版本仅支持 Mistral 和 Mixtral 的上下文长度高达 4096。

池化模型

有关如何使用池化模型的更多信息,请参阅此页面

重要

由于某些模型架构同时支持生成式和池化任务,您应该显式指定 --runner pooling 以确保模型在池化模式下使用而不是生成模式。

嵌入

这些模型主要支持 LLM.embed API。

架构 模型 示例 HF 模型 LoRA PP
BertModelC 基于 BERT BAAI/bge-base-en-v1.5, Snowflake/snowflake-arctic-embed-xs, etc.
BertSpladeSparseEmbeddingModel SPLADE naver/splade-v3
Gemma2ModelC 基于 Gemma 2 BAAI/bge-multilingual-gemma2, etc. ✅︎ ✅︎
Gemma3TextModelC 基于 Gemma 3 google/embeddinggemma-300m, etc. ✅︎ ✅︎
GritLM GritLM parasail-ai/GritLM-7B-vllm. ✅︎ ✅︎
GteModelC Arctic-Embed-2.0-M Snowflake/snowflake-arctic-embed-m-v2.0.
GteNewModelC mGTE-TRM (参见注释) Alibaba-NLP/gte-multilingual-base, etc.
ModernBertModelC 基于 ModernBERT Alibaba-NLP/gte-modernbert-base, etc.
NomicBertModelC Nomic BERT nomic-ai/nomic-embed-text-v1, nomic-ai/nomic-embed-text-v2-moe, Snowflake/snowflake-arctic-embed-m-long, etc.
LlamaModelC, LlamaForCausalLMC, MistralModelC, etc. 基于 Llama intfloat/e5-mistral-7b-instruct, etc. ✅︎ ✅︎
Qwen2ModelC, Qwen2ForCausalLMC 基于 Qwen2 ssmits/Qwen2-7B-Instruct-embed-base (参见注释), Alibaba-NLP/gte-Qwen2-7B-instruct (参见注释), etc. ✅︎ ✅︎
Qwen3ModelC, Qwen3ForCausalLMC 基于 Qwen3 Qwen/Qwen3-Embedding-0.6B, etc. ✅︎ ✅︎
RobertaModel, RobertaForMaskedLM 基于 RoBERTa sentence-transformers/all-roberta-large-v1, etc.
*ModelC, *ForCausalLMC, etc. 生成式模型 不适用 * *

C 通过 --convert embed 自动转换为嵌入模型。(详情
* 功能支持与原始模型相同。

注意

ssmits/Qwen2-7B-Instruct-embed-base 具有不正确的 Sentence Transformers 配置。您需要通过传递 --pooler-config '{"pooling_type": "MEAN"}' 来手动设置平均池化。

注意

对于 Alibaba-NLP/gte-Qwen2-*,您需要启用 --trust-remote-code 才能正确加载分词器。请参阅 HF Transformers 中的相关 issue

注意

jinaai/jina-embeddings-v3 支持通过 LoRA 执行多项任务,而 vllm 目前仅支持通过合并 LoRA 权重来执行文本匹配任务。

注意

第二代 GTE 模型(mGTE-TRM)名为 NewModelNewModel 这个名字过于通用,您应该设置 --hf-overrides '{"architectures": ["GteNewModel"]}' 来指定使用 GteNewModel 架构。

如果您的模型不在上述列表中,我们将尝试使用as_embedding_model 自动转换模型。默认情况下,整个提示的嵌入是从对应于最后一个 token 的归一化隐藏状态中提取的。

分类

这些模型主要支持 LLM.classify API。

架构 模型 示例 HF 模型 LoRA PP
JambaForSequenceClassification Jamba ai21labs/Jamba-tiny-reward-dev, etc. ✅︎ ✅︎
GPT2ForSequenceClassification GPT2 nie3e/sentiment-polish-gpt2-small
*ModelC, *ForCausalLMC, etc. 生成式模型 不适用 * *

C 通过 --convert classify 自动转换为分类模型。(详情
* 功能支持与原始模型相同。

如果您的模型不在上述列表中,我们将尝试使用as_seq_cls_model 自动转换模型。默认情况下,类别概率是从最后一个 token 的 softmaxed 隐藏状态中提取的。

交叉编码器/重排器

交叉编码器和重排器模型是接受两个提示作为输入的分类模型的一个子集。这些模型主要支持LLM.score API。

架构 模型 示例 HF 模型 LoRA PP
BertForSequenceClassification 基于 BERT cross-encoder/ms-marco-MiniLM-L-6-v2, etc.
GemmaForSequenceClassification 基于 Gemma BAAI/bge-reranker-v2-gemma (见注释), etc. ✅︎ ✅︎
GteNewForSequenceClassification mGTE-TRM (参见注释) Alibaba-NLP/gte-multilingual-reranker-base, etc.
Qwen2ForSequenceClassification 基于 Qwen2 mixedbread-ai/mxbai-rerank-base-v2 (见注释), etc. ✅︎ ✅︎
Qwen3ForSequenceClassification 基于 Qwen3 tomaarsen/Qwen3-Reranker-0.6B-seq-cls, Qwen/Qwen3-Reranker-0.6B (见注释), etc. ✅︎ ✅︎
RobertaForSequenceClassification 基于 RoBERTa cross-encoder/quora-roberta-base, etc.
XLMRobertaForSequenceClassification 基于 XLM-RoBERTa BAAI/bge-reranker-v2-m3, etc.
*ModelC, *ForCausalLMC, etc. 生成式模型 不适用 * *

C 通过 --convert classify 自动转换为分类模型。(详情
* 功能支持与原始模型相同。

注意

使用以下命令加载官方原始的 BAAI/bge-reranker-v2-gemma

vllm serve BAAI/bge-reranker-v2-gemma --hf_overrides '{"architectures": ["GemmaForSequenceClassification"],"classifier_from_token": ["Yes"],"method": "no_post_processing"}'

注意

第二代 GTE 模型 (mGTE-TRM) 命名为 NewForSequenceClassificationNewForSequenceClassification 名称过于通用,您应该设置 --hf-overrides '{"architectures": ["GteNewForSequenceClassification"]}' 来指定使用 GteNewForSequenceClassification 架构。

注意

使用以下命令加载官方原始的 mxbai-rerank-v2

vllm serve mixedbread-ai/mxbai-rerank-base-v2 --hf_overrides '{"architectures": ["Qwen2ForSequenceClassification"],"classifier_from_token": ["0", "1"], "method": "from_2_way_softmax"}'

注意

使用以下命令加载官方原始的 Qwen3 Reranker。更多信息可以在以下网址找到: examples/pooling/score/offline_reranker.py.

vllm serve Qwen/Qwen3-Reranker-0.6B --hf_overrides '{"architectures": ["Qwen3ForSequenceClassification"],"classifier_from_token": ["no", "yes"],"is_original_qwen3_reranker": true}'

奖励建模

这些模型主要支持LLM.reward API。

架构 模型 示例 HF 模型 LoRA PP
InternLM2ForRewardModel 基于 InternLM2 internlm/internlm2-1_8b-reward, internlm/internlm2-7b-reward, etc. ✅︎ ✅︎
LlamaForCausalLM 基于 Llama peiyi9979/math-shepherd-mistral-7b-prm, etc. ✅︎ ✅︎
Qwen2ForRewardModel 基于 Qwen2 Qwen/Qwen2.5-Math-RM-72B, etc. ✅︎ ✅︎
Qwen2ForProcessRewardModel 基于 Qwen2 Qwen/Qwen2.5-Math-PRM-7B, etc. ✅︎ ✅︎

重要

对于过程监督奖励模型,例如 peiyi9979/math-shepherd-mistral-7b-prm,应显式设置池化配置,例如:--pooler-config '{"pooling_type": "STEP", "step_tag_id": 123, "returned_token_ids": [456, 789]}'

Token Classification

这些模型主要支持LLM.encode API。

架构 模型 示例 HF 模型 LoRA PP
BertForTokenClassification 基于 bert boltuix/NeuroBERT-NER (见注释), etc.
ModernBertForTokenClassification 基于 ModernBERT disham993/electrical-ner-ModernBERT-base

多模态语言模型列表

以下模态取决于模型而支持

  • Text (文本)
  • Image (图像)
  • Video (视频)
  • Audio (音频)

支持由 + 连接的任何模态组合。

  • 例如:T + I 表示模型支持仅文本、仅图像和文本与图像组合的输入。

另一方面,由 / 分隔的模态是互斥的。

  • 例如:T / I 表示模型支持仅文本和仅图像的输入,但不支持文本与图像组合的输入。

有关如何将多模态输入传递给模型的详细信息,请参阅此页面

提示

对于混合模型,如 Llama-4、Step3 和 Mistral-3,可以通过将所有支持的多模态模态设置为 0 来启用纯文本模式(例如,--limit-mm-per-prompt '{"image":0}),这样它们的多模态模块将不会被加载,从而为 KV 缓存释放更多 GPU 内存。

注意

vLLM 目前仅支持多模态模型语言主干的动态 LoRA 适配器。如果您希望在多模态编码器中使用带有 LoRA 的模型,请先将权重合并到基本模型中,然后再像常规模型一样在 vLLM 中运行。

from peft import PeftConfig, PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor

def merge_and_save(model_id: str, output_dir: str):
    base_model = AutoModelForImageTextToText.from_pretrained(model_id)
    lora_model = PeftModel.from_pretrained(
        base_model,
        model_id,
        config=PeftConfig.from_pretrained(model_id),
    )
    model = lora_model.merge_and_unload().to(dtype=base_model.dtype)
    model._hf_peft_config_loaded = False  # Needed to save the merged model

    processor = AutoProcessor.from_pretrained(model_id)

    model.save_pretrained(output_dir)
    processor.save_pretrained(output_dir)

生成模型

有关如何使用生成式模型的更多信息,请参阅此页面

文本生成

这些模型主要支持 LLM.generate API。聊天/指令模型还额外支持 LLM.chat API。

架构 模型 输入 示例 HF 模型 LoRA PP
AriaForConditionalGeneration Aria T + I+ rhymes-ai/Aria
AudioFlamingo3ForConditionalGeneration AudioFlamingo3 T + A+ nvidia/audio-flamingo-3-hf, nvidia/music-flamingo-hf ✅︎ ✅︎
AyaVisionForConditionalGeneration Aya Vision T + I+ CohereLabs/aya-vision-8b, CohereLabs/aya-vision-32b, etc. ✅︎
BagelForConditionalGeneration BAGEL T + I+ ByteDance-Seed/BAGEL-7B-MoT ✅︎ ✅︎
BeeForConditionalGeneration Bee-8B T + IE+ Open-Bee/Bee-8B-RL, Open-Bee/Bee-8B-SFT ✅︎
Blip2ForConditionalGeneration BLIP-2 T + IE Salesforce/blip2-opt-2.7b, Salesforce/blip2-opt-6.7b, etc. ✅︎
ChameleonForConditionalGeneration Chameleon T + I facebook/chameleon-7b, etc. ✅︎
Cohere2VisionForConditionalGeneration Command A Vision T + I+ CohereLabs/command-a-vision-07-2025, etc. ✅︎
DeepseekVLV2ForCausalLM^ DeepSeek-VL2 T + I+ deepseek-ai/deepseek-vl2-tiny, deepseek-ai/deepseek-vl2-small, deepseek-ai/deepseek-vl2, etc. ✅︎
DeepseekOCRForCausalLM DeepSeek-OCR T + I+ deepseek-ai/DeepSeek-OCR, etc. ✅︎
Ernie4_5_VLMoeForConditionalGeneration Ernie4.5-VL T + I+/ V+ baidu/ERNIE-4.5-VL-28B-A3B-PT, baidu/ERNIE-4.5-VL-424B-A47B-PT ✅︎
FuyuForCausalLM Fuyu T + I adept/fuyu-8b, etc. ✅︎
Gemma3ForConditionalGeneration Gemma 3 T + IE+ google/gemma-3-4b-it, google/gemma-3-27b-it, etc. ✅︎ ✅︎
Gemma3nForConditionalGeneration Gemma 3n T + I + A google/gemma-3n-E2B-it, google/gemma-3n-E4B-it, etc.
GLM4VForCausalLM^ GLM-4V T + I zai-org/glm-4v-9b, zai-org/cogagent-9b-20241220, etc. ✅︎ ✅︎
Glm4vForConditionalGeneration GLM-4.1V-Thinking T + IE+ + VE+ zai-org/GLM-4.1V-9B-Thinking, etc. ✅︎ ✅︎
Glm4vMoeForConditionalGeneration GLM-4.5V T + IE+ + VE+ zai-org/GLM-4.5V, etc. ✅︎ ✅︎
GraniteSpeechForConditionalGeneration Granite Speech T + A ibm-granite/granite-speech-3.3-8b ✅︎ ✅︎
H2OVLChatModel H2OVL T + IE+ h2oai/h2ovl-mississippi-800m, h2oai/h2ovl-mississippi-2b, etc. ✅︎
HunYuanVLForConditionalGeneration HunyuanOCR T + IE+ tencent/HunyuanOCR, etc. ✅︎ ✅︎
Idefics3ForConditionalGeneration Idefics3 T + I HuggingFaceM4/Idefics3-8B-Llama3, etc. ✅︎
InternS1ForConditionalGeneration Intern-S1 T + IE+ + VE+ internlm/Intern-S1, internlm/Intern-S1-mini, etc. ✅︎ ✅︎
InternVLChatModel InternVL 3.5, InternVL 3.0, InternVideo 2.5, InternVL 2.5, Mono-InternVL, InternVL 2.0 T + IE+ + (VE+) OpenGVLab/InternVL3_5-14B, OpenGVLab/InternVL3-9B, OpenGVLab/InternVideo2_5_Chat_8B, OpenGVLab/InternVL2_5-4B, OpenGVLab/Mono-InternVL-2B, OpenGVLab/InternVL2-4B, etc. ✅︎ ✅︎
InternVLForConditionalGeneration InternVL 3.0 (HF format) T + IE+ + VE+ OpenGVLab/InternVL3-1B-hf, etc. ✅︎ ✅︎
KeyeForConditionalGeneration Keye-VL-8B-Preview T + IE+ + VE+ Kwai-Keye/Keye-VL-8B-Preview ✅︎ ✅︎
KeyeVL1_5ForConditionalGeneration Keye-VL-1_5-8B T + IE+ + VE+ Kwai-Keye/Keye-VL-1_5-8B ✅︎ ✅︎
KimiVLForConditionalGeneration Kimi-VL-A3B-Instruct, Kimi-VL-A3B-Thinking T + I+ moonshotai/Kimi-VL-A3B-Instruct, moonshotai/Kimi-VL-A3B-Thinking ✅︎
LightOnOCRForConditionalGeneration LightOnOCR-1B T + I+ lightonai/LightOnOCR-1B, etc ✅︎ ✅︎
Llama4ForConditionalGeneration Llama 4 T + I+ meta-llama/Llama-4-Scout-17B-16E-Instruct, meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8, meta-llama/Llama-4-Maverick-17B-128E-Instruct, etc. ✅︎ ✅︎
Llama_Nemotron_Nano_VL Llama Nemotron Nano VL T + IE+ nvidia/Llama-3.1-Nemotron-Nano-VL-8B-V1 ✅︎ ✅︎
LlavaForConditionalGeneration LLaVA-1.5, Pixtral (HF Transformers) T + IE+ llava-hf/llava-1.5-7b-hf, TIGER-Lab/Mantis-8B-siglip-llama3 (见注释), mistral-community/pixtral-12b, etc. ✅︎
LlavaNextForConditionalGeneration LLaVA-NeXT T + IE+ llava-hf/llava-v1.6-mistral-7b-hf, llava-hf/llava-v1.6-vicuna-7b-hf, etc. ✅︎
LlavaNextVideoForConditionalGeneration LLaVA-NeXT-Video T + V llava-hf/LLaVA-NeXT-Video-7B-hf, etc. ✅︎
LlavaOnevisionForConditionalGeneration LLaVA-Onevision T + I+ + V+ llava-hf/llava-onevision-qwen2-7b-ov-hf, llava-hf/llava-onevision-qwen2-0.5b-ov-hf, etc. ✅︎
MiDashengLMModel MiDashengLM T + A+ mispeech/midashenglm-7b ✅︎
MiniCPMO MiniCPM-O T + IE+ + VE+ + AE+ openbmb/MiniCPM-o-2_6, etc. ✅︎ ✅︎
MiniCPMV MiniCPM-V T + IE+ + VE+ openbmb/MiniCPM-V-2 (见注释), openbmb/MiniCPM-Llama3-V-2_5, openbmb/MiniCPM-V-2_6, openbmb/MiniCPM-V-4, openbmb/MiniCPM-V-4_5, etc. ✅︎
MiniMaxVL01ForConditionalGeneration MiniMax-VL T + IE+ MiniMaxAI/MiniMax-VL-01, etc. ✅︎
Mistral3ForConditionalGeneration Mistral3 (HF Transformers) T + I+ mistralai/Mistral-Small-3.1-24B-Instruct-2503, etc. ✅︎ ✅︎
MolmoForCausalLM Molmo T + I+ allenai/Molmo-7B-D-0924, allenai/Molmo-7B-O-0924, etc. ✅︎ ✅︎
NVLM_D_Model NVLM-D 1.0 T + I+ nvidia/NVLM-D-72B, etc. ✅︎
OpenCUAForConditionalGeneration OpenCUA-7B T + IE+ xlangai/OpenCUA-7B ✅︎ ✅︎
Ovis Ovis2, Ovis1.6 T + I+ AIDC-AI/Ovis2-1B, AIDC-AI/Ovis1.6-Llama3.2-3B, etc. ✅︎
Ovis2_5 Ovis2.5 T + I+ + V AIDC-AI/Ovis2.5-9B, etc.
PaddleOCRVLForConditionalGeneration Paddle-OCR T + I+ PaddlePaddle/PaddleOCR-VL, etc.
PaliGemmaForConditionalGeneration PaliGemma, PaliGemma 2 T + IE google/paligemma-3b-pt-224, google/paligemma-3b-mix-224, google/paligemma2-3b-ft-docci-448, etc. ✅︎
Phi3VForCausalLM Phi-3-Vision, Phi-3.5-Vision T + IE+ microsoft/Phi-3-vision-128k-instruct, microsoft/Phi-3.5-vision-instruct, etc. ✅︎
Phi4MMForCausalLM Phi-4-multimodal T + I+ / T + A+ / I+ + A+ microsoft/Phi-4-multimodal-instruct, etc. ✅︎ ✅︎
PixtralForConditionalGeneration Ministral 3 (Mistral format), Mistral 3 (Mistral format), Mistral Large 3 (Mistral format), Pixtral (Mistral format) T + I+ mistralai/Ministral-3-3B-Instruct-2512, mistralai/Mistral-Small-3.1-24B-Instruct-2503, mistralai/Mistral-Large-3-675B-Instruct-2512 mistralai/Pixtral-12B-2409 etc. ✅︎
QwenVLForConditionalGeneration^ Qwen-VL T + IE+ Qwen/Qwen-VL, Qwen/Qwen-VL-Chat, etc. ✅︎ ✅︎
Qwen2AudioForConditionalGeneration Qwen2-Audio T + A+ Qwen/Qwen2-Audio-7B-Instruct ✅︎
Qwen2VLForConditionalGeneration QVQ, Qwen2-VL T + IE+ + VE+ Qwen/QVQ-72B-Preview, Qwen/Qwen2-VL-7B-Instruct, Qwen/Qwen2-VL-72B-Instruct, etc. ✅︎ ✅︎
Qwen2_5_VLForConditionalGeneration Qwen2.5-VL T + IE+ + VE+ Qwen/Qwen2.5-VL-3B-Instruct, Qwen/Qwen2.5-VL-72B-Instruct, etc. ✅︎ ✅︎
Qwen2_5OmniThinkerForConditionalGeneration Qwen2.5-Omni T + IE+ + VE+ + A+ Qwen/Qwen2.5-Omni-3B, Qwen/Qwen2.5-Omni-7B ✅︎ ✅︎
Qwen3VLForConditionalGeneration Qwen3-VL T + IE+ + VE+ Qwen/Qwen3-VL-4B-Instruct, etc. ✅︎ ✅︎
Qwen3VLMoeForConditionalGeneration Qwen3-VL-MOE T + IE+ + VE+ Qwen/Qwen3-VL-30B-A3B-Instruct, etc. ✅︎ ✅︎
Qwen3OmniMoeThinkerForConditionalGeneration Qwen3-Omni T + IE+ + VE+ + A+ Qwen/Qwen3-Omni-30B-A3B-Instruct, Qwen/Qwen3-Omni-30B-A3B-Thinking ✅︎ ✅︎
RForConditionalGeneration R-VL-4B T + IE+ YannQi/R-4B ✅︎
SkyworkR1VChatModel Skywork-R1V-38B T + I Skywork/Skywork-R1V-38B ✅︎
SmolVLMForConditionalGeneration SmolVLM2 T + I SmolVLM2-2.2B-Instruct ✅︎
Step3VLForConditionalGeneration Step3-VL T + I+ stepfun-ai/step3 ✅︎
TarsierForConditionalGeneration Tarsier T + IE+ omni-search/Tarsier-7b, omni-search/Tarsier-34b ✅︎
Tarsier2ForConditionalGeneration^ Tarsier2 T + IE+ + VE+ omni-research/Tarsier2-Recap-7b, omni-research/Tarsier2-7b-0115 ✅︎
UltravoxModel Ultravox T + AE+ fixie-ai/ultravox-v0_5-llama-3_2-1b ✅︎ ✅︎

有些模型仅通过Transformers 模型后端支持。下表旨在列出我们通过这种方式官方支持的模型。日志将显示正在使用 Transformers 模型后端,并且您不会看到关于这是回退行为的警告。这意味着,如果您对下方列出的任何模型遇到问题,请创建一个 issue,我们将尽力修复它!

架构 模型 输入 示例 HF 模型 LoRA PP
Emu3ForConditionalGeneration Emu3 T + I BAAI/Emu3-Chat-hf ✅︎ ✅︎

^ 您需要通过 --hf-overrides 设置架构名称以匹配 vLLM 中的名称。     • 例如,要使用 DeepSeek-VL2 系列模型:       --hf-overrides '{"architectures": ["DeepseekVLV2ForCausalLM"]}' E 可以为该模态输入预计算的嵌入。 + 此模态可以为每个文本提示输入多个项目。

注意

Gemma3nForConditionalGeneration 仅在 V1 上受支持,因为共享的 KV 缓存,并且它依赖于 timm>=1.0.17 来使用其 MobileNet-v5 视觉主干。

性能尚未完全优化,主要是由于

  • 音频和视觉 MM 编码器都使用 transformers.AutoModel 实现。
  • 没有 PLE 缓存或内存不足交换支持,正如 Google 的博客中所述。这些功能可能对 vLLM 来说过于模型特定,而交换尤其可能更适合受限设置。

注意

对于 InternVLChatModel,目前只有使用 Qwen2.5 文本主干的 InternVL2.5(OpenGVLab/InternVL2.5-1B 等)、InternVL3 和 InternVL3.5 支持视频输入。

注意

要使用 TIGER-Lab/Mantis-8B-siglip-llama3,在运行 vLLM 时必须传递 --hf_overrides '{"architectures": ["MantisForConditionalGeneration"]}'

注意

官方的 openbmb/MiniCPM-V-2 尚不能正常工作,因此我们暂时需要使用一个 fork(HwwwH/MiniCPM-V-2)。有关更多详细信息,请参阅: Pull Request #4087

注意

对于 Qwen2.5-Omni 和 Qwen3-Omni,当前不支持从视频预处理中读取音频(--mm-processor-kwargs '{"use_audio_in_video": true}')。

转录

专门为自动语音识别训练的 Speech2Text 模型。

架构 模型 示例 HF 模型 LoRA PP
WhisperForConditionalGeneration Whisper openai/whisper-small, openai/whisper-large-v3-turbo, etc.
VoxtralForConditionalGeneration Voxtral (Mistral format) mistralai/Voxtral-Mini-3B-2507, mistralai/Voxtral-Small-24B-2507, etc. ✅︎ ✅︎
Gemma3nForConditionalGeneration Gemma3n google/gemma-3n-E2B-it, google/gemma-3n-E4B-it, etc.
GraniteSpeechForConditionalGeneration Granite Speech ibm-granite/granite-speech-3.3-2b, ibm-granite/granite-speech-3.3-8b, etc. ✅︎ ✅︎

注意

VoxtralForConditionalGeneration 需要安装 mistral-common[audio]

池化模型

有关如何使用池化模型的更多信息,请参阅此页面

Embedding (嵌入)

这些模型主要支持 LLM.embed API。

注意

为了获得最佳结果,您应该使用专门为此训练的池化模型。

下表列出了在 vLLM 中经过测试的模型。

架构 模型 输入 示例 HF 模型 LoRA PP
CLIPModel CLIP T / I openai/clip-vit-base-patch32, openai/clip-vit-large-patch14, etc.
LlavaNextForConditionalGenerationC 基于 LLaVA-NeXT T / I royokong/e5-v ✅︎
Phi3VForCausalLMC 基于 Phi-3-Vision T + I TIGER-Lab/VLM2Vec-Full ✅︎
SiglipModel SigLIP, SigLIP2 T / I google/siglip-base-patch16-224, google/siglip2-base-patch16-224
*ForConditionalGenerationC, *ForCausalLMC, etc. 生成式模型 * 不适用 * *

C 通过 --convert embed 自动转换为嵌入模型。(详情
* 功能支持与原始模型相同。


交叉编码器/重排器

交叉编码器和重排器模型是接受两个提示作为输入的分类模型的一个子集。这些模型主要支持LLM.score API。

架构 模型 输入 示例 HF 模型 LoRA PP
JinaVLForSequenceClassification 基于 JinaVL T + IE+ jinaai/jina-reranker-m0, etc. ✅︎ ✅︎

C 通过 --convert classify 自动转换为分类模型。(详情
* 功能支持与原始模型相同。

模型支持策略

在 vLLM,我们致力于促进第三方模型在我们生态系统中的集成和支持。我们的方法旨在平衡鲁棒性的需求与支持广泛模型所面临的实际限制。以下是我们管理第三方模型支持的方式:

  1. 社区驱动支持:我们鼓励社区为添加新模型做出贡献。当用户请求支持新模型时,我们欢迎社区提交拉取请求 (PR)。这些贡献主要根据其生成的输出的合理性进行评估,而不是严格要求与 transformers 中的现有实现保持一致。呼吁贡献: 非常欢迎模型供应商直接提交 PR!

  2. 尽力保持一致性:虽然我们力求在 vLLM 中实现的模型与其他框架(如 transformers)之间保持一定程度的一致性,但并非总能完全对齐。加速技术的使用和低精度计算的使用等因素可能会引起差异。我们的承诺是确保实现的模型能够正常运行并产生合理的结果。

    提示

    在比较 Hugging Face Transformers 的 model.generate 输出与 vLLM 的 llm.generate 输出时,请注意前者会读取模型的生成配置文件(即 generation_config.json)并为生成应用默认参数,而后者仅使用传递给函数的参数。比较输出时,请确保所有采样参数都相同。

  3. 问题解决和模型更新:鼓励用户报告他们在使用第三方模型时遇到的任何错误或问题。建议通过 PR 提交修复方案,并清楚解释问题和解决方案的理由。如果对一个模型的修复会影响到另一个模型,我们依赖社区来突出显示并解决这些跨模型依赖关系。注意:对于 bug 修复 PR,告知原始作者以寻求他们的反馈是一种良好的礼仪。

  4. 监控和更新:对特定模型感兴趣的用户应监控这些模型的提交历史(例如,通过跟踪 main/vllm/model_executor/models 目录中的更改)。这种主动的方法有助于用户及时了解可能影响他们所使用模型的更新和更改。

  5. 选择性关注:我们的资源主要用于具有重要用户兴趣和影响力的模型。使用较少的模型可能获得的关注较少,我们依赖社区在模型的维护和改进中发挥更积极的作用。

通过这种方法,vLLM 促进了一个协作的环境,核心开发团队和更广泛的社区共同为我们生态系统中第三方模型的鲁棒性和多样性做出贡献。

请注意,作为推理引擎,vLLM 不会引入新模型。因此,vLLM 支持的所有模型在此方面都属于第三方模型。

我们对模型有以下测试级别:

  1. 严格一致性:我们将模型输出与 HuggingFace Transformers 库中贪婪解码下的模型输出进行比较。这是最严格的测试。请参阅 models tests 以了解通过此测试的模型。
  2. 输出合理性:我们通过测量输出的困惑度并检查任何明显的错误来检查模型的输出是否合理且连贯。这是一个不太严格的测试。
  3. 运行时功能:我们检查模型是否可以加载和运行而不会出错。这是最不严格的测试。请参阅 功能测试 示例 以了解通过此测试的模型。
  4. 社区反馈:我们依赖社区提供有关模型的反馈。如果模型损坏或未按预期工作,我们鼓励用户提出问题报告,或提交拉取请求进行修复。其余模型属于此类。