Skip to content

vllm.model_executor.models.colpali

ColPali late interaction model for multi-modal retrieval and reranking.

ColPali extends PaliGemma with a ColBERT-style late interaction head, producing per-token embeddings for both text and image inputs. It uses MaxSim scoring for retrieval/reranking tasks.

This model supports the "token_embed" pooling task and is designed for multi-vector retrieval of documents containing both text and images.

Reference: https://arxiv.org/abs/2407.01449 (ColPali) Based on: PaliGemma backbone (SigLIP + Gemma) with custom text projection

Target models: - vidore/colpali-v1.3-hf

Classes:

ColPaliModel

Bases: PaliGemmaForConditionalGeneration, SupportsLateInteraction

ColPali late interaction model for multi-modal retrieval/reranking.

This model extends PaliGemmaForConditionalGeneration with a ColBERT-style linear projection layer for per-token embeddings. It supports: - "token_embed" task: Per-token embeddings for late interaction scoring

The model produces L2-normalized per-token embeddings by: 1. Running the PaliGemma backbone (vision + language) to get hidden states 2. Projecting hidden states through a linear layer (hidden_size -> embed_dim) 3. L2-normalizing the projected embeddings

Methods:

  • load_weights –

    Load weights with special handling for ColPali projection layer.

_is_proj_weight(name)

Check if a weight name belongs to the projection layer.

load_weights(weights)

Load weights with special handling for ColPali projection layer.

ColPaliMultiModalProcessor

Bases: PaliGemmaMultiModalProcessor

Multimodal processor for ColPali.