Skip to main content
Version: Next

基本模型接口

*在线运行 vLLM 入门教程:零基础分步指南

模块内容

class vllm.model_executor.models.interfaces_base.VllmModel(vllm_config: VllmConfig, prefix: str = '')

[source]

vLLM 中所有模型所需的接口。

class vllm.model_executor.models.interfaces_base.VllmModelForTextGeneration(vllm_config: VllmConfig, prefix: str = '')

[source]

vLLM 中所有生成模型所需的接口。

compute_logits(hidden_states: T, sampling_metadata: SamplingMetadata) → T | None

[source]

如果 TP rank > 0,则返回 None

class vllm.model_executor.models.interfaces_base.VllmModelForPooling(vllm_config: VllmConfig, prefix: str = '')

[source]

vLLM 中所有池化模型所需的接口。

pooler(hidden_states: T, pooling_metadata: PoolingMetadata) → PoolerOutput

[source]

仅在 TP rank 0 上调用。