Rust-native MUVERA retriever with Python bindings
Project description
muvera-rs
Rust-native MUVERA: multi-vector retrieval via fixed dimensional encodings, plus Python bindings for wheel builds.
PyPI project name: muvera-rs (import as muvera).
This repository is based on the paper.
Status
The active implementation is now Rust-first:
- core library: crates/muvera-core
- Python extension: crates/muvera-py
- Python package shim: python/muvera
The legacy C++ remains in the repository on branch legacy_cpp for reference.
This repository is under active development.
Contributing
Build the Rust library
Create and activate the Conda environment first:
conda env create -f environment.yml
conda activate muvera-rust
If the environment already exists and you only want to refresh dependencies:
conda env update -f environment.yml --prune
conda activate muvera-rust
Then from the repository root:
cargo test
Build the Python wheel locally
maturin build --release
To install into the current environment:
maturin develop --release
Then in Python:
from muvera import MuveraRetriever
retriever = MuveraRetriever(
dimensions=3,
max_points=500,
d_proj=128,
d_final=10240,
k_sim=10,
r_reps=5,
seed=42,
)
dataset = [
[[1.0, 2.0, 3.0], [1.0, -2.0, 3.0]],
[[4.0, 5.0, 6.0], [4.0, -5.0, 6.0]],
]
retriever.index_dataset(dataset, [1, 2])
print(retriever.get_top_k(dataset[0], 1))
Python build, test, and release
Local compile/test/package checks
After activating muvera-rust, from the repository root:
cargo test -p muvera-core
maturin develop --release
python -m pytest -q python/tests
rm -rf dist
maturin build --release --sdist -o dist
python -m twine check dist/*
GitHub Actions workflows
- CI workflow:
.github/workflows/python-ci.yml- Runs Rust tests, Python smoke tests, and package metadata checks on push/PR.
- Builds a wheel with
maturin buildand installs it withpipfor testing; it does not usematurin develop.
- Release workflow:
.github/workflows/python-release.yml- Manual only via GitHub Actions
workflow_dispatch. - Builds wheels (Linux/macOS/Windows) and sdist.
- Publishes to TestPyPI via manual dispatch (
repository=testpypi). - Publishes to PyPI via manual dispatch (
repository=pypi).
- Manual only via GitHub Actions
For publishing, configure trusted publishing in PyPI/TestPyPI for this repository so
pypa/gh-action-pypi-publish can use OIDC (id-token: write).
Typical release flow:
conda activate muvera-rust
cargo test -p muvera-core
maturin develop --release
python -m pytest -q python/tests
rm -rf dist
maturin build --release --sdist -o dist
python -m twine check dist/*
git tag v0.1.1
git push origin v0.1.1
Then trigger .github/workflows/python-release.yml manually in GitHub Actions and choose
repository=testpypi or repository=pypi.
Notes
- The Rust port includes the full FDE pipeline and both retrievers.
- The active
MuveraRetrieveris Rust-native and no longer compiles the legacy C++ DiskANN sources. - The Python package is configured through pyproject.toml for PyPI-compatible wheel builds.
- The legacy C++ code is available on the
legacy_cppbranch.
Acknowledgements
We sincerely appreciate Rajesh and other original authors for explaining to us the original experimental recipes and open sourcing the source code snippet with Google.
The index backend uses Microsoft DiskANN. We sincerely appreciate the open source efforts from folks at Microsoft.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file muvera_rs-0.1.0-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: muvera_rs-0.1.0-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 659.8 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e1c0be404dc931b953740adfff6d1696f772decf3128f08433129a7a4ef0a97
|
|
| MD5 |
fcb921c04ab2601c3bdb30e5496d05a4
|
|
| BLAKE2b-256 |
328b279f094540ce782c0fe1650dfd18accbca7eb78a45c10b40b517b0cc8d88
|
Provenance
The following attestation bundles were made for muvera_rs-0.1.0-cp39-abi3-win_amd64.whl:
Publisher:
python-release.yml on SylviaZiyuZhang/muvera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muvera_rs-0.1.0-cp39-abi3-win_amd64.whl -
Subject digest:
7e1c0be404dc931b953740adfff6d1696f772decf3128f08433129a7a4ef0a97 - Sigstore transparency entry: 1186482008
- Sigstore integration time:
-
Permalink:
SylviaZiyuZhang/muvera@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SylviaZiyuZhang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file muvera_rs-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: muvera_rs-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 638.9 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
248f7492220aceb0d586b7f22b319c92ca268f8517246754f257137c834cf9b4
|
|
| MD5 |
86ee2a63c74244ce2af240b533ee42c9
|
|
| BLAKE2b-256 |
c8c65af1c08699989f537bb1027f7a7f34c22a9c65dcc9282c56b4ab90ec2449
|
Provenance
The following attestation bundles were made for muvera_rs-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl:
Publisher:
python-release.yml on SylviaZiyuZhang/muvera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muvera_rs-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
248f7492220aceb0d586b7f22b319c92ca268f8517246754f257137c834cf9b4 - Sigstore transparency entry: 1186482011
- Sigstore integration time:
-
Permalink:
SylviaZiyuZhang/muvera@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SylviaZiyuZhang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file muvera_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: muvera_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 556.8 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb27a66e146ba0563771127d465da8f82e8c153434bf7873f273e30d851846b0
|
|
| MD5 |
7b29e10640e164b05b00c98f91f41bab
|
|
| BLAKE2b-256 |
37e779d2e1f5d82294c0fe4db46f39a74b59805d0596b9b40fb9b26962d1651a
|
Provenance
The following attestation bundles were made for muvera_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
python-release.yml on SylviaZiyuZhang/muvera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muvera_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
cb27a66e146ba0563771127d465da8f82e8c153434bf7873f273e30d851846b0 - Sigstore transparency entry: 1186482006
- Sigstore integration time:
-
Permalink:
SylviaZiyuZhang/muvera@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SylviaZiyuZhang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-release.yml@a1b5ae0dd73a2b17faa9514122d640cc37ebfa63 -
Trigger Event:
workflow_dispatch
-
Statement type: