Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
annotations
✓ from pylate import annotations
✗ from pylate import ColBERT
Basic usage: encode documents, build index, and retrieve.
from pylate import ColBERT, IndexConfig, Reranker
import os
colbert = ColBERT()
index_config = IndexConfig(
nbits=2,
kmeans_niters=20,
ncentroids=256,
index_key="IVF256,PQ2",
index_type="ivf",
gpu=False,
)
# Example documents
documents = [
"ColBERT is a fast and accurate retrieval model.",
"pylate provides a simple interface for training and indexing.",
]
# Encode and index
embeddings = colbert.encode(documents)
colbert.index.add(embeddings, index_config=index_config)
# Query
query = "What is ColBERT?"
query_embedding = colbert.encode([query])[0]
scores = colbert.index.search(query_embedding, k=2)
print(scores)
Upgrade
Version history
1.5.0latest on PyPI · released May 5, 2026
Audit
Dependencies
torchrequiredRequired for tensor operations and neural network execution.
numpyrequiredUsed for numerical operations and array handling.