支持的模型¶
vLLM 支持各种任务的生成式和池化(pooling)模型。
对于每项任务,我们列出了 vLLM 中已实现的模型架构。在每种架构旁边,我们还列出了一些使用该架构的流行模型。
模型实现¶
vLLM¶
如果 vLLM 原生支持某个模型,可以在 vllm/model_executor/models 中找到其实现。
这些模型是我们列在支持的文本模型和支持的多模态模型中的内容。
Transformers¶
vLLM 也支持 Transformers 中可用的模型实现。您应当预期在 vLLM 中使用的 Transformers 模型实现的性能,与专用 vLLM 模型实现的性能差距在 5% 以内。我们将此功能称为“Transformers 建模后端”。
目前,Transformers 建模后端适用于以下情况:
- 模态:嵌入模型、语言模型和视觉-语言模型*
- 架构:仅编码器 (encoder-only)、仅解码器 (decoder-only)、专家混合模型 (mixture-of-experts)
- 注意力类型:全注意力 (full attention) 和/或滑动窗口注意力 (sliding attention)
*视觉-语言模型目前仅接受图像输入。对视频输入的支持将在未来版本中添加。
如果 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 将尊重模型中每个主干 (backbone) 的 dtype 属性。这可能会导致性能上的细微差异。
自定义模型¶
如果一个模型既没有被 vLLM 原生支持,也没有在 Transformers 中实现,它仍然可以在 vLLM 中使用!
为了使模型能够与 vLLM 的 Transformers 建模后端兼容,它必须:
- 是一个 Transformers 兼容的自定义模型(参见 Transformers - 自定义模型)
- 模型目录必须具有正确的结构(例如存在
config.json)。 config.json必须包含auto_map.AutoModel。
- 模型目录必须具有正确的结构(例如存在
- 是一个与 vLLM 的 Transformers 建模后端兼容的模型(参见 编写自定义模型)
- 自定义应在基础模型中完成(例如在
MyModel中,而不是MyModelForCausalLM中)。
- 自定义应在基础模型中完成(例如在
如果该兼容模型:
- 位于 Hugging Face Model Hub 上,只需为离线推理设置
trust_remote_code=True,或为兼容 OpenAI 的服务器设置--trust-remote-code。 - 位于本地目录中,只需为离线推理将目录路径传递给
model=<MODEL_DIR>,或为兼容 OpenAI 的服务器使用vllm serve <MODEL_DIR>。
这意味着,通过 vLLM 的 Transformers 建模后端,新模型可以在正式被 Transformers 或 vLLM 支持之前就能使用!
编写自定义模型¶
本节详细介绍了使 Transformers 兼容的自定义模型与 vLLM 的 Transformers 建模后端兼容所需的必要修改。(我们假设已经创建了一个 Transformers 兼容的自定义模型,参见 Transformers - 自定义模型)。
要使您的模型与 Transformers 建模后端兼容,需要:
kwargs通过所有模块从MyModel传递到MyAttention。- 如果您的模型是仅编码器 (encoder-only) 的
- 向
MyAttention添加is_causal = False。
- 向
- 如果您的模型是专家混合模型 (MoE)
- 您的稀疏 MoE 块必须有一个名为
experts的属性。 experts的类 (MyExperts) 必须:- 继承自
nn.ModuleList(原生实现)。 - 或者包含所有 3D
nn.Parameters(打包实现)。
- 继承自
MyExperts.forward必须接受hidden_states,top_k_index,top_k_weights。
- 您的稀疏 MoE 块必须有一个名为
- 如果您的模型是仅编码器 (encoder-only) 的
MyAttention必须使用ALL_ATTENTION_FUNCTIONS来调用注意力机制。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
以下是加载此模型时后台发生的情况:
- 加载配置。
- 从配置中的
auto_map加载MyModelPython 类,并检查该模型是否is_backend_compatible()。 - 将
MyModel加载到 vllm/model_executor/models/transformers 中的某个 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是一个将完全限定层名称模式映射到张量并行样式(目前仅支持"colwise"和"rowwise")的dict。base_model_pp_plan是一个将直接子层名称映射到str的list的tuple的dict- 您只需为那些并非存在于所有流水线阶段的层执行此操作
- vLLM 假设只有一个
nn.ModuleList,它分布在各个流水线阶段中 tuple中第一个元素里的list包含输入参数的名称tuple中最后一个元素里的list包含您的建模代码中该层输出的变量名称
插件¶
某些模型架构通过 vLLM 插件支持。这些插件通过插件系统扩展了 vLLM 的功能。
| 架构 | 模型 | 插件仓库 |
|---|---|---|
BartForConditionalGeneration | BART | bart-plugin |
Florence2ForConditionalGeneration | Florence-2 | bart-plugin |
对于其他未原生支持的模型架构,特别是编码器-解码器模型,我们建议遵循类似的模式,通过插件系统实现支持。
加载模型¶
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
hf download HuggingFaceH4/zephyr-7b-beta
# Specify a custom cache directory
hf download HuggingFaceH4/zephyr-7b-beta --cache-dir ./path/to/cache
# Download a specific file from a model repo
hf download HuggingFaceH4/zephyr-7b-beta eval_results.json
列出已下载的模型¶
使用 Hugging Face CLI 管理存储在本地缓存中的模型
# List cached models
hf scan-cache
# Show detailed (verbose) output
hf scan-cache -v
# Specify a custom cache directory
hf 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
$ hf 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 加载/下载模型的一些提示
- 为您的会话全局设置代理(或在配置文件中设置它)
- 仅为当前命令设置代理
https_proxy=http://your.proxy.server:port hf 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 的模型,请设置一个环境变量
并配合 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。Chat/Instruct 模型额外支持 LLM.chat API。
| 架构 | 模型 | 示例 HF 模型 | LoRA | PP |
|---|---|---|---|---|
AfmoeForCausalLM | Afmoe | 待定 | ✅︎ | ✅︎ |
ApertusForCausalLM | Apertus | swiss-ai/Apertus-8B-2509, swiss-ai/Apertus-70B-Instruct-2509 等。 | ✅︎ | ✅︎ |
AquilaForCausalLM | Aquila, Aquila2 | BAAI/Aquila-7B, BAAI/AquilaChat-7B 等。 | ✅︎ | ✅︎ |
ArceeForCausalLM | Arcee (AFM) | arcee-ai/AFM-4.5B-Base 等。 | ✅︎ | ✅︎ |
ArcticForCausalLM | Arctic | Snowflake/snowflake-arctic-base, Snowflake/snowflake-arctic-instruct 等。 | ✅︎ | |
AXK1ForCausalLM | A.X-K1 | skt/A.X-K1 等。 | ✅︎ | |
BaiChuanForCausalLM | Baichuan2, Baichuan | baichuan-inc/Baichuan2-13B-Chat, baichuan-inc/Baichuan-7B 等。 | ✅︎ | ✅︎ |
BailingMoeForCausalLM | Ling | inclusionAI/Ling-lite-1.5, inclusionAI/Ling-plus 等。 | ✅︎ | ✅︎ |
BailingMoeV2ForCausalLM | Ling | inclusionAI/Ling-mini-2.0 等。 | ✅︎ | ✅︎ |
BailingMoeV2_5ForCausalLM | Ling | inclusionAI/Ling-2.5-1T, inclusionAI/Ring-2.5-1T | ✅︎ | |
BambaForCausalLM | Bamba | ibm-ai-platform/Bamba-9B-fp8, ibm-ai-platform/Bamba-9B | ✅︎ | ✅︎ |
BloomForCausalLM | BLOOM, BLOOMZ, BLOOMChat | bigscience/bloom, bigscience/bloomz 等。 | ✅︎ | |
ChatGLMModel, ChatGLMForConditionalGeneration | ChatGLM | zai-org/chatglm2-6b, zai-org/chatglm3-6b, thu-coai/ShieldLM-6B-chatglm3 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
CwmForCausalLM | CWM | facebook/cwm 等。 | ✅︎ | ✅︎ |
DbrxForCausalLM | DBRX | databricks/dbrx-base, databricks/dbrx-instruct 等。 | ✅︎ | |
DeciLMForCausalLM | DeciLM | nvidia/Llama-3_3-Nemotron-Super-49B-v1 等。 | ✅︎ | ✅︎ |
DeepseekForCausalLM | DeepSeek | deepseek-ai/deepseek-llm-67b-base, deepseek-ai/deepseek-llm-7b-chat 等。 | ✅︎ | ✅︎ |
DeepseekV2ForCausalLM | DeepSeek-V2 | deepseek-ai/DeepSeek-V2, deepseek-ai/DeepSeek-V2-Chat 等。 | ✅︎ | ✅︎ |
DeepseekV3ForCausalLM | DeepSeek-V3 | deepseek-ai/DeepSeek-V3, deepseek-ai/DeepSeek-R1, deepseek-ai/DeepSeek-V3.1 等。 | ✅︎ | ✅︎ |
Dots1ForCausalLM | dots.llm1 | rednote-hilab/dots.llm1.base, rednote-hilab/dots.llm1.inst 等。 | ✅︎ | |
DotsOCRForCausalLM | dots_ocr | rednote-hilab/dots.ocr | ✅︎ | ✅︎ |
Ernie4_5ForCausalLM | Ernie4.5 | baidu/ERNIE-4.5-0.3B-PT 等。 | ✅︎ | ✅︎ |
Ernie4_5_MoeForCausalLM | Ernie4.5MoE | baidu/ERNIE-4.5-21B-A3B-PT, baidu/ERNIE-4.5-300B-A47B-PT 等。 | ✅︎ | ✅︎ |
ExaoneForCausalLM | EXAONE-3 | LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct 等。 | ✅︎ | ✅︎ |
ExaoneMoEForCausalLM | K-EXAONE | LGAI-EXAONE/K-EXAONE-236B-A23B 等。 | ||
Exaone4ForCausalLM | EXAONE-4 | LGAI-EXAONE/EXAONE-4.0-32B 等。 | ✅︎ | ✅︎ |
Fairseq2LlamaForCausalLM | Llama (fairseq2 格式) | mgleize/fairseq2-dummy-Llama-3.2-1B 等。 | ✅︎ | ✅︎ |
FalconForCausalLM | Falcon | tiiuae/falcon-7b, tiiuae/falcon-40b, tiiuae/falcon-rw-7b 等。 | ✅︎ | |
FalconMambaForCausalLM | FalconMamba | tiiuae/falcon-mamba-7b, tiiuae/falcon-mamba-7b-instruct 等。 | ✅︎ | |
FalconH1ForCausalLM | Falcon-H1 | tiiuae/Falcon-H1-34B-Base, tiiuae/Falcon-H1-34B-Instruct 等。 | ✅︎ | ✅︎ |
FlexOlmoForCausalLM | FlexOlmo | allenai/FlexOlmo-7x7B-1T, allenai/FlexOlmo-7x7B-1T-RT 等。 | ✅︎ | |
GemmaForCausalLM | Gemma | google/gemma-2b, google/gemma-1.1-2b-it 等。 | ✅︎ | ✅︎ |
Gemma2ForCausalLM | Gemma 2 | google/gemma-2-9b, google/gemma-2-27b 等。 | ✅︎ | ✅︎ |
Gemma3ForCausalLM | Gemma 3 | google/gemma-3-1b-it 等。 | ✅︎ | ✅︎ |
Gemma3nForCausalLM | Gemma 3n | google/gemma-3n-E2B-it, google/gemma-3n-E4B-it 等。 | ||
GlmForCausalLM | GLM-4 | zai-org/glm-4-9b-chat-hf 等。 | ✅︎ | ✅︎ |
Glm4ForCausalLM | GLM-4-0414 | zai-org/GLM-4-32B-0414 等。 | ✅︎ | ✅︎ |
Glm4MoeForCausalLM | GLM-4.5, GLM-4.6, GLM-4.7 | zai-org/GLM-4.5 等。 | ✅︎ | ✅︎ |
Glm4MoeLiteForCausalLM | GLM-4.7-Flash | zai-org/GLM-4.7-Flash 等。 | ✅︎ | ✅︎ |
GPT2LMHeadModel | GPT-2 | openai-community/gpt2, openai-community/gpt2-xl 等。 | ✅︎ | |
GPTBigCodeForCausalLM | StarCoder, SantaCoder, WizardCoder | bigcode/starcoder, bigcode/gpt_bigcode-santacoder, WizardLM/WizardCoder-15B-V1.0 等。 | ✅︎ | ✅︎ |
GPTJForCausalLM | GPT-J | EleutherAI/gpt-j-6b, nomic-ai/gpt4all-j 等。 | ✅︎ | |
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 等。 | ✅︎ | |
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 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
GraniteMoeHybridForCausalLM | Granite 4.0 MoE Hybrid | ibm-granite/granite-4.0-tiny-preview 等。 | ✅︎ | ✅︎ |
GraniteMoeSharedForCausalLM | Granite MoE Shared | ibm-research/moe-7b-1b-active-shared-experts (测试模型) | ✅︎ | ✅︎ |
GritLM | GritLM | parasail-ai/GritLM-7B-vllm. | ✅︎ | ✅︎ |
Grok1ModelForCausalLM | Grok1 | hpcai-tech/grok-1. | ✅︎ | ✅︎ |
Grok1ForCausalLM | Grok2 | xai-org/grok-2 | ✅︎ | ✅︎ |
HunYuanDenseV1ForCausalLM | Hunyuan Dense | tencent/Hunyuan-7B-Instruct | ✅︎ | ✅︎ |
HunYuanMoEV1ForCausalLM | Hunyuan-A13B | tencent/Hunyuan-A13B-Instruct, tencent/Hunyuan-A13B-Pretrain, tencent/Hunyuan-A13B-Instruct-FP8 等。 | ✅︎ | ✅︎ |
HyperCLOVAXForCausalLM | HyperCLOVAX-SEED-Think-14B | naver-hyperclovax/HyperCLOVAX-SEED-Think-14B | ✅︎ | ✅︎ |
InternLMForCausalLM | InternLM | internlm/internlm-7b, internlm/internlm-chat-7b 等。 | ✅︎ | ✅︎ |
InternLM2ForCausalLM | InternLM2 | internlm/internlm2-7b, internlm/internlm2-chat-7b 等。 | ✅︎ | ✅︎ |
InternLM3ForCausalLM | InternLM3 | internlm/internlm3-8b-instruct 等。 | ✅︎ | ✅︎ |
IQuestCoderForCausalLM | IQuestCoderV1 | IQuestLab/IQuest-Coder-V1-40B-Instruct 等。 | ||
IQuestLoopCoderForCausalLM | IQuestLoopCoderV1 | IQuestLab/IQuest-Coder-V1-40B-Loop-Instruct 等。 | ||
JAISLMHeadModel | Jais | inceptionai/jais-13b, inceptionai/jais-13b-chat, inceptionai/jais-30b-v3, inceptionai/jais-30b-chat-v3 等。 | ✅︎ | |
Jais2ForCausalLM | Jais2 | inceptionai/Jais-2-8B-Chat, inceptionai/Jais-2-70B-Chat 等。 | ✅︎ | |
JambaForCausalLM | Jamba | ai21labs/AI21-Jamba-1.5-Large, ai21labs/AI21-Jamba-1.5-Mini, ai21labs/Jamba-v0.1 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
Lfm2MoeForCausalLM | LFM2MoE | LiquidAI/LFM2-8B-A1B-preview 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
LongcatFlashForCausalLM | LongCat-Flash | meituan-longcat/LongCat-Flash-Chat, meituan-longcat/LongCat-Flash-Chat-FP8 | ✅︎ | ✅︎ |
MambaForCausalLM | Mamba | state-spaces/mamba-130m-hf, state-spaces/mamba-790m-hf, state-spaces/mamba-2.8b-hf 等。 | ✅︎ | |
Mamba2ForCausalLM | Mamba2 | mistralai/Mamba-Codestral-7B-v0.1 等。 | ✅︎ | |
MiMoForCausalLM | MiMo | XiaomiMiMo/MiMo-7B-RL 等。 | ✅︎ | ✅︎ |
MiMoV2FlashForCausalLM | MiMoV2Flash | XiaomiMiMo/MiMo-V2-Flash 等。 | ✅︎ | |
MiniCPMForCausalLM | MiniCPM | openbmb/MiniCPM-2B-sft-bf16, openbmb/MiniCPM-2B-dpo-bf16, openbmb/MiniCPM-S-1B-sft 等。 | ✅︎ | ✅︎ |
MiniCPM3ForCausalLM | MiniCPM3 | openbmb/MiniCPM3-4B 等。 | ✅︎ | ✅︎ |
MiniMaxForCausalLM | MiniMax-Text | MiniMaxAI/MiniMax-Text-01-hf 等。 | ||
MiniMaxM2ForCausalLM | MiniMax-M2, MiniMax-M2.1 | MiniMaxAI/MiniMax-M2 等。 | ✅︎ | ✅︎ |
MistralForCausalLM | Ministral-3, Mistral, Mistral-Instruct | mistralai/Ministral-3-3B-Instruct-2512, mistralai/Mistral-7B-v0.1, mistralai/Mistral-7B-Instruct-v0.1 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
MixtralForCausalLM | Mixtral-8x7B, Mixtral-8x7B-Instruct | mistralai/Mixtral-8x7B-v0.1, mistralai/Mixtral-8x7B-Instruct-v0.1, mistral-community/Mixtral-8x22B-v0.1 等。 | ✅︎ | ✅︎ |
MPTForCausalLM | MPT, MPT-Instruct, MPT-Chat, MPT-StoryWriter | mosaicml/mpt-7b, mosaicml/mpt-7b-storywriter, mosaicml/mpt-30b 等。 | ✅︎ | |
NemotronForCausalLM | Nemotron-3, Nemotron-4, Minitron | nvidia/Minitron-8B-Base, mgoin/Nemotron-4-340B-Base-hf-FP8 等。 | ✅︎ | ✅︎ |
NemotronHForCausalLM | Nemotron-H | nvidia/Nemotron-H-8B-Base-8K, nvidia/Nemotron-H-47B-Base-8K, nvidia/Nemotron-H-56B-Base-8K 等。 | ✅︎ | ✅︎ |
OlmoForCausalLM | OLMo | allenai/OLMo-1B-hf, allenai/OLMo-7B-hf 等。 | ✅︎ | ✅︎ |
Olmo2ForCausalLM | OLMo2 | allenai/OLMo-2-0425-1B 等。 | ✅︎ | ✅︎ |
Olmo3ForCausalLM | OLMo3 | allenai/Olmo-3-7B-Instruct, allenai/Olmo-3-32B-Think 等。 | ✅︎ | ✅︎ |
OlmoHybridForCausalLM | OLMo Hybrid | allenai/Olmo-Hybrid-7B | ✅︎ | ✅︎ |
OlmoeForCausalLM | OLMoE | allenai/OLMoE-1B-7B-0924, allenai/OLMoE-1B-7B-0924-Instruct 等。 | ✅︎ | |
OPTForCausalLM | OPT, OPT-IML | facebook/opt-66b, facebook/opt-iml-max-30b 等。 | ✅︎ | ✅︎ |
OrionForCausalLM | Orion | OrionStarAI/Orion-14B-Base, OrionStarAI/Orion-14B-Chat 等。 | ✅︎ | |
OuroForCausalLM | ouro | ByteDance/Ouro-1.4B, ByteDance/Ouro-2.6B 等。 | ✅︎ | |
PanguEmbeddedForCausalLM | openPangu-Embedded-7B | FreedomIntelligence/openPangu-Embedded-7B-V1.1 | ✅︎ | ✅︎ |
PanguProMoEV2ForCausalLM | openpangu-pro-moe-v2 | ✅︎ | ✅︎ | |
PanguUltraMoEForCausalLM | openpangu-ultra-moe-718b-model | FreedomIntelligence/openPangu-Ultra-MoE-718B-V1.1 | ✅︎ | ✅︎ |
Param2MoEForCausalLM | param2moe | bharatgenai/Param2-17B-A2.4B-Thinking 等。 | ✅︎ | ✅︎ |
PhiForCausalLM | Phi | microsoft/phi-1_5, microsoft/phi-2 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
PhiMoEForCausalLM | Phi-3.5-MoE | microsoft/Phi-3.5-MoE-instruct 等。 | ✅︎ | ✅︎ |
PersimmonForCausalLM | Persimmon | adept/persimmon-8b-base, adept/persimmon-8b-chat 等。 | ✅︎ | |
Plamo2ForCausalLM | PLaMo2 | pfnet/plamo-2-1b, pfnet/plamo-2-8b 等。 | ✅ | ✅︎ |
Plamo3ForCausalLM | PLaMo3 | pfnet/plamo-3-nict-2b-base, pfnet/plamo-3-nict-8b-base 等。 | ✅ | ✅︎ |
QWenLMHeadModel | Qwen | Qwen/Qwen-7B, Qwen/Qwen-7B-Chat 等。 | ✅︎ | ✅︎ |
Qwen2ForCausalLM | QwQ, Qwen2 | Qwen/QwQ-32B-Preview, Qwen/Qwen2-7B-Instruct, Qwen/Qwen2-7B 等。 | ✅︎ | ✅︎ |
Qwen2MoeForCausalLM | Qwen2MoE | Qwen/Qwen1.5-MoE-A2.7B, Qwen/Qwen1.5-MoE-A2.7B-Chat 等。 | ✅︎ | ✅︎ |
Qwen3ForCausalLM | Qwen3 | Qwen/Qwen3-8B 等。 | ✅︎ | ✅︎ |
Qwen3MoeForCausalLM | Qwen3MoE | Qwen/Qwen3-30B-A3B 等。 | ✅︎ | ✅︎ |
Qwen3NextForCausalLM | Qwen3NextMoE | Qwen/Qwen3-Next-80B-A3B-Instruct 等。 | ✅︎ | ✅︎ |
RWForCausalLM | Falcon RW | tiiuae/falcon-40b 等。 | ✅︎ | |
SarvamMoEForCausalLM | Sarvam 2 | sarvamai/sarvam2-30b-a3b 等。 | ✅︎ | ✅︎ |
SarvamMLAForCausalLM | Sarvam 2 | sarvamai/sarvam2-105b-a9b 等。 | ✅︎ | |
SeedOssForCausalLM | SeedOss | ByteDance-Seed/Seed-OSS-36B-Instruct 等。 | ✅︎ | ✅︎ |
SolarForCausalLM | Solar Pro | upstage/solar-pro-preview-instruct 等。 | ✅︎ | ✅︎ |
StableLmForCausalLM | StableLM | stabilityai/stablelm-3b-4e1t, stabilityai/stablelm-base-alpha-7b-v2 等。 | ||
StableLMEpochForCausalLM | StableLM Epoch | stabilityai/stablelm-zephyr-3b 等。 | ✅︎ | |
Starcoder2ForCausalLM | Starcoder2 | bigcode/starcoder2-3b, bigcode/starcoder2-7b, bigcode/starcoder2-15b 等。 | ✅︎ | |
Step1ForCausalLM | Step-Audio | stepfun-ai/Step-Audio-EditX 等。 | ✅︎ | ✅︎ |
Step3p5ForCausalLM | Step-3.5-flash | stepfun-ai/Step-3.5-Flash 等。 | ✅︎ | |
TeleChatForCausalLM | TeleChat | chuhac/TeleChat2-35B 等。 | ✅︎ | ✅︎ |
TeleChat2ForCausalLM | TeleChat2 | Tele-AI/TeleChat2-3B, Tele-AI/TeleChat2-7B, Tele-AI/TeleChat2-35B 等。 | ✅︎ | ✅︎ |
TeleChat3ForCausalLM | TeleChat3 | Tele-AI/TeleChat3-36B-Thinking, Tele-AI/TeleChat3-Coder-36B-Thinking 等。 | ✅︎ | ✅︎ |
TeleFLMForCausalLM | TeleFLM | CofeAI/FLM-2-52B-Instruct-2407, CofeAI/Tele-FLM 等。 | ✅︎ | ✅︎ |
XverseForCausalLM | XVERSE | xverse/XVERSE-7B-Chat, xverse/XVERSE-13B-Chat, xverse/XVERSE-65B-Chat 等。 | ✅︎ | ✅︎ |
MiniMaxM1ForCausalLM | MiniMax-Text | MiniMaxAI/MiniMax-M1-40k, MiniMaxAI/MiniMax-M1-80k 等。 | ||
MiniMaxText01ForCausalLM | MiniMax-Text | MiniMaxAI/MiniMax-Text-01 等。 | ||
Zamba2ForCausalLM | Zamba2 | Zyphra/Zamba2-7B-instruct, Zyphra/Zamba2-2.7B-instruct, Zyphra/Zamba2-1.2B-instruct 等。 |
注意
Grok2 需要安装 tiktoken 并拥有 tokenizer.tok.json。您可以选择使用 moe_router_renormalize 来覆盖 MoE 路由器的重归一化。
有些模型仅通过Transformers 建模后端支持。下表的目的是为了承认我们以这种方式正式支持的模型。日志将说明正在使用 Transformers 建模后端,并且您不会看到这是回退行为的警告。这意味着,如果您在使用下表中列出的任何模型时遇到问题,请提交一个 issue,我们将尽力修复它!
| 架构 | 模型 | 示例 HF 模型 | LoRA | PP |
|---|---|---|---|---|
SmolLM3ForCausalLM | SmolLM3 | HuggingFaceTB/SmolLM3-3B | ✅︎ | ✅︎ |
注意
目前,ROCm 版本的 vLLM 仅在上下文长度不超过 4096 时支持 Mistral 和 Mixtral。
多模态语言模型列表¶
根据模型的不同,支持以下模态
- Text(文本)
- Image(图像)
- Video(视频)
- Audio(音频)
支持由 + 连接的模态的任何组合。
- 例如:
T + I意味着该模型支持纯文本、纯图像以及文本加图像输入。
另一方面,由 / 分隔的模态是互斥的。
- 例如:
T / I意味着该模型支持纯文本和纯图像输入,但不支持文本加图像输入。
请参阅此页面了解如何将多模态输入传递给模型。
提示
对于像 Llama-4、Step3、Mistral-3 和 Qwen-3.5 这样的仅混合模型,可以通过将所有支持的多模态模态设置为 0 (--language-model-only) 来启用纯文本模式,这样它们的那些多模态模块就不会被加载,从而为 KV 缓存释放更多的 GPU 显存。
注意
vLLM 目前支持为大多数多模态模型的语言主干添加 LoRA 适配器。此外,vLLM 现在实验性地支持为某些多模态模型的塔式(tower)和连接器(connector)模块添加 LoRA。参见此页面。
生成式模型¶
有关如何使用生成式模型的更多信息,请参阅此页面。
文本生成¶
这些模型主要接受 LLM.generate API。Chat/Instruct 模型额外支持 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 等。 | ✅︎ | |
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 等。 | ✅︎ | ✅︎ |
ChameleonForConditionalGeneration | Chameleon | T + I | facebook/chameleon-7b 等。 | ✅︎ | |
CheersForConditionalGeneration | Cheers | T + I | ai9stars/Cheers | ✅︎ | |
Cohere2VisionForConditionalGeneration | Command A Vision | T + I+ | CohereLabs/command-a-vision-07-2025 等。 | ✅︎ | |
DeepseekVLV2ForCausalLM | DeepSeek-VL2 | T + I+ | deepseek-ai/deepseek-vl2-tiny, deepseek-ai/deepseek-vl2-small, deepseek-ai/deepseek-vl2 等。 | ✅︎ | |
DeepseekOCRForCausalLM | DeepSeek-OCR | T + I+ | deepseek-ai/DeepSeek-OCR 等。 | ✅︎ | ✅︎ |
DeepseekOCR2ForCausalLM | DeepSeek-OCR-2 | T + I+ | deepseek-ai/DeepSeek-OCR-2 等。 | ✅︎ | ✅︎ |
Eagle2_5_VLForConditionalGeneration | Eagle2.5-VL | T + IE+ | nvidia/Eagle2.5-8B 等。 | ✅︎ | ✅︎ |
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 | ✅︎ | |
Exaone4_5_ForConditionalGeneration | EXAONE-4.5 | T + IE+ | LGAI-EXAONE/EXAONE-4.5-33B 等。 | ✅︎ | ✅︎ |
FuyuForCausalLM | Fuyu | T + I | adept/fuyu-8b 等。 | ✅︎ | |
Gemma3ForConditionalGeneration | Gemma 3 | T + IE+ | google/gemma-3-4b-it, google/gemma-3-27b-it 等。 | ✅︎ | ✅︎ |
Gemma3nForConditionalGeneration | Gemma 3n | T + I + A | google/gemma-3n-E2B-it, google/gemma-3n-E4B-it 等。 | ||
GLM4VForCausalLM^ | GLM-4V | T + I | zai-org/glm-4v-9b, zai-org/cogagent-9b-20241220 等。 | ✅︎ | ✅︎ |
Glm4vForConditionalGeneration | GLM-4.1V-Thinking | T + IE+ + VE+ | zai-org/GLM-4.1V-9B-Thinking 等。 | ✅︎ | ✅︎ |
Glm4vMoeForConditionalGeneration | GLM-4.5V | T + IE+ + VE+ | zai-org/GLM-4.5V 等。 | ✅︎ | ✅︎ |
GlmOcrForConditionalGeneration | GLM-OCR | T + IE+ | zai-org/GLM-OCR 等。 | ✅︎ | ✅︎ |
GraniteSpeechForConditionalGeneration | Granite Speech | T + A | ibm-granite/granite-speech-3.3-8b | ✅︎ | ✅︎ |
HCXVisionForCausalLM | HyperCLOVAX-SEED-Vision-Instruct-3B | T + I+ + V+ | naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B | ||
HCXVisionV2ForCausalLM | HyperCLOVAX-SEED-Think-32B | T + I+ + V+ | naver-hyperclovax/HyperCLOVAX-SEED-Think-32B | ||
H2OVLChatModel | H2OVL | T + IE+ | h2oai/h2ovl-mississippi-800m, h2oai/h2ovl-mississippi-2b 等。 | ✅︎ | ✅︎ |
HunYuanVLForConditionalGeneration | HunyuanOCR | T + IE+ | tencent/HunyuanOCR 等。 | ✅︎ | ✅︎ |
Idefics3ForConditionalGeneration | Idefics3 | T + I | HuggingFaceM4/Idefics3-8B-Llama3 等。 | ✅︎ | |
IsaacForConditionalGeneration | Isaac | T + I+ | PerceptronAI/Isaac-0.1 | ✅︎ | ✅︎ |
InternS1ForConditionalGeneration | Intern-S1 | T + IE+ + VE+ | internlm/Intern-S1, internlm/Intern-S1-mini 等。 | ✅︎ | ✅︎ |
InternS1ProForConditionalGeneration | Intern-S1-Pro | T + IE+ + VE+ | internlm/Intern-S1-Pro 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
InternVLForConditionalGeneration | InternVL 3.0 (HF 格式) | T + IE+ + VE+ | OpenGVLab/InternVL3-1B-hf 等。 | ✅︎ | ✅︎ |
KananaVForConditionalGeneration | Kanana-V | T + I+ | kakaocorp/kanana-1.5-v-3b-instruct 等。 | ✅︎ | |
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 | ✅︎ | ✅︎ |
KimiAudioForConditionalGeneration | Kimi-Audio | T + A+ | moonshotai/Kimi-Audio-7B-Instruct | ✅︎ | |
KimiK25ForConditionalGeneration | Kimi-K2.5 | T + I+ | moonshotai/Kimi-K2.5 | ✅︎ | |
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 等。 | ✅︎ | ✅︎ |
Lfm2VlForConditionalGeneration | LFM2-VL | T + I+ | LiquidAI/LFM2-VL-450M, LiquidAI/LFM2-VL-3B, LiquidAI/LFM2-VL-8B-A1B 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
LlavaNextForConditionalGeneration | LLaVA-NeXT, Granite Vision | T + IE+ | llava-hf/llava-v1.6-mistral-7b-hf, llava-hf/llava-v1.6-vicuna-7b-hf, ibm-granite/granite-vision-3.3-2b 等。 | ✅︎ | |
LlavaNextVideoForConditionalGeneration | LLaVA-NeXT-Video | T + V | llava-hf/LLaVA-NeXT-Video-7B-hf 等。 | ✅︎ | |
LlavaOnevisionForConditionalGeneration | LLaVA-Onevision | T + I+ + V+ | llava-hf/llava-onevision-qwen2-7b-ov-hf, llava-hf/llava-onevision-qwen2-0.5b-ov-hf 等。 | ✅︎ | |
MiDashengLMModel | MiDashengLM | T + A+ | mispeech/midashenglm-7b | ✅︎ | |
MiniCPMO | MiniCPM-O | T + IE+ + VE+ + AE+ | openbmb/MiniCPM-o-2_6 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | |
MiniMaxVL01ForConditionalGeneration | MiniMax-VL | T + IE+ | MiniMaxAI/MiniMax-VL-01 等。 | ✅︎ | |
Mistral3ForConditionalGeneration | Mistral3 (HF Transformers) | T + I+ | mistralai/Mistral-Small-3.1-24B-Instruct-2503 等。 | ✅︎ | ✅︎ |
MolmoForCausalLM | Molmo | T + I+ | allenai/Molmo-7B-D-0924, allenai/Molmo-7B-O-0924 等。 | ✅︎ | ✅︎ |
Molmo2ForConditionalGeneration | Molmo2 | T + I+ / V | allenai/Molmo2-4B, allenai/Molmo2-8B, allenai/Molmo2-O-7B | ✅︎ | ✅︎ |
MusicFlamingoForConditionalGeneration | MusicFlamingo | T + A | nvidia/music-flamingo-2601-hf, nvidia/music-flamingo-think-2601-hf | ✅︎ | ✅︎ |
NVLM_D_Model | NVLM-D 1.0 | T + I+ | nvidia/NVLM-D-72B 等。 | ✅︎ | |
OpenCUAForConditionalGeneration | OpenCUA-7B | T + IE+ | xlangai/OpenCUA-7B | ✅︎ | ✅︎ |
OpenPanguVLForConditionalGeneration | openpangu-VL | T + IE+ + VE+ | FreedomIntelligence/openPangu-VL-7B | ✅︎ | ✅︎ |
Ovis | Ovis2, Ovis1.6 | T + I+ | AIDC-AI/Ovis2-1B, AIDC-AI/Ovis1.6-Llama3.2-3B 等。 | ✅︎ | |
Ovis2_5 | Ovis2.5 | T + I+ + V | AIDC-AI/Ovis2.5-9B 等。 | ||
Ovis2_6ForCausalLM | Ovis2.6 | T + I+ + V | AIDC-AI/Ovis2.6-2B 等。 | ||
Ovis2_6_MoeForCausalLM | Ovis2.6 | T + I+ + V | AIDC-AI/Ovis2.6-30B-A3B 等。 | ||
PaddleOCRVLForConditionalGeneration | Paddle-OCR | T + I+ | PaddlePaddle/PaddleOCR-VL 等。 | ||
PaliGemmaForConditionalGeneration | PaliGemma, PaliGemma 2 | T + IE | google/paligemma-3b-pt-224, google/paligemma-3b-mix-224, google/paligemma2-3b-ft-docci-448 等。 | ✅︎ | ✅︎ |
Phi3VForCausalLM | Phi-3-Vision, Phi-3.5-Vision | T + IE+ | microsoft/Phi-3-vision-128k-instruct, microsoft/Phi-3.5-vision-instruct 等。 | ✅︎ | |
Phi4MMForCausalLM | Phi-4-multimodal | T + I+ / T + A+ / I+ + A+ | microsoft/Phi-4-multimodal-instruct 等。 | ✅︎ | ✅︎ |
Phi4ForCausalLMV | Phi-4-reasoning-vision | T + I+ | microsoft/Phi-4-reasoning-vision-15B 等。 | ✅︎ | |
PixtralForConditionalGeneration | Ministral 3 (Mistral 格式), Mistral 3 (Mistral 格式), Mistral Large 3 (Mistral 格式), Pixtral (Mistral 格式) | 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 等。 | ✅︎ | ✅︎ |
QwenVLForConditionalGeneration^ | Qwen-VL | T + IE+ | Qwen/Qwen-VL, Qwen/Qwen-VL-Chat 等。 | ✅︎ | ✅︎ |
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 等。 | ✅︎ | ✅︎ |
Qwen2_5_VLForConditionalGeneration | Qwen2.5-VL | T + IE+ + VE+ | Qwen/Qwen2.5-VL-3B-Instruct, Qwen/Qwen2.5-VL-72B-Instruct 等。 | ✅︎ | ✅︎ |
Qwen2_5OmniThinkerForConditionalGeneration | Qwen2.5-Omni | T + IE+ + VE+ + A+ | Qwen/Qwen2.5-Omni-3B, Qwen/Qwen2.5-Omni-7B | ✅︎ | ✅︎ |
Qwen3_5ForConditionalGeneration | Qwen3.5 | T + IE+ + VE+ | Qwen/Qwen3.5-9B-Instruct 等。 | ✅︎ | ✅︎ |
Qwen3_5MoeForConditionalGeneration | Qwen3.5-MOE | T + IE+ + VE+ | Qwen/Qwen3.5-35B-A3B-Instruct 等。 | ✅︎ | ✅︎ |
Qwen3VLForConditionalGeneration | Qwen3-VL | T + IE+ + VE+ | Qwen/Qwen3-VL-4B-Instruct 等。 | ✅︎ | ✅︎ |
Qwen3VLMoeForConditionalGeneration | Qwen3-VL-MOE | T + IE+ + VE+ | Qwen/Qwen3-VL-30B-A3B-Instruct 等。 | ✅︎ | ✅︎ |
Qwen3OmniMoeThinkerForConditionalGeneration | Qwen3-Omni | T + IE+ + VE+ + A+ | Qwen/Qwen3-Omni-30B-A3B-Instruct, Qwen/Qwen3-Omni-30B-A3B-Thinking | ✅︎ | ✅︎ |
Qwen3ASRForConditionalGeneration | Qwen3-ASR | T + A+ | Qwen/Qwen3-ASR-1.7B | ✅︎ | ✅︎ |
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 | ✅︎ | |
StepVLForConditionalGeneration | Step3-VL-10B | T + I+ | stepfun-ai/Step3-VL-10B | ✅︎ | |
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 中的架构名称。
E 可以为此模态输入预计算的嵌入。
+ 对于此模态,每个文本提示可以输入多个条目。
注意
Gemma3nForConditionalGeneration 由于共享 KV 缓存仅在 V1 上受支持,且它依赖于 timm>=1.0.17 来利用其 MobileNet-v5 视觉主干。
性能尚未完全优化,主要原因是:
- 音频和视觉 MM 编码器都使用
transformers.AutoModel实现。 - 没有 PLE 缓存或内存溢出交换 (out-of-memory swapping) 支持,如谷歌博客中所述。这些功能对于 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 尚不可用,因此我们目前需要使用分支版本 (HwwwH/MiniCPM-V-2)。有关详细信息,请参阅: Pull Request #4087
转录¶
专门为自动语音识别训练的 Speech2Text 模型。
| 架构 | 模型 | 示例 HF 模型 | LoRA | PP |
|---|---|---|---|---|
CohereAsrForConditionalGeneration | Cohere-Transcribe | CohereLabs/cohere-transcribe-03-2026 | ||
FireRedASR2ForConditionalGeneration | FireRedASR2 | allendou/FireRedASR2-LLM-vllm 等。 | ||
FireRedLIDForConditionalGeneration | FireRedLID | PatchyTisa/FireRedLID-vllm 等。 | ||
FunASRForConditionalGeneration | FunASR | allendou/Fun-ASR-Nano-2512-vllm 等。 | ||
Gemma3nForConditionalGeneration | Gemma3n | google/gemma-3n-E2B-it, google/gemma-3n-E4B-it 等。 | ||
GlmAsrForConditionalGeneration | GLM-ASR | zai-org/GLM-ASR-Nano-2512 | ✅︎ | ✅︎ |
GraniteSpeechForConditionalGeneration | Granite Speech | ibm-granite/granite-4.0-1b-speech, ibm-granite/granite-speech-3.3-2b 等。 | ✅︎ | ✅︎ |
Qwen3ASRForConditionalGeneration | Qwen3-ASR | Qwen/Qwen3-ASR-1.7B 等。 | ✅︎ | ✅︎ |
Qwen3OmniMoeThinkerForConditionalGeneration | Qwen3-Omni | Qwen/Qwen3-Omni-30B-A3B-Instruct 等。 | ✅︎ | |
VoxtralForConditionalGeneration | Voxtral (Mistral 格式) | mistralai/Voxtral-Mini-3B-2507, mistralai/Voxtral-Small-24B-2507 等。 | ✅︎ | ✅︎ |
WhisperForConditionalGeneration | Whisper | openai/whisper-small, openai/whisper-large-v3-turbo 等。 |
注意
VoxtralForConditionalGeneration 需要安装 mistral-common[audio]。
池化模型¶
请参阅此页面以了解有关如何使用池化模型的更多信息。
重要
由于某些模型架构同时支持生成式和池化任务,您应该显式指定 --runner pooling 以确保模型以池化模式而不是生成模式使用。
有关支持特定池化任务的模型的信息,请参阅下方链接。
模型支持策略¶
在 vLLM,我们致力于促进第三方模型在我们生态系统中的整合与支持。我们的方法旨在平衡稳健性的需求与支持广泛模型的实际限制。以下是我们管理第三方模型支持的方式:
-
社区驱动的支持:我们鼓励社区贡献以添加新模型。当用户请求支持新模型时,我们欢迎来自社区的拉取请求 (PR)。这些贡献的评估主要基于它们生成输出的合理性,而不是与现有的实现(如 transformers 中的实现)的严格一致性。号召贡献: 直接来自模型供应商的 PR 将深表感谢!
-
尽力而为的一致性:虽然我们力求在 vLLM 中实现的模型与 transformers 等其他框架之间保持一定程度的一致性,但完全对齐并不总是可行的。加速技术的使用和低精度计算等因素可能会引入差异。我们的承诺是确保实现的模型功能正常并产生合理的结果。
提示
当比较来自 Hugging Face Transformers 的
model.generate输出与来自 vLLM 的llm.generate输出时,请注意前者会读取模型的生成配置文件(即 generation_config.json)并应用默认参数进行生成,而后者仅使用传递给函数的参数。在比较输出时,请确保所有采样参数完全一致。 -
问题解决与模型更新:鼓励用户报告他们在第三方模型中遇到的任何错误或问题。建议的修复应通过 PR 提交,并对问题进行清晰的解释,并说明所提方案背后的理由。如果对一个模型的修复影响了另一个模型,我们依赖社区来突出并解决这些跨模型依赖关系。注意:对于错误修复 PR,通知原作者以寻求其反馈是良好的礼仪。
-
监控与更新:对特定模型感兴趣的用户应监控这些模型的提交历史(例如,通过跟踪 main/vllm/model_executor/models 目录中的更改)。这种主动的方法有助于用户及时了解可能影响他们所使用模型的更新和更改。
-
重点关注:我们的资源主要投入到具有重大用户关注度和影响力的模型上。使用频率较低的模型可能会得到较少的关注,我们依赖社区在它们的维护和改进中发挥更积极的作用。
通过这种方法,vLLM 营造了一个协作环境,核心开发团队和广大社区共同为我们生态系统中支持的第三方模型的稳健性和多样性做出贡献。
请注意,作为推理引擎,vLLM 不会引入新模型。因此,vLLM 支持的所有模型在这方面都是第三方模型。
我们对模型有以下几个级别的测试:
- 严格一致性:我们在贪婪解码下将模型的输出与 HuggingFace Transformers 库中的模型输出进行比较。这是最严格的测试。请参考 模型测试 以了解通过此测试的模型。
- 输出合理性:我们通过测量输出的困惑度 (perplexity) 并检查任何明显的错误,来检查模型的输出是否合理且连贯。这是一个不那么严格的测试。
- 运行时功能性:我们检查模型是否可以在没有错误的情况下加载和运行。这是最不严格的测试。请参考 功能测试 和 示例 以了解通过此测试的模型。
- 社区反馈:我们依赖社区提供关于模型的反馈。如果某个模型损坏或未按预期工作,我们鼓励用户提出 issue 报告或开启 PR 进行修复。其余模型均属于此类别。