Run ColBERT Wikipedia server
Project description
colbert-server
CLI tooling to fetch the ColBERT Wikipedia 2017 dataset and run a lightweight Flask API on top of the ColBERT v2 searcher.
$> I wrote this because the ColBERT server is down and I couldn't try one of the tutorial from DSPy.
$> I only tested this on my macbook, please open an issue if you have problems or feature requests.
Features
- One-command install and execution via
uv tool. - Automatically downloads either ready-to-serve indexes/collection or the original archives.
- Optional archive extraction flow for offline usage.
- Caches ColBERT queries for fast, repeated lookups.
- Exposes a simple
/api/searchendpoint for programmatic access. - Ships with a
doctorcommand that validates Torch/FAISS installs before the 13 GB download.
Installation
uv tool install colbert-server
This registers a colbert-server executable in your uv toolchain.
Check the installed version at any time:
colbert-server --version
Run the built-in diagnostic command to verify torch/faiss before downloading the index:
colbert-server doctor
Or if you just want to run it:
uvx run colbert-server --help
Running the server
Use data from the Hugging Face cache (recommended quick start)
colbert-server serve --from-cache
This downloads only the collection/ and indexes/ folders from
nielsgl/colbert-wiki2017,
resolves the on-disk paths from the Hugging Face cache, and starts the server.
Provide existing local assets
colbert-server serve \
--index-root /path/to/indexes \
--index-name wiki17.nbits.local \
--collection-path /path/to/collection/wiki.abstracts.2017/collection.tsv
Use this mode when you already have ColBERT indexes and a collection TSV locally.
Download archives first, then serve
colbert-server serve \
--download-archives /tmp/wiki-assets \
--extract \
--port 8894
This fetches the archive files into /tmp/wiki-assets/archives, extracts them into
/tmp/wiki-assets, auto-detects the resulting layout (e.g. wiki17.nbits.local),
and starts the Flask server on port 8894.
API usage
Once running, the server listens on the host/port provided (defaults to 0.0.0.0:8893)
and serves ColBERT search results via:
GET /api/search?query=<text>&k=<top-k>
Example request:
http://127.0.0.1:8893/api/search?query=halloween+movie&k=3
The JSON response includes the ranked passages, their scores, and normalized probabilities.
Managing dataset archives only
If you just want the raw archive bundles in a local directory:
colbert-server download-archives ./downloads --extract
Add --extract-to /desired/path to unpack into a different directory. You can later reuse
the extracted paths with the serve command’s --index-root and --collection-path flags.
Alternative / Manual Method
In case you don't want to use the script / uv tool you can set it up as follows:
- Add the dependencies to your project:
uv add colbert-ai flask faiss-cpuanduv add torch --index pytorch-cpu(the repo already provides the PyTorch CPU index inpyproject.toml). - Download the files (both the index and the collection) from the
archivesdirectory from the HuggingFace dataset and unzip them. - Copy the
standalone.pyscript from this repository and edit theINDEX_ROOTandCOLLECTION_PATHvariables. - Run the server with
uv run standalone.pyand <tada.wav>
Development tips
- Requires Python 3.13+ (or adjust the
pyproject.tomlrequirement to match your interpreter). - Run
colbert-server --helporcolbert-server serve --helpto inspect available options. - The dataset helpers live under
colbert_server/data.py; server configuration sits incolbert_server/server.py. - GitHub Actions runs lint/tests on every push across Ubuntu, macOS, and Windows; see
.github/workflows/ci.ymlfor details. - Publishing is handled via the
Manual Releaseworkflow. Trigger it from the Actions tab, choose the desired bump (patch/minor/major), and it will bump the version, run tests/builds, push the commit, and create thevX.Y.Ztag. Create aRELEASE_TOKENsecret withreposcope so the workflow can push back tomain. - The CLI pings PyPI at most once per day and nudges you if a newer version exists. Set
COLBERT_SERVER_DISABLE_UPDATE_CHECK=1to disable this behaviour. - The tag automatically kicks off the
Publishworkflow, which uploads the artifacts to PyPI via trusted publishing. After that completes theVerify Releaseworkflow installs the new version on Ubuntu, macOS, and Windows and runscolbert-server --version/doctorto ensure the artifact works cross-platform.
Happy searching! 🧠📚
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colbert_server-0.3.1.tar.gz.
File metadata
- Download URL: colbert_server-0.3.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fd83ec4837bf36b4342a9a7d891780fc9fc0d9f1c575c29024f43838a5cb4d5
|
|
| MD5 |
3d62154c9e15b1b4ffd675a972147a6d
|
|
| BLAKE2b-256 |
0f41bcd2cd73566ba564c0f25c3c62dfa8b21c8aa7645490a7c4be64cefb6307
|
Provenance
The following attestation bundles were made for colbert_server-0.3.1.tar.gz:
Publisher:
publish.yml on nielsgl/colbert-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colbert_server-0.3.1.tar.gz -
Subject digest:
6fd83ec4837bf36b4342a9a7d891780fc9fc0d9f1c575c29024f43838a5cb4d5 - Sigstore transparency entry: 662341752
- Sigstore integration time:
-
Permalink:
nielsgl/colbert-server@4d8ea53269bec65cd8cb44499754f3719e2bee45 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/nielsgl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d8ea53269bec65cd8cb44499754f3719e2bee45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file colbert_server-0.3.1-py3-none-any.whl.
File metadata
- Download URL: colbert_server-0.3.1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1955d1f92c7fd4d75d7178efa4fcbd69807cd95092f04cb697f5fe6f18ea129
|
|
| MD5 |
4cb2a141d3660fdb68140ee2169ecdcd
|
|
| BLAKE2b-256 |
3ebbb410082c64ec230d7dad40a069c0202042b05559ea7ff282433f55585a30
|
Provenance
The following attestation bundles were made for colbert_server-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on nielsgl/colbert-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colbert_server-0.3.1-py3-none-any.whl -
Subject digest:
e1955d1f92c7fd4d75d7178efa4fcbd69807cd95092f04cb697f5fe6f18ea129 - Sigstore transparency entry: 662341753
- Sigstore integration time:
-
Permalink:
nielsgl/colbert-server@4d8ea53269bec65cd8cb44499754f3719e2bee45 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/nielsgl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4d8ea53269bec65cd8cb44499754f3719e2bee45 -
Trigger Event:
push
-
Statement type: