Registry / ai-ml / pylate

pylate

JSON →
library1.5.0pypypi✓ verified 82d ago

A library for training and retrieval with ColBERT. Current version is 1.5.0, release cadence is irregular.

pip install pylate
INSTALL
IMPORT
SIG · PYLATE
P
pylate
ai-mlpythonv1.5.0
harness data pending
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)
Debug
Known issues
breakingVersion 1.0.0 changed the API significantly: IndexConfig and index management moved to top-level. Old patterns like `pylate.models.ColBERT` no longer work.
fix
Import from top-level: `from pylate import ColBERT, IndexConfig`.
affects: >=1.0.0
gotchaThe `encode` method returns a list of tensors, not a single tensor. Iterating over documents yields one embedding per document.
fix
Use list comprehension or loop to handle individual embeddings.
affects: all
deprecated`ColBERT.load()` is deprecated in favor of `ColBERT.from_pretrained()`. The old method may be removed in a future release.
fix
Use `ColBERT.from_pretrained('colbert-base')` instead.
affects: >=1.2.0
gotchaThe index is not automatically persisted. After calling `colbert.index.add()`, the index is in memory only; you must call `colbert.index.save()` to persist to disk.
fix
Call `colbert.index.save('path/to/index')` after adding embeddings.
affects: all
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.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
pylate — pip install pylate · libregistry