{"id":16361868,"url":"https://github.com/enet4/faiss-rs","last_synced_at":"2025-05-15T05:07:48.931Z","repository":{"id":28738067,"uuid":"119205516","full_name":"Enet4/faiss-rs","owner":"Enet4","description":"Rust language bindings for Faiss","archived":false,"fork":false,"pushed_at":"2025-03-03T10:50:27.000Z","size":332,"stargazers_count":215,"open_issues_count":15,"forks_count":44,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T05:07:41.009Z","etag":null,"topics":["faiss","hacktoberfest","rust-bindings"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Enet4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-27T21:50:14.000Z","updated_at":"2025-04-24T00:51:13.000Z","dependencies_parsed_at":"2024-04-01T17:47:27.742Z","dependency_job_id":"7c1a9e25-69f2-4800-a406-ca28d31e87d1","html_url":"https://github.com/Enet4/faiss-rs","commit_stats":{"total_commits":231,"total_committers":7,"mean_commits":33.0,"dds":"0.33766233766233766","last_synced_commit":"9ce7106180d462b88e8809d38666b317fa5a1fdb"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enet4%2Ffaiss-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enet4%2Ffaiss-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enet4%2Ffaiss-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enet4%2Ffaiss-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enet4","download_url":"https://codeload.github.com/Enet4/faiss-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faiss","hacktoberfest","rust-bindings"],"created_at":"2024-10-11T02:15:03.139Z","updated_at":"2025-05-15T05:07:43.921Z","avatar_url":"https://github.com/Enet4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Faiss-rs\n\n[![faiss at crates.io](https://img.shields.io/crates/v/faiss.svg)](https://crates.io/crates/faiss)\n[![Continuous integration status](https://github.com/Enet4/faiss-rs/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Enet4/faiss-rs/actions/workflows/ci.yml)\n![Minimum Rust Version Stable](https://img.shields.io/badge/Minimum%20Rust%20Version-stable-green.svg)\n[![dependency status](https://deps.rs/repo/github/Enet4/faiss-rs/status.svg)](https://deps.rs/repo/github/Enet4/faiss-rs)\n\nThis project provides Rust bindings to [Faiss](https://github.com/facebookresearch/faiss),\nthe state-of-the-art vector search and clustering library.\n\n## Installing with dynamic linking\n\nBy default, this crate is dynamically linked with the Faiss library installed in your system,\nso it does not build Faiss automatically for you.\nTo build the library yourself:\n\n  1. Follow the instructions [here](https://github.com/Enet4/faiss/tree/c_api_head/INSTALL.md#step-1-invoking-cmake)\n     to build Faiss using CMake,\n     enabling the variables `FAISS_ENABLE_C_API` and `BUILD_SHARED_LIBS`.\n     The crate is currently only compatible with version v1.7.2.\n     Consider building Faiss from [this fork, `c_api_head` branch](https://github.com/Enet4/faiss/tree/c_api_head),\n     which will contain the latest supported bindings to the C interface.\n     For example:\n\n     ```sh\n     cmake -B build -DFAISS_ENABLE_C_API=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release\n     cmake --build build\n     ```\n\n     This will result in the dynamic library `faiss_c` (\"c_api/libfaiss_c.so\" on Linux),\n     which needs to be installed in a place where your system will pick up\n     (in Linux, try somewhere in the `LD_LIBRARY_PATH` environment variable, such as \"/usr/lib\",\n     or try adding a new path to this variable. For mac users, this means placing it in `/usr/local/lib/libfaiss_c.dylib`).\n     For GPU support, don't forget to enable the option `FAISS_ENABLE_GPU`.\n     **Note:** `faiss_c` might link dynamically to the native `faiss` library,\n     which in that case you will need to install the main shared object (faiss/libfaiss.so)\n     as well.\n  2. You are now ready to include this crate as a dependency:\n\n     ```toml\n     [dependencies]\n     \"faiss\" = \"0.11.0\"\n     ```\n\nIf you have built Faiss with GPU support, you can include the \"gpu\" Cargo feature:\n\n```toml\n[dependencies]\n\"faiss\" = { version = \"0.11.0\", features = [\"gpu\"] }\n```\n\n## Installing with static linking\n\nAlternatively to the above, enable the \"static\" Cargo feature to let Rust build Faiss for you.\nYou will still need the dependencies required to build and run Faiss\nas described in their [INSTALL.md](https://github.com/Enet4/faiss/blob/c_api_head/INSTALL.md#building-from-source),\nnamely a compatible C++ compiler and a BLAS implementation.\n\n```toml\n[dependencies]\n\"faiss\" = { version = \"0.11.0\", features = [\"static\"] }\n```\n\nCompiling Faiss with GPU support is also possible.\n\n```toml\n[dependencies]\n\"faiss\" = { version = \"0.11.0\", features = [\"static\", \"gpu\"] }\n```\n\n## Using\n\nA basic example is seen below. Please check out the [documentation](https://docs.rs/faiss) for more.\n\n```rust\nuse faiss::{Index, index_factory, MetricType};\n\nlet mut index = index_factory(64, \"Flat\", MetricType::L2)?;\nindex.add(\u0026my_data)?;\n\nlet result = index.search(\u0026my_query, 5)?;\nfor (i, (l, d)) in result.labels.iter()\n    .zip(result.distances.iter())\n    .enumerate()\n{\n    println!(\"#{}: {} (D={})\", i + 1, *l, *d);\n}\n```\n\n## License and attribution notice\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n\nThis work is not affiliated with Facebook AI Research or the main Faiss software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenet4%2Ffaiss-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenet4%2Ffaiss-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenet4%2Ffaiss-rs/lists"}