支援的模型¶
對於每項任務,我們列出了 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)。
- 定製應在基礎模型中進行(例如,在
如果相容模型是
- 在 Hugging Face Model Hub 上,只需為離線推理設定
trust_remote_code=True,或為openai 相容伺服器設定--trust-remote-code。 - 在本地目錄中,只需將目錄路徑傳遞給
model=<MODEL_DIR>進行離線推理,或將vllm serve <MODEL_DIR>用於openai 相容伺服器。
這意味著,透過 vLLM 的 Transformers 模型後端,新模型可以在它們正式在 Transformers 或 vLLM 中支援之前就被使用!
編寫自定義模型¶
本節詳細介紹了使 Transformers 相容的自定義模型能夠與 vLLM 的 Transformers 模型後端相容所需的修改。(我們假設一個 Transformers 相容的自定義模型已經建立,請參見Transformers - 自定義模型)。
為了使您的模型與 Transformers 模型後端相容,它需要
kwargs透過所有模組從MyModel傳遞到MyAttention。- 如果您的模型是編碼器-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 塊必須有一個名為
- 如果您的模型是編碼器-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載入到 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,它將直接子層名對映到tuple的lists ofstrs。- 您只需要對不在所有管道階段的層執行此操作。
- 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 載入/下載模型的技巧。
- 為您的會話全域性設定代理(或在配置檔案中設定)
- 僅為當前命令設定代理
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 中的模型,請設定一個環境變數。
並與 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)名為 NewModel。NewModel 這個名字過於通用,您應該設定 --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。
注意
第二代 GTE 模型 (mGTE-TRM) 命名為 NewForSequenceClassification。NewForSequenceClassification 名稱過於通用,您應該設定 --hf-overrides '{"architectures": ["GteNewForSequenceClassification"]}' 來指定使用 GteNewForSequenceClassification 架構。
注意
使用以下命令載入官方原始的 mxbai-rerank-v2。
注意
使用以下命令載入官方原始的 Qwen3 Reranker。更多資訊可以在以下網址找到: examples/pooling/score/offline_reranker.py.
獎勵建模¶
這些模型主要支援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 |
注意
命名實體識別 (NER) 用法,請參閱 examples/pooling/token_classify/ner.py, examples/pooling/token_classify/ner_client.py。
多模態語言模型列表¶
以下模態取決於模型而支援
- 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,我們致力於促進第三方模型在我們生態系統中的整合和支援。我們的方法旨在平衡魯棒性的需求與支援廣泛模型所面臨的實際限制。以下是我們管理第三方模型支援的方式:
-
社群驅動支援:我們鼓勵社群為新增新模型做出貢獻。當用戶請求支援新模型時,我們歡迎社群提交拉取請求 (PR)。這些貢獻主要根據其生成的輸出的合理性進行評估,而不是嚴格要求與 transformers 中的現有實現保持一致。呼籲貢獻: 非常歡迎模型供應商直接提交 PR!
-
盡力保持一致性:雖然我們力求在 vLLM 中實現的模型與其他框架(如 transformers)之間保持一定程度的一致性,但並非總能完全對齊。加速技術的使用和低精度計算的使用等因素可能會引起差異。我們的承諾是確保實現的模型能夠正常執行併產生合理的結果。
提示
在比較 Hugging Face Transformers 的
model.generate輸出與 vLLM 的llm.generate輸出時,請注意前者會讀取模型的生成配置檔案(即 generation_config.json)併為生成應用預設引數,而後者僅使用傳遞給函式的引數。比較輸出時,請確保所有采樣引數都相同。 -
問題解決和模型更新:鼓勵使用者報告他們在使用第三方模型時遇到的任何錯誤或問題。建議透過 PR 提交修復方案,並清楚解釋問題和解決方案的理由。如果對一個模型的修復會影響到另一個模型,我們依賴社群來突出顯示並解決這些跨模型依賴關係。注意:對於 bug 修復 PR,告知原始作者以尋求他們的反饋是一種良好的禮儀。
-
監控和更新:對特定模型感興趣的使用者應監控這些模型的提交歷史(例如,透過跟蹤 main/vllm/model_executor/models 目錄中的更改)。這種主動的方法有助於使用者及時瞭解可能影響他們所使用模型的更新和更改。
-
選擇性關注:我們的資源主要用於具有重要使用者興趣和影響力的模型。使用較少的模型可能獲得的關注較少,我們依賴社群在模型的維護和改進中發揮更積極的作用。
透過這種方法,vLLM 促進了一個協作的環境,核心開發團隊和更廣泛的社群共同為我們生態系統中第三方模型的魯棒性和多樣性做出貢獻。
請注意,作為推理引擎,vLLM 不會引入新模型。因此,vLLM 支援的所有模型在此方面都屬於第三方模型。
我們對模型有以下測試級別:
- 嚴格一致性:我們將模型輸出與 HuggingFace Transformers 庫中貪婪解碼下的模型輸出進行比較。這是最嚴格的測試。請參閱 models tests 以瞭解透過此測試的模型。
- 輸出合理性:我們透過測量輸出的困惑度並檢查任何明顯的錯誤來檢查模型的輸出是否合理且連貫。這是一個不太嚴格的測試。
- 執行時功能:我們檢查模型是否可以載入和執行而不會出錯。這是最不嚴格的測試。請參閱 功能測試和 示例 以瞭解透過此測試的模型。
- 社群反饋:我們依賴社群提供有關模型的反饋。如果模型損壞或未按預期工作,我們鼓勵使用者提出問題報告,或提交拉取請求進行修復。其餘模型屬於此類。