Skip to main content

VLM2Vec (MMEB) for Pyserini

PyPI Downloads Downloads LICENSE

This repository contains a fork of the original VLM2Vec codebase, modified for easy Pyserini integration and repackaged as a PyPI package.

current_version = "0.3.0"

Supported Datasets and Tasks

22 Visual Document Retrieval tasks are supported. This covers ViDoRE ViDoRE v2, VisRAG, ViDoSeek (page), and MMLongBench (page).

Supported Models

Any VL models with qwen2-vl, gme, and lamra backbones are supported. This includes gme-Qwen2-VL-2B/7B-Instruct, VLM2Vec/VLM2Vec-V2.0, code-kunkun/LamRA-Ret and more.

Installation

Install the package directly from PyPI:

pip install vlm2vec-for-pyserini

Or, install from source:

git clone https://github.com/castorini/VLM2Vec-for-Pyserini.git
cd VLM2Vec-for-Pyserini
pip install .

Optional extras: [flash] installs FlashAttention-2 (CUDA only; needed to reproduce the 2CR numbers exactly, otherwise SDPA is used), and [video] installs decord for the video benchmarks.

Quick Start

Assuming that you have cloned the repository and you are in the root dir:

  1. Download the visdoc from HuggingFace and convert the corpus, topics and queries to the format ready for Pyserini:
bash src/pyserini_integration/prepare_dataset.sh
  1. Run encoding, indexing, and search. Then evaluation and results aggregation using the following script:
bash src/pyserini_integration/experiments.sh

If you want to use the PyPI package, take a look at download_visdoc.py, save_pyserini_data.py, and quick_start_demo.py files under src/pyserini_integration/ as sample code.

Contact

For contact regarding the Pyserini integration section, please email Sahel Sharifymoghaddam.

For contact regarding the original VLM2Vec codebase, please email the authors of the original repository.

Citation

If you use this work with Pyserini, please cite Pyserini in addition to the original VLM2Vec paper:

@INPROCEEDINGS{Lin_etal_SIGIR2021_Pyserini,
   author = "Jimmy Lin and Xueguang Ma and Sheng-Chieh Lin and Jheng-Hong Yang and Ronak Pradeep and Rodrigo Nogueira",
   title = "{Pyserini}: A {Python} Toolkit for Reproducible Information Retrieval Research with Sparse and Dense Representations",
   booktitle = "Proceedings of the 44th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2021)",
   year = 2021,
   pages = "2356--2362",
}

@article{jiang2024vlm2vec,
  title={VLM2Vec: Training Vision-Language Models for Massive Multimodal Embedding Tasks},
  author={Jiang, Ziyan and Meng, Rui and Yang, Xinyi and Yavuz, Semih and Zhou, Yingbo and Chen, Wenhu},
  journal={arXiv preprint arXiv:2410.05160},
  year={2024}
}

@article{meng2025vlm2vecv2,
  title={VLM2Vec-V2: Advancing Multimodal Embedding for Videos, Images, and Visual Documents},
  author={Rui Meng and Ziyan Jiang and Ye Liu and Mingyi Su and Xinyi Yang and Yuepeng Fu and Can Qin and Zeyuan Chen and Ran Xu and Caiming Xiong and Yingbo Zhou and Wenhu Chen and Semih Yavuz},
  journal={arXiv preprint arXiv:2507.04590},
  year={2025}
}

📄 License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

Metadata

Release files for vlm2vec-for-pyserini 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vlm2vec-for-pyserini 0.3.0
File Size Uploaded Provenance Actions
vlm2vec_for_pyserini-0.3.0.tar.gz 446.1 kB Without provenance Details for vlm2vec_for_pyserini-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vlm2vec-for-pyserini 0.3.0
File Interpreter ABI Platform Actions
vlm2vec_for_pyserini-0.3.0-py3-none-any.whl Python 3 none any Details for vlm2vec_for_pyserini-0.3.0-py3-none-any.whl

Total release size: 1.0 MB

Release files / vlm2vec_for_pyserini-0.3.0.tar.gz

Download URL vlm2vec_for_pyserini-0.3.0.tar.gz
Size 446.1 kB
Tags Source
SHA-256 checksum
How to use checksums
500ecb2933c948ce61a43b06f1d59ba35d6639e33075daf3640658235234da43
BLAKE2b-256 checksum
How to use checksums
ecc83d8a658967a3de73f8b978bdb574ac79d1f4e6ec8ebc1f2c04173a033e35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / vlm2vec_for_pyserini-0.3.0-py3-none-any.whl

Download URL vlm2vec_for_pyserini-0.3.0-py3-none-any.whl
Size 559.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7afde8d95fdcdc3a2c5b6e09c451d320da69cea7f2b35390630c6432a8314fd4
BLAKE2b-256 checksum
How to use checksums
fa3c7973437fd61a0e0a22e8ab43e96f7dfbec662b096b0cdfa35a081891e8bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for vlm2vec-for-pyserini 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page