支持的模型¶
vLLM 支持各种任务的生成式和池化模型。如果一个模型支持多项任务,您可以通过 --task
参数设置任务。
对于每项任务,我们列出了在 vLLM 中已实现的模型架构。在每个架构旁边,我们还会包含一些使用该架构的流行模型。
模型实现¶
vLLM¶
如果 vLLM 原生支持某个模型,其实现可以在 vllm/model_executor/models 中找到。
这些模型是我们列在supported-text-models 和supported-mm-models 中的模型。
Transformers¶
vLLM 还支持 Transformers 中可用的模型实现。目前并非所有模型都支持,但大多数解码器语言模型和常见的视觉语言模型都受到支持!视觉语言模型目前仅接受图像输入。未来版本将增加对视频输入的支持。
要检查建模后端是否为 Transformers,您可以简单地执行以下操作:
from vllm import LLM
llm = LLM(model=..., task="generate") # Name or path of your model
llm.apply_model(lambda model: print(type(model)))
如果是 TransformersForCausalLM
或 TransformersForMultimodalLM
,则表示它基于 Transformers!
提示
您可以通过为离线推理设置 model_impl="transformers"
或为OpenAI 兼容服务器设置 --model-impl transformers
来强制使用 TransformersForCausalLM
。
注意
vLLM 可能无法完全优化 Transformers 的实现,因此,如果将原生模型与 vLLM 中的 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
中)。
- 定制应在基础模型中完成(例如在
如果兼容模型在
- 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
通过所有模块传递。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):
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,
)
...
class MyModel(PreTrainedModel):
_supports_attention_backend = True
加载此模型时后台发生的情况如下:
- 配置已加载。
- 从配置中的
auto_map
加载MyModel
Python 类,并检查模型是否is_backend_compatible()
。 MyModel
被加载到TransformersForCausalLM
或TransformersForMultimodalLM
中(参见 vllm/model_executor/models/transformers.py),它设置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
,它将直接子层名称映射到tuple
类型的list
列表,其中包含str
- 您只需要对未在所有流水线阶段都存在的层执行此操作
- 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 (task=generate) only
llm = LLM(model=..., task="generate") # Name or path of your model
output = llm.generate("Hello, my name is")
print(output)
# For pooling models (task={embed,classify,reward,score}) only
llm = LLM(model=..., task="embed") # Name or path of your model
output = llm.encode("Hello, my name is")
print(output)
如果 vLLM 成功返回文本(对于生成模型)或隐藏状态(对于池化模型),则表示您的模型受支持。
否则,请参阅添加新模型以获取如何在 vLLM 中实现您的模型的说明。另外,您也可以在 GitHub 上提交问题以请求 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 加载/下载模型的一些提示:
- 为您的会话全局设置代理(或在配置文件中设置)
- 仅为当前命令设置代理
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> --disable-log-requests
- 在 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=..., task=..., trust_remote_code=True)
# For generative models (task=generate) only
output = llm.generate("Hello, my name is")
print(output)
# For pooling models (task={embed,classify,reward,score}) only
output = llm.encode("Hello, my name is")
print(output)
功能状态图例¶
-
✅︎ 表示该模型支持此功能。
-
🚧 表示该功能已计划但尚未支持该模型。
-
⚠️ 表示该功能可用,但可能存在已知问题或限制。
仅文本语言模型列表¶
生成模型¶
有关如何使用生成模型的更多信息,请参见此页面。
文本生成¶
使用 --task generate
指定。
架构 | 模型 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|
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 , 等。 |
✅︎ | ✅︎ | |
BaiChuanForCausalLM |
Baichuan2, Baichuan | baichuan-inc/Baichuan2-13B-Chat , baichuan-inc/Baichuan-7B , 等。 |
✅︎ | ✅︎ | ✅︎ |
BailingMoeForCausalLM |
Ling | inclusionAI/Ling-lite-1.5 , inclusionAI/Ling-plus , 等。 |
✅︎ | ✅︎ | ✅︎ |
BambaForCausalLM |
Bamba | ibm-ai-platform/Bamba-9B-fp8 , ibm-ai-platform/Bamba-9B |
✅︎ | ✅︎ | ✅︎ |
BloomForCausalLM |
BLOOM, BLOOMZ, BLOOMChat | bigscience/bloom , bigscience/bloomz , 等。 |
✅︎ | ||
BartForConditionalGeneration |
BART | facebook/bart-base , facebook/bart-large-cnn , 等。 |
|||
ChatGLMModel , ChatGLMForConditionalGeneration |
ChatGLM | THUDM/chatglm2-6b , THUDM/chatglm3-6b , ShieldLM-6B-chatglm3 , 等。 |
✅︎ | ✅︎ | ✅︎ |
CohereForCausalLM , Cohere2ForCausalLM |
Command-R | CohereForAI/c4ai-command-r-v01 , CohereForAI/c4ai-command-r7b-12-2024 , 等。 |
✅︎ | ✅︎ | ✅︎ |
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-Base , deepseek-ai/DeepSeek-V3 , 等。 |
✅︎ | ✅︎ | |
Dots1ForCausalLM |
dots.llm1 | rednote-hilab/dots.llm1.base , rednote-hilab/dots.llm1.inst , 等。 |
✅︎ | ✅︎ | |
Ernie4_5_ForCausalLM |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
Gemma3nForConditionalGeneration |
Gemma 3n | google/gemma-3n-E2B-it , google/gemma-3n-E4B-it , 等。 |
✅︎ | ||
GlmForCausalLM |
GLM-4 | THUDM/glm-4-9b-chat-hf , 等。 |
✅︎ | ✅︎ | ✅︎ |
Glm4ForCausalLM |
GLM-4-0414 | THUDM/GLM-4-32B-0414 , 等。 |
✅︎ | ✅︎ | ✅︎ |
GPT2LMHeadModel |
GPT-2 | gpt2 , 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 , 等。 |
✅︎ | ✅︎ | |
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 . |
✅︎ | ✅︎ | ✅︎ |
HunYuanDenseV1ForCausalLM |
Hunyuan-7B-Instruct-0124 | tencent/Hunyuan-7B-Instruct-0124 |
✅︎ | ✅︎ | |
HunYuanMoEV1ForCausalLM |
Hunyuan-80B-A13B | tencent/Hunyuan-A13B-Instruct , tencent/Hunyuan-A13B-Pretrain , tencent/Hunyuan-A13B-Instruct-FP8 , 等。 |
✅︎ | ✅︎ | |
HCXVisionForCausalLM |
HyperCLOVAX-SEED-Vision-Instruct-3B | naver-hyperclovax/HyperCLOVAX-SEED-Vision-Instruct-3B |
✅︎ | ||
InternLMForCausalLM |
InternLM | internlm/internlm-7b , internlm/internlm-chat-7b , 等。 |
✅︎ | ✅︎ | ✅︎ |
InternLM2ForCausalLM |
InternLM2 | internlm/internlm2-7b , internlm/internlm2-chat-7b , 等。 |
✅︎ | ✅︎ | ✅︎ |
InternLM3ForCausalLM |
InternLM3 | internlm/internlm3-8b-instruct , 等。 |
✅︎ | ✅︎ | ✅︎ |
JAISLMHeadModel |
Jais | inceptionai/jais-13b , inceptionai/jais-13b-chat , inceptionai/jais-30b-v3 , inceptionai/jais-30b-chat-v3 , 等。 |
✅︎ | ✅︎ | |
JambaForCausalLM |
Jamba | ai21labs/AI21-Jamba-1.5-Large , ai21labs/AI21-Jamba-1.5-Mini , ai21labs/Jamba-v0.1 , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
MiniCPMForCausalLM |
MiniCPM | openbmb/MiniCPM-2B-sft-bf16 , openbmb/MiniCPM-2B-dpo-bf16 , openbmb/MiniCPM-S-1B-sft , 等。 |
✅︎ | ✅︎ | ✅︎ |
MiniCPM3ForCausalLM |
MiniCPM3 | openbmb/MiniCPM3-4B , 等。 |
✅︎ | ✅︎ | ✅︎ |
MistralForCausalLM |
Mistral, Mistral-Instruct | mistralai/Mistral-7B-v0.1 , mistralai/Mistral-7B-Instruct-v0.1 , 等。 |
✅︎ | ✅︎ | ✅︎ |
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 , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
Phi4FlashForCausalLM |
Phi-4-mini-flash-reasoning | microsoft/microsoft/Phi-4-mini-instruct , 等。 |
|||
PersimmonForCausalLM |
Persimmon | adept/persimmon-8b-base , adept/persimmon-8b-chat , 等。 |
✅︎ | ✅︎ | |
Plamo2ForCausalLM |
PLaMo2 | pfnet/plamo-2-1b , pfnet/plamo-2-8b , 等。 |
|||
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
StableLmForCausalLM |
StableLM | stabilityai/stablelm-3b-4e1t , stabilityai/stablelm-base-alpha-7b-v2 , 等。 |
✅︎ | ||
Starcoder2ForCausalLM |
Starcoder2 | bigcode/starcoder2-3b , bigcode/starcoder2-7b , bigcode/starcoder2-15b , 等。 |
✅︎ | ✅︎ | |
SolarForCausalLM |
Solar Pro | upstage/solar-pro-preview-instruct , 等。 |
✅︎ | ✅︎ | ✅︎ |
TeleChat2ForCausalLM |
TeleChat2 | Tele-AI/TeleChat2-3B , Tele-AI/TeleChat2-7B , Tele-AI/TeleChat2-35B , 等。 |
✅︎ | ✅︎ | ✅︎ |
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 , 等。 |
✅︎ |
注意
目前,vLLM 的 ROCm 版本仅支持 Mistral 和 Mixtral,上下文长度最长为 4096。
注意
Gemma3nForConditionalGeneration
目前仅支持文本输入。要使用此模型,请将 Hugging Face Transformers 升级到 4.53.0 版本。
池化模型¶
有关如何使用池化模型的更多信息,请参见此页面。
重要
由于某些模型架构同时支持生成任务和池化任务,您应该明确指定任务类型,以确保模型在池化模式而非生成模式下使用。
文本嵌入¶
使用 --task embed
指定。
架构 | 模型 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|
BertModel |
基于 BERT | BAAI/bge-base-en-v1.5 , Snowflake/snowflake-arctic-embed-xs , 等。 |
|||
Gemma2Model |
基于 Gemma 2 | BAAI/bge-multilingual-gemma2 , 等。 |
✅︎ | ✅︎ | |
GritLM |
GritLM | parasail-ai/GritLM-7B-vllm . |
✅︎ | ✅︎ | |
GteModel |
Arctic-Embed-2.0-M | Snowflake/snowflake-arctic-embed-m-v2.0 . |
|||
GteNewModel |
mGTE-TRM (参见注意) | Alibaba-NLP/gte-multilingual-base , 等。 |
|||
ModernBertModel |
基于 ModernBERT | Alibaba-NLP/gte-modernbert-base , 等。 |
|||
NomicBertModel |
Nomic BERT | nomic-ai/nomic-embed-text-v1 , nomic-ai/nomic-embed-text-v2-moe , Snowflake/snowflake-arctic-embed-m-long , 等。 |
|||
LlamaModel , LlamaForCausalLM , MistralModel , 等。 |
基于 Llama | intfloat/e5-mistral-7b-instruct , 等。 |
✅︎ | ✅︎ | ✅︎ |
Qwen2Model , Qwen2ForCausalLM |
基于 Qwen2 | ssmits/Qwen2-7B-Instruct-embed-base (参见注意), Alibaba-NLP/gte-Qwen2-7B-instruct (参见注意), 等。 |
✅︎ | ✅︎ | ✅︎ |
Qwen3Model , Qwen3ForCausalLM |
基于 Qwen3 | Qwen/Qwen3-Embedding-0.6B , 等。 |
✅︎ | ✅︎ | ✅︎ |
RobertaModel , RobertaForMaskedLM |
基于 RoBERTa | sentence-transformers/all-roberta-large-v1 , 等。 |
注意
ssmits/Qwen2-7B-Instruct-embed-base
的 Sentence Transformers 配置定义不正确。您需要通过传递 --override-pooler-config '{"pooling_type": "MEAN"}'
手动设置均值池化。
注意
对于 Alibaba-NLP/gte-Qwen2-*
,您需要启用 --trust-remote-code
才能正确加载分词器。请参阅 HF Transformers 上的相关问题。
注意
jinaai/jina-embeddings-v3
通过 LoRA 支持多任务,而 vllm 暂时只通过合并 LoRA 权重支持文本匹配任务。
注意
第二代 GTE 模型 (mGTE-TRM) 被命名为 NewModel
。NewModel
这个名字太通用了,您应该设置 --hf-overrides '{"architectures": ["GteNewModel"]}'
来指定使用 GteNewModel
架构。
如果您的模型不在上述列表中,我们将尝试使用 as_embedding_model 自动转换模型。默认情况下,整个提示的嵌入是从与最后一个 token 对应的归一化隐藏状态中提取的。
奖励模型¶
使用 --task reward
指定。
架构 | 模型 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|
InternLM2ForRewardModel |
基于 InternLM2 | internlm/internlm2-1_8b-reward , internlm/internlm2-7b-reward , 等。 |
✅︎ | ✅︎ | ✅︎ |
LlamaForCausalLM |
基于 Llama | peiyi9979/math-shepherd-mistral-7b-prm , 等。 |
✅︎ | ✅︎ | ✅︎ |
Qwen2ForRewardModel |
基于 Qwen2 | Qwen/Qwen2.5-Math-RM-72B , 等。 |
✅︎ | ✅︎ | ✅︎ |
Qwen2ForProcessRewardModel |
基于 Qwen2 | Qwen/Qwen2.5-Math-PRM-7B , 等。 |
✅︎ | ✅︎ | ✅︎ |
如果您的模型不在上述列表中,我们将尝试使用 as_reward_model 自动转换模型。默认情况下,我们直接返回每个 token 的隐藏状态。
重要
对于过程监督的奖励模型,例如 peiyi9979/math-shepherd-mistral-7b-prm
,应明确设置池化配置,例如:--override-pooler-config '{"pooling_type": "STEP", "step_tag_id": 123, "returned_token_ids": [456, 789]}'
。
分类¶
使用 --task classify
指定。
架构 | 模型 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|
JambaForSequenceClassification |
Jamba | ai21labs/Jamba-tiny-reward-dev , 等。 |
✅︎ | ✅︎ | |
GPT2ForSequenceClassification |
GPT2 | nie3e/sentiment-polish-gpt2-small |
✅︎ |
如果您的模型不在上述列表中,我们将尝试使用 as_seq_cls_model 自动转换模型。默认情况下,类别概率是从与最后一个 token 对应的 softmaxed 隐藏状态中提取的。
句子对评分¶
使用 --task score
指定。
架构 | 模型 | 示例 HF 模型 | V1 |
---|---|---|---|
BertForSequenceClassification |
基于 BERT | cross-encoder/ms-marco-MiniLM-L-6-v2 , 等。 |
|
GemmaForSequenceClassification |
基于 Gemma | BAAI/bge-reranker-v2-gemma (参见注意), 等。 |
|
Qwen2ForSequenceClassification |
基于 Qwen2 | mixedbread-ai/mxbai-rerank-base-v2 (参见注意), 等。 |
✅︎ |
Qwen3ForSequenceClassification |
基于 Qwen3 | tomaarsen/Qwen3-Reranker-0.6B-seq-cls , Qwen/Qwen3-Reranker-0.6B (参见注意), 等。 |
✅︎ |
RobertaForSequenceClassification |
基于 RoBERTa | cross-encoder/quora-roberta-base , 等。 |
|
XLMRobertaForSequenceClassification |
基于 XLM-RoBERTa | BAAI/bge-reranker-v2-m3 , 等。 |
注意
使用以下命令加载官方原始的 BAAI/bge-reranker-v2-gemma
。
注意
使用以下命令加载官方原始的 mxbai-rerank-v2
。
注意
使用以下命令加载官方原始的 Qwen3 Reranker
。更多信息请参见: examples/offline_inference/qwen3_reranker.py。
多模态语言模型列表¶
根据模型,支持以下模态
- Text (文本)
- Image (图像)
- Video (视频)
- Audio (音频)
支持由 +
连接的任意模态组合。
- 例如:
T + I
意味着模型支持纯文本输入、纯图像输入以及文本与图像混合输入。
另一方面,由 /
分隔的模态是互斥的。
- 例如:
T / I
意味着模型支持纯文本输入和纯图像输入,但不支持文本与图像混合输入。
有关如何将多模态输入传递给模型的详细信息,请参见此页面。
重要
要在 vLLM V0 中为每个文本提示启用多个多模态项目,您必须设置 limit_mm_per_prompt
(离线推理)或 --limit-mm-per-prompt
(在线服务)。例如,要为每个文本提示传递最多 4 张图像
离线推理
from vllm import LLM
llm = LLM(
model="Qwen/Qwen2-VL-7B-Instruct",
limit_mm_per_prompt={"image": 4},
)
在线服务
如果您使用的是 vLLM V1,则不再需要此项。
注意
vLLM 目前仅支持将 LoRA 添加到多模态模型的语言骨干。
生成模型¶
有关如何使用生成模型的更多信息,请参见此页面。
文本生成¶
使用 --task generate
指定。
架构 | 模型 | 输入 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|---|
AriaForConditionalGeneration |
Aria | T + I+ | rhymes-ai/Aria |
✅︎ | ||
AyaVisionForConditionalGeneration |
Aya Vision | T + I+ | CohereForAI/aya-vision-8b , CohereForAI/aya-vision-32b , 等。 |
✅︎ | ✅︎ | |
Blip2ForConditionalGeneration |
BLIP-2 | T + IE | Salesforce/blip2-opt-2.7b , Salesforce/blip2-opt-6.7b , 等。 |
✅︎ | ✅︎ | |
ChameleonForConditionalGeneration |
Chameleon | T + I | facebook/chameleon-7b , 等。 |
✅︎ | ✅︎ | |
DeepseekVLV2ForCausalLM ^ |
DeepSeek-VL2 | T + I+ | deepseek-ai/deepseek-vl2-tiny , deepseek-ai/deepseek-vl2-small , deepseek-ai/deepseek-vl2 , 等。 |
✅︎ | ✅︎ | |
Florence2ForConditionalGeneration |
Florence-2 | T + I | microsoft/Florence-2-base , microsoft/Florence-2-large , 等。 |
|||
FuyuForCausalLM |
Fuyu | T + I | adept/fuyu-8b , 等。 |
✅︎ | ✅︎ | |
Gemma3ForConditionalGeneration |
Gemma 3 | T + I+ | google/gemma-3-4b-it , google/gemma-3-27b-it , 等。 |
✅︎ | ✅︎ | ⚠️ |
GLM4VForCausalLM ^ |
GLM-4V | T + I | THUDM/glm-4v-9b , THUDM/cogagent-9b-20241220 , 等。 |
✅︎ | ✅︎ | ✅︎ |
Glm4vForConditionalGeneration |
GLM-4.1V-Thinking | T + IE+ + VE+ | THUDM/GLM-4.1V-9B-Thinking , 等。 |
✅︎ | ✅︎ | ✅︎ |
Glm4MoeForCausalLM |
GLM-4.5 | T + IE+ + VE+ | THUDM/GLM-4.5 , 等。 |
✅︎ | ✅︎ | ✅︎ |
GraniteSpeechForConditionalGeneration |
Granite Speech | T + A | ibm-granite/granite-speech-3.3-8b |
✅︎ | ✅︎ | ✅︎ |
H2OVLChatModel |
H2OVL | T + IE+ | h2oai/h2ovl-mississippi-800m , h2oai/h2ovl-mississippi-2b , 等。 |
✅︎ | ✅︎ | |
Idefics3ForConditionalGeneration |
Idefics3 | T + I | HuggingFaceM4/Idefics3-8B-Llama3 , 等。 |
✅︎ | ✅︎ | |
InternVLChatModel |
InternVL 3.0, InternVideo 2.5, InternVL 2.5, Mono-InternVL, InternVL 2.0 | T + IE+ + (VE+) | OpenGVLab/InternVL3-9B , OpenGVLab/InternVideo2_5_Chat_8B , OpenGVLab/InternVL2_5-4B , OpenGVLab/Mono-InternVL-2B , OpenGVLab/InternVL2-4B , 等。 |
✅︎ | ✅︎ | ✅︎ |
KeyeForConditionalGeneration |
Keye-VL-8B-Preview | T + IE+ + VE+ | Kwai-Keye/Keye-VL-8B-Preview |
✅︎ | ||
KimiVLForConditionalGeneration |
Kimi-VL-A3B-Instruct, Kimi-VL-A3B-Thinking | T + I+ | moonshotai/Kimi-VL-A3B-Instruct , moonshotai/Kimi-VL-A3B-Thinking |
✅︎ | ||
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 | T + IE+ | llava-hf/llava-v1.6-mistral-7b-hf , llava-hf/llava-v1.6-vicuna-7b-hf , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | |
MiniMaxVL01ForConditionalGeneration |
MiniMax-VL | T + IE+ | MiniMaxAI/MiniMax-VL-01 , 等。 |
✅︎ | ✅︎ | |
Mistral3ForConditionalGeneration |
Mistral3 (HF Transformers) | T + I+ | mistralai/Mistral-Small-3.1-24B-Instruct-2503 , 等。 |
✅︎ | ✅︎ | ✅︎ |
MllamaForConditionalGeneration |
Llama 3.2 | T + I+ | meta-llama/Llama-3.2-90B-Vision-Instruct , meta-llama/Llama-3.2-11B-Vision , 等。 |
|||
MolmoForCausalLM |
Molmo | T + I+ | allenai/Molmo-7B-D-0924 , allenai/Molmo-7B-O-0924 , 等。 |
✅︎ | ✅︎ | ✅︎ |
NVLM_D_Model |
NVLM-D 1.0 | T + I+ | nvidia/NVLM-D-72B , 等。 |
✅︎ | ✅︎ | |
Ovis |
Ovis2, Ovis1.6 | T + I+ | AIDC-AI/Ovis2-1B , AIDC-AI/Ovis1.6-Llama3.2-3B , 等。 |
✅︎ | ✅︎ | |
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 , 等。 |
✅︎ | ✅︎ | ✅︎ |
PixtralForConditionalGeneration |
Mistral 3 (Mistral 格式), Pixtral (Mistral 格式) | T + I+ | mistralai/Mistral-Small-3.1-24B-Instruct-2503 , 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-7B |
✅︎ | ✅︎ | |
SkyworkR1VChatModel |
Skywork-R1V-38B | T + I | Skywork/Skywork-R1V-38B |
✅︎ | ✅︎ | |
SmolVLMForConditionalGeneration |
SmolVLM2 | T + I | SmolVLM2-2.2B-Instruct |
✅︎ | ✅︎ | |
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 |
✅︎ | ✅︎ |
有些模型仅通过Transformers 后端支持。下表旨在确认我们正式以这种方式支持的模型。日志将显示正在使用 Transformers 后端,您不会看到任何关于这是回退行为的警告。这意味着,如果您在使用下列任何模型时遇到问题,请提交问题,我们将尽力解决!
架构 | 模型 | 输入 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|---|
Emu3ForConditionalGeneration |
Emu3 | T + I | BAAI/Emu3-Chat-hf |
✅︎ | ✅︎ | ✅︎ |
^ 您需要通过 --hf-overrides
设置架构名称,使其与 vLLM 中的名称匹配。
• 例如,要使用 DeepSeek-VL2 系列模型
--hf-overrides '{"architectures": ["DeepseekVLV2ForCausalLM"]}'
E 可以为该模态输入预计算的嵌入。
+ 可以为该模态的每个文本提示输入多个项目。
警告
V0 和 V1 都支持 Gemma3ForConditionalGeneration
的纯文本输入。然而,它们在处理文本+图像输入方面存在差异
V0 正确实现了模型的注意力模式: - 对同一图像的图像 token 之间使用双向注意力 - 对其他 token 使用因果注意力 - 通过(朴素的)PyTorch SDPA 和掩码张量实现 - 注意:对于包含图像的长提示,可能会占用大量内存
V1 目前使用简化的注意力模式: - 对所有 token(包括图像 token)使用因果注意力 - 生成的结果合理,但在文本+图像输入时与原始模型的注意力不匹配,尤其是在 {"do_pan_and_scan": true}
时 - 未来将更新以支持正确行为
存在此限制是因为模型的混合注意力模式(图像双向,其他因果)尚未受 vLLM 的注意力后端支持。
注意
目前只有带有 Qwen2.5 文本骨干的 InternVLChatModel
(OpenGVLab/InternVL3-2B
, OpenGVLab/InternVL2.5-1B
等) 支持视频输入。
注意
要使用 TIGER-Lab/Mantis-8B-siglip-llama3
,您在运行 vLLM 时必须传递 --hf_overrides '{"architectures": ["MantisForConditionalGeneration"]}'
。
警告
AllenAI/Molmo-7B-D-0924
的输出质量(尤其是在对象定位任务中)在最近的更新中有所下降。
为获得最佳效果,我们建议使用以下依赖版本(在 A10 和 L40 上测试)
依赖版本
# Core vLLM-compatible dependencies with Molmo accuracy setup (tested on L40)
torch==2.5.1
torchvision==0.20.1
transformers==4.48.1
tokenizers==0.21.0
tiktoken==0.7.0
vllm==0.7.0
# Optional but recommended for improved performance and stability
triton==3.1.0
xformers==0.0.28.post3
uvloop==0.21.0
protobuf==5.29.3
openai==1.60.2
opencv-python-headless==4.11.0.86
pillow==10.4.0
# Installed FlashAttention (for float16 only)
flash-attn>=2.5.6 # Not used in float32, but should be documented
注意: 确保您了解使用过时软件包的安全隐患。
注意
官方的 openbmb/MiniCPM-V-2
暂无法工作,因此我们目前需要使用其一个分支 (HwwwH/MiniCPM-V-2
)。更多详情请参阅: Pull Request #4087
警告
我们的 PaliGemma 实现与 Gemma 3 存在相同的问题(见上文),适用于 V0 和 V1。
注意
对于 Qwen2.5-Omni,目前在 V0 上支持从视频预处理中读取音频(--mm-processor-kwargs '{"use_audio_in_video": true}'
)(但 V1 不支持),因为 V1 尚不支持模态重叠。
转录¶
使用 --task transcription
指定。
专门为自动语音识别训练的 Speech2Text 模型。
架构 | 模型 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|
WhisperForConditionalGeneration |
Whisper | openai/whisper-small , openai/whisper-large-v3-turbo , 等。 |
池化模型¶
有关如何使用池化模型的更多信息,请参见此页面。
重要
由于某些模型架构同时支持生成任务和池化任务,您应该明确指定任务类型,以确保模型在池化模式而非生成模式下使用。
文本嵌入¶
使用 --task embed
指定。
任何文本生成模型都可以通过传递 --task embed
转换为嵌入模型。
注意
为了获得最佳结果,您应该使用专门为此训练的池化模型。
下表列出了 vLLM 中经过测试的模型。
架构 | 模型 | 输入 | 示例 HF 模型 | LoRA | PP | V1 |
---|---|---|---|---|---|---|
LlavaNextForConditionalGeneration |
基于 LLaVA-NeXT | T / I | royokong/e5-v |
|||
Phi3VForCausalLM |
基于 Phi-3-Vision | T + I | TIGER-Lab/VLM2Vec-Full |
🚧 | ✅︎ |
评分¶
使用 --task score
指定。
架构 | 模型 | 输入 | 示例 HF 模型 | [LoRA][lora-adapter] | [PP][distributed-serving] | V1 |
---|---|---|---|---|---|---|
JinaVLForSequenceClassification |
基于 JinaVL | T + IE+ | jinaai/jina-reranker-m0 , 等。 |
✅︎ |
模型支持策略¶
在 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 支持的所有模型在这方面都是第三方模型。
我们对模型有以下几个测试级别: