Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

ordvec (Python)

Python bindings for ordvec — a training-free ordinal & sign vector-quantization library for compressed nearest-neighbour retrieval over high-dimensional embeddings. Pure-Rust core, zero system dependencies; SIMD-accelerated at runtime (AVX-512 / AVX2 / scalar).

import numpy as np
import ordvec

q = ordvec.RankQuant(1024, 2)          # 1024-dim, 2 bits/coord
q.add(np.random.randn(10_000, 1024).astype(np.float32))
# asymmetric: full-precision float queries vs bucketed docs (recommended)
scores, ids = q.search_asymmetric(np.random.randn(8, 1024).astype(np.float32), k=10)

Classes

Class Purpose
Rank Full-precision rank vectors (u16 per coordinate).
RankQuant Bucketed ranks, bits ∈ {1, 2, 4}; symmetric + asymmetric (float-query LUT) scoring.
Bitmap Constant-weight top-bucket bitmap per document; popcount(Q AND D) candidate scoring.
SignBitmap Sign bitmap for sign-cosine candidate generation; separate from the constant-weight bitmap theorem.

The Rust crate's b = 8 RankQuant evidence/refinement width is not exposed through the v0.5 Python RankQuant constructor and cannot be persisted to .ovrq; use bits 1, 2, or 4 from Python.

Two-stage retrieval (subset rerank)

A Bitmap / SignBitmap probe yields a candidate shortlist that RankQuant.search_asymmetric_subset(query, candidates, k) reranks exactly:

cands = bm.top_m_candidates(query, m=256)          # uint32 shortlist
scores, ids = rq.search_asymmetric_subset(query, cands, k=10)

Both returned arrays have length min(k, len(candidates)), not k. When k > len(candidates) the result is silently capped to the candidate count — the subset path never pads with sentinel rows. If you assemble a fixed-width (n_q, k) result buffer, size each row by its candidate count rather than assuming k rows back.

Theory and calibration

Bitmap exposes the constant-weight top-bucket overlap statistic formalized in ordvec-formalization. In that finite Lean model, literal bitmap overlap is the query-preserving quotient statistic, an overlap threshold is Bayes-optimal under explicit monotone-overlap assumptions, and the idealized uniform constant-weight null calibrates that threshold by the hypergeometric upper tail.

This is not a deployment guarantee for every encoder or corpus. Real-corpus recall, monotonicity, and null fit remain empirical diagnostics.

Installation

pip install ordvec

Wheels target CPython 3.10+ (abi3) and require numpy>=2.2. Building from source needs a Rust toolchain (MSRV 1.89) and maturin.

Safety contract

The Python binding releases the GIL while Rust searches, scores, and mutates indexes. Inputs that cross a GIL-released call are copied into Rust-owned buffers first, so ordinary Python in-place NumPy mutation from another thread cannot race the detached Rust scan. Large calls may temporarily require an additional input-sized buffer. The cross-language ownership and lifetime contract is maintained in docs/bindings-safety.md for this release line.

Type stubs

The package ships hand-written type stubs (_ordvec.pyi) and a py.typed marker, so editors and mypy get full signatures for the four index classes, the module-level rank-math primitives, and the MAX_* constants — the abi3 native module is otherwise opaque to static analysis.

Provenance & license

The ordvec Python package's active upstream, implementation history, issues, releases, and governance live in Project-Navi/ordvec.

Courtesy note: ordvec was developed using the early turbovec project context as a rapid-development scaffold, with thanks to that lineage. It is not a source fork of turbovec.

Dual-licensed under either of MIT or Apache-2.0 at your option.

Metadata

Release files for ordvec 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for ordvec 0.5.0
File Size Uploaded Provenance
ordvec-0.5.0.tar.gz 355.0 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for ordvec 0.5.0
File
ordvec-0.5.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
ordvec-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
ordvec-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
ordvec-0.5.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 2.3 MB

Release files / ordvec-0.5.0.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL ordvec-0.5.0.tar.gz
Size 355.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e2363936886e3f7666643a7619e8a53a69309752286f6d73f34e1af29c2127
BLAKE2b-256 checksum
How to use checksums
e34280e766f16873c19a714970ccd4e6c54d055d6e17a5943afd7f4822ceefe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 20, 2026.

Transparency log

Release files / ordvec-0.5.0-cp310-abi3-win_amd64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL ordvec-0.5.0-cp310-abi3-win_amd64.whl
Size 435.7 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
216a6b68cd8f75e1c8aa4ca1bb7b6f4141da98ed3f05c0e98886432495bbe93b
BLAKE2b-256 checksum
How to use checksums
20bcce7459aee2cac6dc50461275a9d95264289e1aba3634fdad07c8982f0b4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 20, 2026.

Transparency log

Release files / ordvec-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL ordvec-0.5.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 551.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
82f7cef16a2c2b13657394df4e89c2b5f02e974f11f303c598c927edf1e02f8e
BLAKE2b-256 checksum
How to use checksums
128afb67a28e15798c76e2031ac0bbb0efeefe593583bfc4b30792b974cdbdc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 20, 2026.

Transparency log

Release files / ordvec-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL ordvec-0.5.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 515.3 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f922ade5a7230b61bb59440946f43d8b5db9a3f9cb073cf8305d0cb687aaf3ff
BLAKE2b-256 checksum
How to use checksums
a90a8d11622ffd71cb20d9b3913ec63ad14788a57ab463dfecd195d509b19d0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 20, 2026.

Transparency log

Release files / ordvec-0.5.0-cp310-abi3-macosx_11_0_arm64.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL ordvec-0.5.0-cp310-abi3-macosx_11_0_arm64.whl
Size 477.2 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
564281052ea218d0c570536e2fc94cac0d22e3ca948a2c8cfe64fdb04ee415e7
BLAKE2b-256 checksum
How to use checksums
1646dc01cea8656ad557bf16b513d2e067eac808b6dadbd7703660bd307137bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 20, 2026.

Transparency log

Security for ordvec 0.5.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.

Change of provenance

The repository that created this release differs from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Repository

  • Removed 0.4.0 GitHub: Fieldnote-Echo/ordvec
  • Added 0.5.0 GitHub: Project-Navi/ordvec
Select from 5 files

Attestation for ordvec-0.5.0.tar.gz

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 Jun 20, 2026.

Transparency log

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.

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