Skip to main content

rayzin

CI Release

rayzin is a Ray project for exact k-nearest-neighbor search over chunked embeddings: Zarr arrays, Cloud-Optimised GeoTIFFs whose bands are the embedding, and Parquet files with one vector per row.

It is designed for workflows where:

  • Embeddings are stored as chunked arrays, typically with a trailing feature dimension.
  • Search should prune whole chunks before loading vector payloads whenever possible.
  • Relevant chunks are read once, searched in parallel with Ray, and merged into a global top-k.

The project uses a chunk-first execution model:

  1. Build or read a manifest describing each chunk by slice, count, centroid, and radius.
  2. Apply manifest-level pushdown with Ray Data using predicate filters and optional AOI filtering.
  3. Compute query-to-chunk lower bounds in vectorized batches.
  4. Search only the active query subset for each surviving chunk after pruning.
  5. Merge local top-k results into a global heap actor and return flat result rows.

This architecture keeps chunk reads bounded, avoids rescanning the same data for each query, and fits naturally into Ray Data execution.

Features

  • Manifest-driven pruning: Chunk summaries let the pipeline skip work before loading dense vectors, which is the main lever for scaling exact search.
  • Ray-native distributed execution: Manifest filtering, chunk reads, and search fan out through Ray Data while final top-k merging stays centralized in a heap actor.
  • Pluggable search backends: NumPy, FAISS and torch backends share the same pipeline so pruning and result handling stay consistent across implementations.
  • GPU streaming: with the torch backend, COG blocks stream to the GPU in their stored dtype (e.g. float16) from pinned buffers, and the top-k stays on the device.

Current Scope

  • Zarr: build_manifest_from_zarr, knn_zarr_search.
  • COGs: build_manifest_from_cogs, knn_cog_search. A chunk is one internal COG block of a pixel-interleaved, float, unpredicted COG (zstd, deflate or none).
  • Parquet: build_manifest_from_parquet, knn_parquet_search. A chunk is one row group of a fixed-size list column; row_filter drops single rows, e.g. by score.
  • COG and Parquet manifests are built incrementally (only files they lack), carry a lon/lat footprint per chunk for aoi, and take extra metadata columns for filter_expr.
  • KnnSearcher keeps a manifest, its actors and their GPU state loaded across searches.
  • Batched query input shaped (1, d) or (nq, d), and the Euclidean pruning path, which prune=False turns off when chunk bounds cannot rule anything out.

Installation

Install the base package from PyPI:

pip install rayzin

That gives you the core Zarr search path and the NumPy backend. Extras add the rest:

pip install "rayzin[cog,torch]"
  • cog: the COG reader (async-tiff, zstandard, pyproj).
  • cpu or gpu: the FAISS backend, faiss-cpu or faiss-gpu (CUDA 12 wheels).
  • torch: the torch backend, on the GPU when there is one.

If you are working from a local checkout and want an editable install:

pip install -e .

Development

  • Install Pixi: curl -fsSL https://pixi.sh/install.sh | sh
  • Install dependencies: pixi install -e dev
  • Run lint: pixi run -e dev ruff check .
  • Run format check: pixi run -e dev ruff format --check .
  • Run type check: pixi run -e dev mypy src/rayzin tests
  • Run tests: pixi run -e dev pytest

Release

Releases are cut automatically from main after the CI workflow passes. Use Conventional Commits for changes that should trigger a release, and semantic-release will:

  • compute the next version
  • update pyproject.toml and src/rayzin/__init__.py
  • refresh pixi.lock
  • create the version tag and GitHub release
  • build and publish the package to PyPI via GitHub Actions trusted publishing

Roadmap

  1. Keep pruning metrics and search-time metrics aligned across all supported backends.
  2. Generalize pruning beyond a single radius or tau so multiple pivots or metric-independent pruning are possible.
  3. Simplify filtering to chunk existence, AOI intersection, and straightforward coordinate subsetting.
  4. Add support for native dtypes when no scale or offset or other CF decoding is required.
  5. Add support for pre-transforms such as dequantization before search.
  6. Prefer from __future__ import annotations over quoted forward references.
  7. Add logging and timing around pruning, loading, decoding, and per-block search.
  8. Revisit float32 assumptions and document where they are required by FAISS.
  9. Make radius-based manifest data optional if pruning mode does not require it.
  10. Revisit rows-per-block tuning and execution sizing once the main search path stabilizes.

Metadata

Release files for rayzin 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 rayzin 0.1.0
File Size Uploaded
rayzin-0.1.0.tar.gz 93.7 kB Details

Built distribution (wheel)

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

Total release size: 140.3 kB

Release files / rayzin-0.1.0.tar.gz

Download URL rayzin-0.1.0.tar.gz
Size 93.7 kB
Tags Source
SHA-256 checksum
How to use checksums
99160d468af0c2b443a6693fde8ce39bdb1f86ac02f788679567d243a72cbedc
BLAKE2b-256 checksum
How to use checksums
3bb7751a16fd3e5e8c88909994f4679658018ffc662a98bd9cce6745175047ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / rayzin-0.1.0-py3-none-any.whl

Download URL rayzin-0.1.0-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4bdbd6a0bba47afeb5c56f61b94a2b0515dcf641da8e5f7a1aee9485369fcb2
BLAKE2b-256 checksum
How to use checksums
ba8d37fe3ed7365831bdd87989efdafe425307bd18e72a618093697050ad3ba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release files

0.0.1

2 release files

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