Qdrant Python Client

raw JSON →
1.17.0 verified Tue May 12 auth: no python install: verified quickstart: verified

Official Python client for the Qdrant vector search engine. Supports both remote server (gRPC or REST) and local in-memory/on-disk mode without a running server. All data operations use query_points() as the unified interface as of 1.10+. Prior search/recommend/discover methods removed in 1.14.0. Bundles FastEmbed for optional local embedding generation. Async support via AsyncQdrantClient.

pip install qdrant-client
error AttributeError: 'QdrantClient' object has no attribute 'search'
cause The `search`, `recommend`, and `discover` methods were deprecated in `qdrant-client` 1.10 and completely removed in 1.14.0.
fix
Use the unified client.query_points() method instead, specifying query_vector and optional query_params (from qdrant_client.models).
error grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with status #14 and gRPC code 'UNAVAILABLE'
cause The Qdrant client could not establish a connection with the Qdrant server, typically due to the server not running, incorrect host/port, or network/firewall issues.
fix
Verify that the Qdrant server is running and accessible from your client, ensuring the url (e.g., http://localhost:6333) and any API keys are correctly configured in QdrantClient.
error ImportError: cannot import name 'PointStruct' from 'qdrant_client.http.models'
cause Model classes like `PointStruct`, `VectorParams`, and `CollectionConfig` are now directly available from `qdrant_client.models`, not from the internal `qdrant_client.http.models` path.
fix
Update the import statement to from qdrant_client.models import PointStruct (or the respective model class).
error KeyError: 'vector'
cause When upserting points, each point must be a dictionary containing at least an 'id' and a 'vector' key, or be a `PointStruct` object; this error occurs if the 'vector' key is missing.
fix
Ensure each point is a dictionary like {'id': 1, 'vector': [0.1, 0.2, ...]} or a PointStruct object, e.g., PointStruct(id=1, vector=[0.1, 0.2, ...]).
breaking client.search(), client.recommend(), client.discover(), client.search_batch(), client.recommend_batch(), client.discovery_batch() all removed in 1.14.0. Massive amount of tutorials, LangChain/LlamaIndex integrations, and LLM-generated code uses client.search(). Raises AttributeError on 1.14+.
fix Replace all with client.query_points(). For batch: client.query_batch_points(). Migration guide: qdrant.tech/documentation/concepts/search/
breaking client.upload_records() removed in 1.14.0. Raises AttributeError.
fix Replace with client.upload_points() using PointStruct(id=..., vector=..., payload=...) objects.
breaking init_from parameter in create_collection() removed in 1.14.0.
fix Use client.update_collection_aliases() or migrate data manually if you were using init_from for collection cloning.
breaking Pydantic <2.2.1 is not supported. Supported versions are v1.10.x and >=2.2.1. Intermediate Pydantic 2.0–2.2.0 raises validation errors.
fix Pin pydantic to either >=1.10,<2.0 or >=2.2.1. Avoid 2.0.0–2.2.0.
gotcha Local in-memory mode (QdrantClient(':memory:')) does not persist. Data is lost when the process exits. QdrantClient(path='...') persists to disk but does not support concurrent multi-process access.
fix For production or multi-process access, run a Qdrant server (Docker or binary) and connect via QdrantClient(url='http://localhost:6333').
gotcha collection.query_points() offset parameter is no longer propagated into prefetches for nested queries. Pre-1.13 behavior silently passed offset into sub-queries; current behavior does not.
fix Apply offset only at the top-level query_points() call, not in nested prefetch structures.
gotcha AsyncQdrantClient raw gRPC methods are not accessible from the sync QdrantClient as of 1.11. Mixing sync client with raw async gRPC calls raises AttributeError.
fix Use AsyncQdrantClient for async gRPC operations. Do not attempt to access .grpc_* methods from the synchronous QdrantClient.
pip install 'qdrant-client[fastembed]'
python os / libc variant status wheel install import disk
3.10 alpine (musl) fastembed - - 2.24s 139.0M
3.10 alpine (musl) qdrant-client - - 4.51s 131.7M
3.10 slim (glibc) fastembed - - 5.92s 305M
3.10 slim (glibc) qdrant-client - - 2.88s 124M
3.11 alpine (musl) fastembed - - 3.15s 148.8M
3.11 alpine (musl) qdrant-client - - 5.65s 141.9M
3.11 slim (glibc) fastembed - - 6.03s 265M
3.11 slim (glibc) qdrant-client - - 3.92s 134M
3.12 alpine (musl) fastembed - - 3.08s 146.5M
3.12 alpine (musl) qdrant-client - - 4.60s 129.7M
3.12 slim (glibc) fastembed - - 6.16s 251M
3.12 slim (glibc) qdrant-client - - 3.79s 122M
3.13 alpine (musl) fastembed - - 3.38s 146.8M
3.13 alpine (musl) qdrant-client - - 4.32s 129.2M
3.13 slim (glibc) fastembed - - 6.03s 251M
3.13 slim (glibc) qdrant-client - - 3.76s 121M
3.9 alpine (musl) fastembed - - 2.14s 146.4M
3.9 alpine (musl) qdrant-client - - 3.90s 138.9M
3.9 slim (glibc) fastembed - - 4.65s 298M
3.9 slim (glibc) qdrant-client - - 3.01s 134M

query_points() is the unified search interface in 1.10+. upload_points() replaces the removed upload_records().

from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct

# In-memory (no server needed)
client = QdrantClient(':memory:')

# Persistent local mode
# client = QdrantClient(path='/path/to/db')

# Remote server
# client = QdrantClient(url='http://localhost:6333')

client.create_collection(
    collection_name='my_docs',
    vectors_config=VectorParams(size=4, distance=Distance.COSINE),
)

client.upload_points(
    collection_name='my_docs',
    points=[
        PointStruct(id=1, vector=[0.1, 0.2, 0.3, 0.4], payload={'text': 'hello'}),
        PointStruct(id=2, vector=[0.5, 0.6, 0.7, 0.8], payload={'text': 'world'}),
    ],
)

results = client.query_points(
    collection_name='my_docs',
    query=[0.1, 0.2, 0.3, 0.4],
    limit=2,
)
print(results.points)