Nvidia Unveils Futuristic Gaming Experience at Computex 2023
News

Nvidia Unveils Futuristic Gaming Experience at Computex 2023, Blending Gaming and AI

by Isabel
May 29, 2023
0

At Computex 2023, Nvidia displays a futuristic gaming experience that...

Read more
Adobe Introduces Powerful Generative AI Tools in Photoshop

Adobe Introduces Powerful Generative AI Tools in Photoshop Beta

May 29, 2023
Adobe Photoshop's Generative Fill Feature

Exploring the Power of Adobe Photoshop’s Generative Fill Feature

May 27, 2023
NVIDIA and Microsoft Partner to Accelerate AI

NVIDIA and Microsoft Partner to Accelerate AI

May 25, 2023
google photos security and privacy

Exploring the Top 5 Privacy and Security Risks of using Google Photos

May 24, 2023
Everything you need to know about AutoGPT

Everything you need to know about AutoGPT

May 4, 2023
How to access ChatGPT 4 for free

How to Access ChatGPT 4 for Free

April 26, 2023
AutoGPT and ChatGPT

AutoGPT and ChatGPT: Discovering the World of AI Language Models

May 4, 2023
QLoRA Fine-tune LLMs

QLoRA: Efficient Finetuning of Quantized LLMs

May 29, 2023
WebWhiz AI

WebWhiz AI: The Chatbot Platform That Can Help Your Business

May 16, 2023
Introducing Bard, Google’s response to ChatGPT

Introducing Bard, Google’s response to ChatGPT

February 8, 2023
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Artificial Intelligence

Qdrant: Boost Your Search Capabilities with Efficient Vector Search

by Cloudbooklet
May 9, 2023
in Artificial Intelligence
Reading Time: 7 mins read
Qdrant Vector Search Engine
Share on FacebookShare on TwitterShare on WhatsAppShare on Telegram

Qdrant is a high-performance vector search engine and database that offers a dependable and production-ready service with a simple API for storing, searching, and managing vectors and other metadata. Qdrant is intended to provide extended filtering, making it particularly appropriate for applications requiring neural network or semantic-based matching, faceted search, and other related use cases.

Qdrant is written in the Rust programming language, which promises unrivalled speed, performance, and reliability even under extreme load. Qdrant’s benchmarks indicate its capacity to efficiently and swiftly handle massive amounts of high-dimensional data.

You might also like

ChatGPT app

The Easiest Way to Download ChatGPT App Free

May 31, 2023
LLM Connected with APIs

Gorilla: LLM Connected with APIs

May 31, 2023

Table of Contents

  1. Local Installation
  2. Qdrant Install using Docker
  3. Connect to Qdrant cloud
  4. Features

Qdrant enables you to transform embeddings or neural network encoders into full-fledged apps for matching, searching, recommending, and much more. Its user-friendly API and extensive search features make it simple to create complicated similarity search apps without worrying about the underlying infrastructure.

Local Installation

Install Qdrant client using pip.

pip install qdrant-client

The Python client allows you to run the same code in local mode without launching the Qdrant server. Simply put, initialise client as follows:

from qdrant_client import QdrantClient

client = QdrantClient(path="path/to/db")

Qdrant Install using Docker

The simplest approach to get started with Qdrant is to run it from a Docker image. DockerHub always has the most recent versions.

sudo docker info

Pull the image for Docker

docker pull qdrant/qdrant

Run the container

docker run -p 6333:6333 \
    -v $(pwd)/path/to/data:/qdrant/storage \
    qdrant/qdrant

This command launches a Qdrant instance using the default settings. It will save all data in the directory ./path/to/data.

Now Qdrant should be accessible at localhost:6333.

Connect to Qdrant cloud

You can register and use Qdrant Cloud to get a free tier.

Once you have your cluster and API key, you can connect to it like this:

from qdrant_client import QdrantClient

qdrant_client = QdrantClient(
    url="https://xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxx.us-east.aws.cloud.qdrant.io:6333",
    api_key="<your-api-key>",
)

Examples

Create a new collection

from qdrant_client.models import Distance, VectorParams

client.recreate_collection(
    collection_name="my_collection",
    vectors_config=VectorParams(size=100, distance=Distance.COSINE),
)

Insert vectors into a collection

