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[embed]

The base install is deliberately light — just pandas and pyarrow — so a caller that only reads the parquet files, or only reads the model contract, does not pull a multi-gigabyte ML stack it will never use.

Extra Adds Needed for
(none) pandas, pyarrow, numpy reading config, local parquet IO
[embed] sentence-transformers, torch load_embedder
[gcs] fsspec, gcsfs, google-cloud-storage gs:// URIs
[all] both of the above everything

Until the first PyPI release, install from the repo instead:

uv add "bilbysearch[all] @ git+https://github.com/bilbyai/bilbysearch.git"

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

Only load_embedder needs the [embed] extra. Every other function 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.1.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.1.0
File Size Uploaded Provenance Actions
bilbysearch-0.1.0.tar.gz 166.8 kB Without provenance Details for bilbysearch-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 178.3 kB

Release files / bilbysearch-0.1.0.tar.gz

Download URL bilbysearch-0.1.0.tar.gz
Size 166.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b9e3833c0cd1e73ad3d0d99a91fba6efee41dadf2bb32084d3d80908b5f6b8d9
BLAKE2b-256 checksum
How to use checksums
bf0a01e8afbd162a0dcdcec693a896c3ab889f7edca1affc23b01ee097530930
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.1.0-py3-none-any.whl

Download URL bilbysearch-0.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f2d5a4e98992f94fd8ef6a0e35387c7200aba275085c0da356ab2708a62a167
BLAKE2b-256 checksum
How to use checksums
7e82bea75e243ae19efd305fddb16145eb572f8a8b21564549d58ef08ae4bc6d
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.1.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