qdrant-client 1.15.1


pip install qdrant-client

  Latest version

Released: Jul 31, 2025


Meta
Author: Andrey Vasnetsov
Requires Python: >=3.9

Classifiers

License
  • OSI Approved :: Apache Software License

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Qdrant

Python Client library for the Qdrant vector search engine.

PyPI version OpenAPI Docs Apache 2.0 License Discord Roadmap 2025

Python Qdrant Client

Client library and SDK for the Qdrant vector search engine.

Library contains type definitions for all Qdrant API and allows to make both Sync and Async requests.

Client allows calls for all Qdrant API methods directly. It also provides some additional helper methods for frequently required operations, e.g. initial collection uploading.

See QuickStart for more details!

Installation

pip install qdrant-client

Features

  • Type hints for all API methods
  • Local mode - use same API without running server
  • REST and gRPC support
  • Minimal dependencies
  • Extensive Test Coverage

Local mode

Qdrant

Python client allows you to run same code in local mode without running Qdrant server.

Simply initialize client like this:

from qdrant_client import QdrantClient

client = QdrantClient(":memory:")
# or
client = QdrantClient(path="path/to/db")  # Persists changes to disk

Local mode is useful for development, prototyping and testing.

  • You can use it to run tests in your CI/CD pipeline.
  • Run it in Colab or Jupyter Notebook, no extra dependencies required. See an example
  • When you need to scale, simply switch to server mode.

Connect to Qdrant server

To connect to Qdrant server, simply specify host and port:

from qdrant_client import QdrantClient

client = QdrantClient(host="localhost", port=6333)
# or
client = QdrantClient(url="http://localhost:6333")

You can run Qdrant server locally with docker:

docker run -p 6333:6333 qdrant/qdrant:latest

See more launch options in Qdrant repository.

Connect to Qdrant cloud

You can register and use Qdrant Cloud to get a free tier account with 1GB RAM.

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>",
)

Inference API

Qdrant Client has Inference API that allows to seamlessly create embeddings and use them in Qdrant. Inference API can be used locally with FastEmbed or remotely with models available in Qdrant Cloud.

Local Inference with FastEmbed

pip install qdrant-client[fastembed]

FastEmbed is a library for creating fast vector embeddings on CPU. It is based on ONNX Runtime and allows to run inference both on CPU and GPU.

Qdrant Client can use FastEmbed to create embeddings and upload them to Qdrant. This allows to simplify API and make it more intuitive.

from qdrant_client import QdrantClient, models

# running qdrant in local mode suitable for experiments
client = QdrantClient(":memory:")  # or QdrantClient(path="path/to/db") for local mode and persistent storage

model_name = "sentence-transformers/all-MiniLM-L6-v2"
payload = [
    {"document": "Qdrant has Langchain integrations", "source": "Langchain-docs", },
    {"document": "Qdrant also has Llama Index integrations", "source": "LlamaIndex-docs"},
]
docs = [models.Document(text=data["document"], model=model_name) for data in payload]
ids = [42, 2]

client.create_collection(
    "demo_collection",
    vectors_config=models.VectorParams(
        size=client.get_embedding_size(model_name), distance=models.Distance.COSINE)
)

client.upload_collection(
    collection_name="demo_collection",
    vectors=docs,
    ids=ids,
    payload=payload,
)

search_result = client.query_points(
    collection_name="demo_collection",
    query=models.Document(text="This is a query document", model=model_name)
).points
print(search_result)

FastEmbed can also utilise GPU for faster embeddings. To enable GPU support, install

pip install 'qdrant-client[fastembed-gpu]'

In order to set GPU, extend documents from the previous example with options.

models.Document(text="To be computed on GPU", model=model_name, options={"cuda": True})

Note: fastembed-gpu and fastembed are mutually exclusive. You can only install one of them.

If you previously installed fastembed, you might need to start from a fresh environment to install fastembed-gpu.

Remote inference with Qdrant Cloud

Qdrant Cloud provides a set of predefined models that can be used for inference without a need to install any additional libraries or host models locally. (Currently available only on paid plans.)

Inference API is the same as in the local mode, but the client has to be instantiated with cloud_inference=True:

from qdrant_client import QdrantClient
client = QdrantClient(
    url="https://xxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxx.us-east.aws.cloud.qdrant.io:6333",
    api_key="<your-api-key>",
    cloud_inference=True,  # Enable remote inference
)

Note: remote inference requires images to be provided as base64 encoded strings or urls

Examples

Create a new collection

from qdrant_client.models import Distance, VectorParams

