Skip to main content

Training-free ordinal & sign quantization for compressed vector retrieval

Project description

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 Top-bucket bitmap per document; popcount(Q AND D) candidate scoring.
SignBitmap Sign bitmap for sign-cosine candidate generation.

Installation

pip install ordvec

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

Provenance & license

The ordvec Python bindings were developed within turbovec, factored out into this standalone package. turbovec (MIT, by Ryan Codrai) is credited as the origin project.

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

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

ordvec-0.2.0.tar.gz (211.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ordvec-0.2.0-cp310-abi3-win_amd64.whl (374.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

ordvec-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (490.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ordvec-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (460.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

ordvec-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (423.0 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file ordvec-0.2.0.tar.gz.

File metadata

  • Download URL: ordvec-0.2.0.tar.gz
  • Upload date:
  • Size: 211.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ordvec-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b37065499397245b893d52fc2a4dc9b6f91c255dd223d1f8348b3870c1c7550c
MD5 7bef51656a42d0fb4d1cde3042ea2e6e
BLAKE2b-256 80553b9ddc7efed96e937310455dd2496ece00665b1baac0128987ce41e51687

See more details on using hashes here.

Provenance

The following attestation bundles were made for ordvec-0.2.0.tar.gz:

Publisher: release-python.yml on Fieldnote-Echo/ordvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ordvec-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ordvec-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 374.9 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for ordvec-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d61d97d0fcc58f4ba18527caab2b420d5c5782ec79c375647cf7e10af0bdc0a0
MD5 97ab658d50c2cdba452a4ab942b6e526
BLAKE2b-256 053437f46fefaa03e451062f5725f59f421dc08d25c0b7f90b2a65667c56c865

See more details on using hashes here.

Provenance

The following attestation bundles were made for ordvec-0.2.0-cp310-abi3-win_amd64.whl:

Publisher: release-python.yml on Fieldnote-Echo/ordvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ordvec-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ordvec-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b439141db8e12178c8a5275f914e0afec48ab466c416290e2cf9e0383e1192fc
MD5 a2a7b80f16fd11acb9c97ce0b55ec9a8
BLAKE2b-256 a83194c069398ef6e116b7db29709560c5f893c028a834f408681932ae019afc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ordvec-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-python.yml on Fieldnote-Echo/ordvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ordvec-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ordvec-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c66a679b3c5612fc95311e0f353554b789487d64315690529586a36c0ff2c391
MD5 49a646b23962b6aa5552d9cc3d7936b6
BLAKE2b-256 763e27a712d24ce70574f28c4fe25b5083ccf7710ed65a91d82fb7dea94760df

See more details on using hashes here.

Provenance

The following attestation bundles were made for ordvec-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release-python.yml on Fieldnote-Echo/ordvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ordvec-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ordvec-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5ea57ecf3f2f604c89d940d897ad9c221b14782a7e7a8e1c4d2db7a27cf1335
MD5 97179c22e74a2666585ed6bd64836dff
BLAKE2b-256 89d4f94f129d14f6330eeb76e1ea75a794e42427ef0b685dd9e7c43d4a6d45bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for ordvec-0.2.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release-python.yml on Fieldnote-Echo/ordvec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page