migration-and-upload
Use qdrant-client bulk upload and collection migration helpers for batching, parallel ingestion, REST/gRPC upload paths, retries, and collision-safe migration.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- migration-and-upload
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use qdrant-client bulk upload and collection migration helpers for batching, parallel ingestion, REST/gRPC upload paths, retries, and collision-safe migration.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/troubleshooting.md9.9 KB
- 参考文档references/upload-and-migration.md14.5 KB
- 脚本scripts/upload_shape_check.py8.7 KB
03 SKILL.md 正文
Migration and Upload
Use this sub-skill when a task is about high-throughput ingestion or moving collections between Qdrant clients: upload_collection, upload_points, batching, parallel, wait, max_retries, REST versus gRPC uploader choice, or client.migrate(...) / qdrant_client.migrate.migrate(...).
Route Here For
- Loading many vectors, payloads, and ids into an existing collection.
- Choosing between
upload_collectionandupload_pointsfor dense, named, sparse, or multivector data. - Tuning
batch_size,parallel, multiprocessing startmethod,max_retries,wait,timeout, andprefer_grpcfor bulk upload. - Explaining user-level uploader internals: how batches are formed, how REST/gRPC uploaders build points, and what parallel workers do.
- Migrating all or selected collections from one
QdrantClientto another, including local-to-local, local-to-server, server-to-local, and server-to-server planning. - Handling migration collisions, unsupported custom-shard collections, and post-migration count validation.
Route Elsewhere
- Use
../client-operations/SKILL.mdfor ordinary collection creation,upsert,query_points,scroll,count, payload updates, indexes, snapshots, and one-off writes. - Use
../connection-and-transport/SKILL.mdfor constructing remote clients, Qdrant Cloud credentials,url, ports, TLS, headers, and transport authentication. - Use
../local-mode/SKILL.mdfor deciding betweenQdrantClient(":memory:")and persistent local storage, local locks, and local persistence behavior. - Use
../async-client/SKILL.mdwhen the surrounding application is async; treat these bulk helpers as blocking work unless the async reference says otherwise. - Use
../inference/SKILL.mdwhenmodels.Document,models.Image, FastEmbed, or Qdrant Cloud inference objects are the main concern before upload. - Use
../models-and-conversions/SKILL.mdfor low-level REST/gRPC model conversion and generated model schema details.
Start Here
- Ensure the target collection already exists with vector names, dimensions, dense/sparse settings, and sharding policy that match the data.
- Use
upload_collectionwhen vectors, payloads, and ids are separate aligned sequences; useupload_pointswhen each item is already amodels.PointStructwith its own id, vector, and payload. - For server or Cloud upload, prefer
wait=Truewhen the next step immediately reads counts or queries newly uploaded data. Leavewait=Falseonly when enqueue acknowledgement is enough. - For high-throughput server upload, construct the client with
prefer_grpc=Trueand a validgrpc_portwhen gRPC is available; REST remains the default and is easier to debug. - Read
references/upload-and-migration.mdbefore usingparallel > 1, custom shard keys, named vectors, sparse vectors, or migration. - Run
scripts/upload_shape_check.pyagainst a small JSON fixture or planned upload manifest when vector/payload/id alignment is uncertain.
Minimal Upload Patterns
Separate vectors, payloads, and ids:
import numpy as np
from qdrant_client import QdrantClient
client = QdrantClient(url="http://localhost:6333", prefer_grpc=True, grpc_port=6334)
client.upload_collection(
collection_name="items",
vectors=np.asarray([[0.1, 0.2, 0.3], [0.2, 0.3, 0.4]], dtype="float32"),
payload=[{"sku": "a"}, {"sku": "b"}],
ids=[1, 2],
batch_size=64,
parallel=2,
wait=True,
)
Point-structured upload:
from qdrant_client import QdrantClient, models
client = QdrantClient(":memory:")
client.upload_points(
collection_name="items",
points=[
models.PointStruct(id=1, vector=[0.1, 0.2, 0.3], payload={"sku": "a"}),
models.PointStruct(id=2, vector={"text": [0.2, 0.3, 0.4]}, payload={"sku": "b"}),
],
wait=True,
)
Shape check for a fixture before upload:
python sub-skills/migration-and-upload/scripts/upload_shape_check.py --spec upload.json --mode upload-collection --vector-size default=3
Minimal Migration Pattern
from qdrant_client import QdrantClient
source = QdrantClient(path="source-store")
destination = QdrantClient(":memory:")
source.migrate(
destination,
collection_names=["products", "documents"],
batch_size=100,
recreate_on_collision=False,
)
For the standalone function form:
from qdrant_client.migrate import migrate
migrate(source_client=source, dest_client=destination, collection_names=["products"])
Safety Defaults
- Do not use
recreate_on_collision=Trueunless deleting and recreating same-named destination collections is intended. - Do not migrate collections that use custom sharding; qdrant-client raises
ValueErrorbecause that migration path is unsupported. - Keep source collections stable during migration so final source and destination counts can match.
- For server uploads, increase
timeoutand reducebatch_sizebefore increasing retry loops when payloads are large or the service is rate-limited. - In local mode, upload helpers behave synchronously like
wait=True; remote-only tuning knobs such asparallel,batch_size, andwaitmatter most for server clients.
References
references/upload-and-migration.mdcovers method signatures, accepted shapes, batching, REST/gRPC uploader choice, parallel workers, wait semantics, retry behavior, shard keys, and migration internals.references/troubleshooting.mdcovers exhausted generators, vector/payload/id mismatches, service availability, custom-shard migration failures, collisions, batch-size/timeouts, and count mismatches.scripts/upload_shape_check.pyvalidates JSON upload fixtures or manifests without connecting to Qdrant.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).