client.create_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)
# NOTE: consider splitting the data into chunks to avoid hitting the server's payload size limit
# or use `upload_collection` or `upload_points` methods which handle this for you
# WARNING: uploading points one-by-one is not recommended due to requests overhead
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.query_points(
    collection_name="my_collection",
    query=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.query_points(
    collection_name="my_collection",
    query=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
)

See more examples in our Documentation!

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

Starting from version 1.6.1, all python client methods are available in async version.

To use it, just import AsyncQdrantClient instead of QdrantClient:

import asyncio

import numpy as np

from qdrant_client import AsyncQdrantClient, models


async def main():
    # Your async code using QdrantClient might be put here
    client = AsyncQdrantClient(url="http://localhost:6333")

    await client.create_collection(
        collection_name="my_collection",
        vectors_config=models.VectorParams(size=10, distance=models.Distance.COSINE),
    )

    await client.upsert(
        collection_name="my_collection",
        points=[
            models.PointStruct(
                id=i,
                vector=np.random.rand(10).tolist(),
            )
            for i in range(100)
        ],
    )

    res = await client.query_points(
        collection_name="my_collection",
        query=np.random.rand(10).tolist(),  # type: ignore
        limit=10,
    )

    print(res)

asyncio.run(main())

Both, gRPC and REST API are supported in async mode. More examples can be found here.

Development

This project uses git hooks to run code formatters.

Set up hooks with pre-commit install before making contributions.

1.15.1 Jul 31, 2025
1.15.0 Jul 18, 2025
1.14.3 Jun 16, 2025
1.14.2 Apr 24, 2025
1.14.1 Apr 22, 2025
1.14.0 Apr 22, 2025
1.13.3 Mar 05, 2025
1.13.2 Jan 22, 2025
1.13.1 Jan 22, 2025
1.13.0 Jan 17, 2025
1.12.2 Dec 27, 2024
1.12.1 Oct 29, 2024
1.12.0 Oct 08, 2024
1.11.3 Sep 24, 2024
1.11.2 Sep 16, 2024
1.11.1 Aug 26, 2024
1.11.0 Aug 12, 2024
1.10.1 Jul 08, 2024
1.10.0 Jul 01, 2024
1.9.2 Jun 20, 2024
1.9.1 May 03, 2024
1.9.0 Apr 22, 2024
1.8.2 Mar 27, 2024
1.8.1 Mar 27, 2024
1.8.0 Mar 06, 2024
1.7.3 Feb 08, 2024
1.7.2 Jan 31, 2024
1.7.1 Jan 19, 2024
1.7.0 Dec 08, 2023
1.6.9 Nov 15, 2023
1.6.8 Nov 15, 2023
1.6.7 Nov 15, 2023
1.6.6 Nov 15, 2023
1.6.5 Nov 15, 2023
1.6.4 Oct 26, 2023
1.6.3 Oct 16, 2023
1.6.2 Oct 16, 2023
1.6.1 Oct 16, 2023
1.6.0 Oct 09, 2023
1.5.4 Sep 12, 2023
1.5.3 Sep 12, 2023
1.5.2 Sep 11, 2023
1.5.1 Sep 11, 2023
1.5.0 Sep 07, 2023
1.4.0 Aug 03, 2023
1.3.2 Jul 26, 2023
1.3.1 Jun 26, 2023
1.3.0 Jun 23, 2023
1.2.0 May 24, 2023
1.1.7 May 09, 2023
1.1.6 Apr 25, 2023
1.1.5 Apr 19, 2023
1.1.4 Apr 11, 2023
1.1.3 Apr 08, 2023
1.1.2 Apr 07, 2023
1.1.1 Mar 30, 2023
1.1.0 Mar 17, 2023
1.0.5 Mar 12, 2023
1.0.4 Mar 01, 2023
1.0.3 Mar 01, 2023
1.0.2 Feb 24, 2023
1.0.1 Feb 15, 2023
1.0.0 Feb 08, 2023
0.11.10 Jan 30, 2023
0.11.9 Jan 22, 2023
0.11.8 Jan 21, 2023
0.11.7 Jan 13, 2023
0.11.6 Dec 27, 2022
0.11.5 Dec 06, 2022
0.11.4 Nov 25, 2022
0.11.3 Nov 15, 2022
0.11.1 Nov 04, 2022
0.11.0 Oct 26, 2022
0.10.3 Sep 28, 2022
0.10.2 Sep 19, 2022
0.10.1 Sep 19, 2022
0.10.0 Sep 19, 2022
0.9.7 Sep 01, 2022
0.9.5 Aug 26, 2022
0.9.4 Aug 25, 2022
0.9.3 Aug 24, 2022
0.9.2 Aug 23, 2022
0.9.1 Aug 22, 2022
0.9.0 Aug 08, 2022
0.8.7 Jul 26, 2022
0.8.6 Jul 10, 2022
0.8.5 Jul 08, 2022
0.8.4 Jul 05, 2022
0.8.3 Jun 28, 2022
0.8.0 Jun 08, 2022
0.7.3 May 24, 2022
0.7.2 May 24, 2022
0.7.1 May 04, 2022
0.7.0 Apr 13, 2022
0.6.1 Mar 10, 2022
0.6.0 Mar 04, 2022
0.5.0 Feb 03, 2022
0.4.1 Oct 25, 2021
0.3.12 Sep 25, 2021
0.3.11 Aug 28, 2021
0.3.10 Aug 28, 2021
0.3.9 Aug 10, 2021
0.3.8 Aug 08, 2021
0.3.7 Aug 08, 2021
0.3.6 Aug 08, 2021
0.3.5 Jul 06, 2021
0.3.4 Jun 20, 2021
0.3.3 Jun 13, 2021
0.3.2 Jun 10, 2021
0.3.1 Jun 07, 2021
0.3.0 Jun 03, 2021
0.2.0 Apr 06, 2021
0.1.5 Feb 09, 2021
0.1.4 Feb 09, 2021
0.1.3 Feb 09, 2021
0.1.2 Feb 09, 2021
0.1.1 Feb 09, 2021
0.1.0 Feb 09, 2021

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
grpcio (>=1.41.0)
httpx[http2] (>=0.20.0)
numpy and (>=1.21)
numpy (<2.1.0,>=1.21)
numpy (>=1.26)
numpy (>=2.1.0)
portalocker (<4.0,>=2.7.0)
protobuf (>=3.20.0)
pydantic (!=2.0.*,!=2.1.*,!=2.2.0,>=1.10.8)
urllib3 (<3,>=1.26.14)