{"id":21851514,"url":"https://github.com/qdrant/rust-client","last_synced_at":"2025-05-14T18:04:59.398Z","repository":{"id":39414031,"uuid":"506915807","full_name":"qdrant/rust-client","owner":"qdrant","description":"Rust client for Qdrant vector search engine ","archived":false,"fork":false,"pushed_at":"2025-04-22T13:56:59.000Z","size":1187,"stargazers_count":273,"open_issues_count":19,"forks_count":51,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-22T14:36:59.823Z","etag":null,"topics":["qdrant","rust-client","vector-search-engine"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/qdrant-client","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/qdrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-06-24T07:18:30.000Z","updated_at":"2025-04-22T13:53:59.000Z","dependencies_parsed_at":"2023-12-03T09:21:11.858Z","dependency_job_id":"9024514d-27e0-4a8c-b26f-31c83feea828","html_url":"https://github.com/qdrant/rust-client","commit_stats":{"total_commits":286,"total_committers":18,"mean_commits":15.88888888888889,"dds":0.6958041958041958,"last_synced_commit":"1707b92b0bbfb2f6a16bc7d34d579ad9fb8eff04"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Frust-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Frust-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Frust-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qdrant%2Frust-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qdrant","download_url":"https://codeload.github.com/qdrant/rust-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254198514,"owners_count":22030965,"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":["qdrant","rust-client","vector-search-engine"],"created_at":"2024-11-28T01:08:27.476Z","updated_at":"2025-05-14T18:04:54.389Z","avatar_url":"https://github.com/qdrant.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Qdrant Rust client\n\nThe [Qdrant](https://qdrant.tech/) - High-Performance Vector Search at Scale - client for Rust.\n\n[![Crates.io][crates-badge]][crates-url]\n[![docs.rs][docs-badge]][docs-url]\n[![Apache 2.0 licensed][apache2-badge]][apache2-url]\n\n[crates-badge]: https://img.shields.io/crates/v/qdrant-client.svg\n\n[crates-url]: https://crates.io/crates/qdrant-client\n\n[docs-badge]: https://img.shields.io/docsrs/qdrant-client.svg\n\n[docs-url]: https://docs.rs/qdrant-client\n\n[apache2-badge]: https://img.shields.io/badge/license-apache2-blue.svg\n\n[apache2-url]: https://github.com/qdrant/rust-client/blob/master/LICENSE\n\nDocumentation:\n- Qdrant documentation: \u003chttps://qdrant.tech/documentation/\u003e\n- Crate documentation: \u003chttps://docs.rs/qdrant-client\u003e\n\n## Installation\n\n```bash\ncargo add qdrant-client\n```\n\nPackage is available in [crates.io](https://crates.io/crates/qdrant-client)\n\n## Examples\nA list of example snippets can be found [here](https://github.com/qdrant/api-reference/tree/main/snippets/rust)\n\nMore examples can be found in the [examples folder](https://github.com/qdrant/rust-client/tree/master/examples)\n\n## Dependencies\n\nThe client uses gRPC via the [Tonic](https://github.com/hyperium/tonic) library.\n\nTo change anything in the protocol buffer definitions, you need the `protoc` Protocol Buffers compiler, along with Protocol Buffers resource files.\n\nRefer to the [Tonic installation guide](https://github.com/hyperium/tonic#dependencies) for more details.\n\n## Usage\n\nRun Qdrant with enabled gRPC interface:\n\n```bash\n# With env variable\ndocker run -p 6333:6333 -p 6334:6334 \\\n    -e QDRANT__SERVICE__GRPC_PORT=\"6334\" \\\n    qdrant/qdrant\n```\n\nOr by updating the configuration file:\n\n```yaml\nservice:\n  grpc_port: 6334\n```\n\nMore info about gRPC in [documentation](https://qdrant.tech/documentation/quick_start/#grpc).\n\n### Making requests\n\nAdd necessary dependencies:\n\n```bash\ncargo add qdrant-client anyhow tonic tokio serde-json --features tokio/rt-multi-thread\n```\n\nAdd search example from [`examples/search.rs`](./examples/search.rs) to your `src/main.rs`:\n\n```rust\nuse qdrant_client::qdrant::{\n    Condition, CreateCollectionBuilder, Distance, Filter, PointStruct, ScalarQuantizationBuilder,\n    SearchParamsBuilder, SearchPointsBuilder, UpsertPointsBuilder, VectorParamsBuilder,\n};\nuse qdrant_client::{Payload, Qdrant, QdrantError};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), QdrantError\u003e {\n    // Example of top level client\n    // You may also use tonic-generated client from `src/qdrant.rs`\n    let client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\n    let collections_list = client.list_collections().await?;\n    dbg!(collections_list);\n    // collections_list = {\n    //   \"collections\": [\n    //     {\n    //       \"name\": \"test\"\n    //     }\n    //   ]\n    // }\n\n    let collection_name = \"test\";\n    client.delete_collection(collection_name).await?;\n\n    client\n        .create_collection(\n            CreateCollectionBuilder::new(collection_name)\n                .vectors_config(VectorParamsBuilder::new(10, Distance::Cosine))\n                .quantization_config(ScalarQuantizationBuilder::default()),\n        )\n        .await?;\n\n    let collection_info = client.collection_info(collection_name).await?;\n    dbg!(collection_info);\n\n    let payload: Payload = serde_json::json!(\n        {\n            \"foo\": \"Bar\",\n            \"bar\": 12,\n            \"baz\": {\n                \"qux\": \"quux\"\n            }\n        }\n    )\n    .try_into()\n    .unwrap();\n\n    let points = vec![PointStruct::new(0, vec![12.; 10], payload)];\n    client\n        .upsert_points(UpsertPointsBuilder::new(collection_name, points))\n        .await?;\n\n    let search_result = client\n        .search_points(\n            SearchPointsBuilder::new(collection_name, [11.; 10], 10)\n                .filter(Filter::all([Condition::matches(\"bar\", 12)]))\n                .with_payload(true)\n                .params(SearchParamsBuilder::default().exact(true)),\n        )\n        .await?;\n    dbg!(\u0026search_result);\n    // search_result = [\n    //   {\n    //     \"id\": 0,\n    //     \"version\": 0,\n    //     \"score\": 1.0000001,\n    //     \"payload\": {\n    //       \"bar\": 12,\n    //       \"baz\": {\n    //         \"qux\": \"quux\"\n    //       },\n    //       \"foo\": \"Bar\"\n    //     }\n    //   }\n    // ]\n\n    let found_point = search_result.result.into_iter().next().unwrap();\n    let mut payload = found_point.payload;\n    let baz_payload = payload.remove(\"baz\").unwrap().into_json();\n    println!(\"baz: {}\", baz_payload);\n    // baz: {\"qux\":\"quux\"}\n\n    Ok(())\n}\n```\n\nOr run the example from this project directly:\n\n```bash\ncargo run --example search\n```\n\n## Qdrant Cloud\n\n[Qdrant Cloud](https://cloud.qdrant.io) is a managed service for Qdrant.\n\nThe client needs to be configured properly to access the service.\n\n- make sure to use the correct port (6334)\n- make sure to pass your API KEY\n\n```rust\nuse qdrant_client::Qdrant;\n\nlet client = Qdrant::from_url(\"http://xxxxxxxxxx.eu-central.aws.cloud.qdrant.io:6334\")\n    // Use an environment variable for the API KEY for example\n    .api_key(std::env::var(\"QDRANT_API_KEY\"))\n    .build()?;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Frust-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqdrant%2Frust-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqdrant%2Frust-client/lists"}