-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: v0.38.0 and qdrant page (#257)
* feat: qdrant page * chore: v0.38.0 * fix: add qdrant page * fix: qdrant * docs: update persist docs, add warning * msrv 1.75
- Loading branch information
Showing
26 changed files
with
116 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: "Shuttle Qdrant" | ||
icon: "database" | ||
--- | ||
|
||
This plugin allows services to connect to a [Qdrant](https://qdrant.tech/) database. Qdrant is a vector database & vector similarity search engine. | ||
|
||
You can get started in seconds by cloning our Axum + Qdrant example with | ||
|
||
```bash | ||
cargo shuttle init --from shuttle-hq/shuttle-examples --subfolder axum/qdrant | ||
``` | ||
|
||
## Usage | ||
|
||
<Note>**IMPORTANT:** Currently Shuttle isn't able to provision a Qdrant Cloud cluster for you (yet). This means you will have to create an account on their [website](https://qdrant.tech/) and follow the few steps required to create a cluster and an API key to access it.</Note> | ||
|
||
Add `shuttle-qdrant` and `qdrant-client` to the dependencies for your service by running `cargo add shuttle-qdrant [email protected]`. This resource will be provided by adding the `shuttle_qdrant::Qdrant` attribute to your Shuttle main function. | ||
|
||
It returns a `qdrant_client::QdrantClient`. When running locally it will by default spin up a Qdrant Docker container for your project. | ||
|
||
If you want to connect to a remote database when running locally, you can specify the `local_url` parameter. | ||
|
||
### Parameters | ||
|
||
| Parameter | Type | Required? | Description | | ||
| ---------- | ------ | --------- | ----------- | | ||
| cloud_url | &str | In deployment | URL of the database to connect to. NOTE: It should use the gRPC port. | | ||
| api_key | &str | No | Required if the database requires an API key. | | ||
| local_addr | &str | No | If specified, connect to this URL on local runs instead of using a Docker container. | | ||
|
||
<Warning>Make sure the `cloud_url` parameter is specifying the gRPC port of the database. This is typically done by adding `:6334` at the end.</Warning> | ||
|
||
You can use secrets interpolation to set the URL and API key. See below for an example. | ||
|
||
### Example | ||
|
||
In the case of an Axum server, your main function can look like this: | ||
|
||
```rust | ||
use qdrant_client::prelude::*; | ||
|
||
#[shuttle_runtime::main] | ||
async fn axum( | ||
#[shuttle_qdrant::Qdrant(cloud_url = "{secrets.CLOUD_URL}", api_key = "{secrets.API_KEY}")] | ||
qdrant: QdrantClient, | ||
) -> shuttle_axum::ShuttleAxum { | ||
// set up state and router... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters