Qdrant is an open-source vector similarity search engine built for production-ready vector search applications. It provides a convenient API to store, search, and manage vectors with additional payload data.

Portkey provides a proxy to Qdrant, allowing you to use virtual keys and observability features.

Portkey SDK Integration with Qdrant

Portkey provides a consistent API to interact with models from various providers. To integrate Qdrant with Portkey:

1. Install the Portkey SDK

Add the Portkey SDK to your application to interact with Qdrant through Portkey’s gateway.

npm install --save portkey-ai

2. Initialize Portkey with a Virtual Key

To use Qdrant with Portkey, get your API key from Qdrant App, then add it to Portkey to create your Qdrant virtual key.

You will also need your Portkey API Key from Portkey’s Dashboard.

import Portkey from 'portkey-ai'

const portkey = new Portkey({
    apiKey: "PORTKEY_API_KEY", // defaults to process.env["PORTKEY_API_KEY"]
    virtualKey: "VIRTUAL_KEY" // Your Qdrant Virtual Key
})

3. Use the Portkey SDK to interact with Qdrant

from portkey_ai import Portkey

portkey = Portkey(
    api_key="PORTKEY_API_KEY",  # Replace with your Portkey API key
    virtual_key="QDRANT_VIRTUAL_KEY",
    custom_host="QDRANT_HOST" # Replace with your Qdrant host
)

response = portkey.post(
    url="https://xxxx-xxx-xxx-xx-xxxxxx.us-west-2-0.aws.cloud.qdrant.io", # Qdrant search endpoint, you can use any Qdrant endpoint
)

print(response)