Skip to main content

bilbysearch

bilbysearch turns articles into vectors with intfloat/multilingual-e5-large-instruct, and reads and writes the daily parquet files those vectors live in.

It exists so the model's contract lives in one place. The model id, the 1024-d output width, the instruction prefix queries need and the title+body join rule are all in config.py, so notebooks, batch backfills and retrieval pipelines cannot drift apart.

Install

pip install bilbysearch

That one command brings everything: the model stack (sentence-transformers, torch) and gs:// support (fsspec, gcsfs, google-cloud-storage). torch is the heavy part, at around 2 GB once CUDA wheels are involved.

The [embed], [gcs] and [all] extras from 0.1.x are still accepted, so an existing "bilbysearch[embed,gcs]" dependency keeps working, but they no longer add anything.

Usage

import bilbysearch

model = bilbysearch.load_embedder()

# Embed a frame of articles. Rows with no text get a null vector rather than a
# meaningless one, and three provenance columns record how the vectors were made.
articles = bilbysearch.read_parquet("daily_2026-01-31.parquet")
embedded = bilbysearch.embed_dataframe(articles, model=model)
bilbysearch.write_parquet(embedded, "daily_2026-01-31_embedding.parquet")

Queries and passages are embedded by different functions on purpose: this model expects an instruction prefix on queries and none on passages. Skipping it measurably degrades retrieval.

query = bilbysearch.embed_query("Chinese monetary policy easing", model=model)
passages = bilbysearch.embed_texts(["The PBoC cut the reserve requirement ratio."], model=model)
similarity = query @ passages[0]  # vectors are L2-normalised, so this is cosine

Every function other than load_embedder works on any object exposing sentence-transformers' encode, so a caller that already has a model can pass it straight in.

Development

uv sync
uv run pytest
uv run ruff check . && uv run ruff format .

The tests use a stub model, so the suite runs in well under a second and never downloads the real 2.2 GB one.

Licence

MIT — see LICENSE.

Metadata

Release files for bilbysearch 0.2.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 bilbysearch 0.2.0
File Size Uploaded Provenance Actions
bilbysearch-0.2.0.tar.gz 167.0 kB Without provenance Details for bilbysearch-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bilbysearch 0.2.0
File Interpreter ABI Platform Actions
bilbysearch-0.2.0-py3-none-any.whl Python 3 none any Details for bilbysearch-0.2.0-py3-none-any.whl

Total release size: 178.2 kB

Release files / bilbysearch-0.2.0.tar.gz

Download URL bilbysearch-0.2.0.tar.gz
Size 167.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1a8e3f18573525e181c930df9b2d09f32c24e13ea0cc26f7e5bf3e3f03ca62b5
BLAKE2b-256 checksum
How to use checksums
8e4ee0b71ae13ead06524a489410201ee769b0c7ffa4ba7a4b236ab98c1a408f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bilbysearch-0.2.0-py3-none-any.whl

Download URL bilbysearch-0.2.0-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7c65499c96bf46b3ec1d90d97684d8feb5d370cef0d2162e88cb198f505c110
BLAKE2b-256 checksum
How to use checksums
b01592610486dbe1acb0389bda78c47196b7dea9ad61829374df60a3c3825d55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bilbysearch 0.2.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