import numpy as np
from qdrant_client.models import PointStruct

vectors = np.random.rand(100, 100)
client.upsert(
    collection_name="my_collection",
    points=[
        PointStruct(
            id=idx,
            vector=vector.tolist(),
            payload={"color": "red", "rand_number": idx % 10}
        )
        for idx, vector in enumerate(vectors)
    ]
)

Search for similar vectors

query_vector = np.random.rand(100)
hits = client.search(
    collection_name="my_collection",
    query_vector=query_vector,
    limit=5  # Return 5 closest points
)

Search for similar vectors with filtering condition

from qdrant_client.models import Filter, FieldCondition, Range

hits = client.search(
    collection_name="my_collection",
    query_vector=query_vector,
    query_filter=Filter(
        must=[  # These conditions are required for search results
            FieldCondition(
                key='rand_number', # Condition based on values of `rand_number` field.
                range=Range(
                    gte=3 # Select only those results where `rand_number` >= 3
                )
            )
        ]
    ),
    limit=5 # Return 5 closest points
)

gRPC

To enable (typically, much faster) collection uploading with gRPC, use the following initialization:

from qdrant_client import QdrantClient

client = QdrantClient(host="localhost", grpc_port=6334, prefer_grpc=True)

Async client

Raw autogenerated clients support async methods. Normally, you don’t need to use them directly, but if you need extra performance, you can.

Async gRPC

Example of using raw async gRPC client:

from qdrant_client import QdrantClient, grpc

client = QdrantClient(prefer_grpc=True, timeout=3.0)

grpc_collections = client.async_grpc_collections

res = await grpc_collections.List(grpc.ListCollectionsRequest(), timeout=1.0)

Development

This project uses git hooks to run code formatters.

Install pre-commit with pip3 install pre-commit and set up hooks with pre-commit install.

REST

Online OpenAPI 3.0 documentation is available here. OpenAPI makes it easy to generate a client for virtually any framework or programming language. You can also download raw OpenAPI definitions.

Also, Read Google Search Engine and OpenAI’s ChatGPT.

Features

Filtering and Payload

JSON payloads can be associated with vectors in Qdrant, which provides both storing and filtering depending on payload values. Unlike Elastic Search post-filtering, it enables various combinations of should, must, and must_not conditions, ensuring recovery of all relevant vectors.

Rich Data Types

The vector payload supports a wide range of data kinds and query conditions, such as text matching, numerical ranges, geo-locations, and others. These filtering conditions give you the ability to build unique business logic on top of similarity matching.

Query Planning and Payload Indexes

To optimise query execution, the query planner makes use of cached payload information. Smaller search spaces constrained by filters, for example, may benefit from full brute force over an index.

SIMD Hardware Acceleration

Qdrant gives higher search performance on modern hardware by utilising modern CPU x86-x64 architectures.

Write-Ahead Logging

Qdrant supports data persistence by confirming updates, even during power interruptions. The update log records all operations, allowing for easy reconstruction of the most recent database state.

Distributed Deployment

As of v0.8.0, Qdrant supports distributed deployment. Multiple Qdrant machines form a cluster for horizontal scaling, coordinated through the Raft protocol.

Stand-alone

Qdrant operates independently of external databases or orchestration controllers, which simplifies configuration.

This article is to help you learn about Qdrant. We trust that it has been helpful to you. Please feel free to share your thoughts and feedback in the comment section below.

Continue Reading
ShareTweetSendShare
Cloudbooklet

Cloudbooklet

Help us grow and support our blog! Your contribution can make a real difference in providing valuable content to our readers. Join us in our journey by supporting our blog today!
Buy me a Coffee

Related Posts

Soundstorm-Pytorch

Soundstorm-Pytorch: A Powerful Tool for Audio Generation

May 30, 2023
Midjourney vs Adobe Firefly

Midjourney vs Adobe Firefly: A Comparison of Two AI Image Generation Tools

May 30, 2023
ChatGPT

How to Use ChatGPT Code Interpreter

May 31, 2023
Leonardo AI Login

How to login and use Leonardo AI to generate high-quality image

May 30, 2023

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

I agree to the Terms & Conditions and Privacy Policy.

Cloudbooklet

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Linux
  • Google Cloud
  • AWS

Cloudbooklet © 2023 All rights reserved.

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.