Skip to content

Commit d68c7ba

Browse files
committed
Update protocol definitions for Qdrant 1.13 (#208)
* Update gRPC protocol buffer definitions * Generate gRPC types, update builders and conversions * Add max optimization threads builder * Add bool index params builder * Add has vector condition builder * Add dense, sparse and multi dense vector builders and conversions * Remove has vector condition builder, follow pattern of other conditions
1 parent c35b70d commit d68c7ba

17 files changed

+941
-74
lines changed

proto/collections.proto

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ enum CompressionRatio {
145145
x64 = 4;
146146
}
147147

148+
message MaxOptimizationThreads {
149+
enum Setting {
150+
Auto = 0;
151+
}
152+
153+
oneof variant {
154+
uint64 value = 1;
155+
Setting setting = 2;
156+
}
157+
}
158+
148159
message OptimizerStatus {
149160
bool ok = 1;
150161
string error = 2;
@@ -237,7 +248,7 @@ message OptimizersConfigDiff {
237248
optional uint64 max_segment_size = 4;
238249
/*
239250
Maximum size (in kilobytes) of vectors to store in-memory per segment.
240-
Segments larger than this threshold will be stored as read-only memmaped file.
251+
Segments larger than this threshold will be stored as read-only memmapped file.
241252
242253
Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value.
243254
@@ -260,13 +271,17 @@ message OptimizersConfigDiff {
260271
Interval between forced flushes.
261272
*/
262273
optional uint64 flush_interval_sec = 7;
274+
275+
// Deprecated in favor of `max_optimization_threads`
276+
optional uint64 deprecated_max_optimization_threads = 8;
277+
263278
/*
264279
Max number of threads (jobs) for running optimizations per shard.
265280
Note: each optimization job will also use `max_indexing_threads` threads by itself for index building.
266-
If null - have no limit and choose dynamically to saturate CPU.
281+
If "auto" - have no limit and choose dynamically to saturate CPU.
267282
If 0 - no optimization threads, optimizations will be disabled.
268283
*/
269-
optional uint64 max_optimization_threads = 8;
284+
optional MaxOptimizationThreads max_optimization_threads = 9;
270285
}
271286

272287
message ScalarQuantization {
@@ -320,6 +335,13 @@ message StrictModeConfig {
320335
optional uint32 search_max_hnsw_ef = 6;
321336
optional bool search_allow_exact = 7;
322337
optional float search_max_oversampling = 8;
338+
optional uint64 upsert_max_batchsize = 9;
339+
optional uint64 max_collection_vector_size_bytes = 10;
340+
optional uint32 read_rate_limit = 11; // Max number of read operations per minute per replica
341+
optional uint32 write_rate_limit = 12; // Max number of write operations per minute per replica
342+
optional uint64 max_collection_payload_size_bytes = 13;
343+
optional uint64 filter_max_conditions = 14;
344+
optional uint64 condition_max_size = 15;
323345
}
324346

325347
message CreateCollection {
@@ -351,6 +373,7 @@ message UpdateCollection {
351373
optional VectorsConfigDiff vectors_config = 6; // New vector parameters
352374
optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector
353375
optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters
376+
optional StrictModeConfig strict_mode_config = 9; // New strict mode configuration
354377
}
355378

356379
message DeleteCollection {
@@ -430,6 +453,7 @@ message TextIndexParams {
430453
}
431454

432455
message BoolIndexParams {
456+
optional bool on_disk = 1; // If true - store index on disk.
433457
}
434458

435459
message DatetimeIndexParams {
@@ -530,7 +554,8 @@ enum ReplicaState {
530554
Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards
531555
PartialSnapshot = 5; // Deprecated: snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard
532556
Recovery = 6; // Shard is undergoing recovered by an external node; Normally rejects updates, accepts updates if force is true
533-
Resharding = 7; // Points are being migrated to this shard as part of resharding
557+
Resharding = 7; // Points are being migrated to this shard as part of scale-up resharding
558+
ReshardingScaleDown = 8; // Points are being migrated to this shard as part of scale-down resharding
534559
}
535560

536561
message ShardKey {
@@ -566,6 +591,15 @@ message ReshardingInfo {
566591
uint32 shard_id = 1;
567592
uint64 peer_id = 2;
568593
optional ShardKey shard_key = 3;
594+
ReshardingDirection direction = 4;
595+
}
596+
597+
/*
598+
Resharding direction, scale up or down in number of shards
599+
*/
600+
enum ReshardingDirection {
601+
Up = 0; // Scale up, add a new shard
602+
Down = 1; // Scale down, remove a shard
569603
}
570604

571605
message CollectionClusterInfoResponse {
@@ -574,8 +608,7 @@ message CollectionClusterInfoResponse {
574608
repeated LocalShardInfo local_shards = 3; // Local shards
575609
repeated RemoteShardInfo remote_shards = 4; // Remote shards
576610
repeated ShardTransferInfo shard_transfers = 5; // Shard transfers
577-
// TODO(resharding): enable on release:
578-
// repeated ReshardingInfo resharding_operations = 6; // Resharding operations
611+
repeated ReshardingInfo resharding_operations = 6; // Resharding operations
579612
}
580613

581614
message MoveShard {

proto/points.proto

Lines changed: 85 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,48 @@ message SparseIndices {
4646
repeated uint32 data = 1;
4747
}
4848

49+
message Document {
50+
string text = 1; // Text of the document
51+
string model = 3; // Model name
52+
map<string, Value> options = 4; // Model options
53+
}
54+
55+
message Image {
56+
Value image = 1; // Image data, either base64 encoded or URL
57+
string model = 2; // Model name
58+
map<string, Value> options = 3; // Model options
59+
}
60+
61+
message InferenceObject {
62+
Value object = 1; // Object to infer
63+
string model = 2; // Model name
64+
map<string, Value> options = 3; // Model options
65+
}
66+
4967
// Legacy vector format, which determines the vector type by the configuration of its fields.
5068
message Vector {
51-
repeated float data = 1; // Vector data (flatten for multi vectors)
52-
optional SparseIndices indices = 2; // Sparse indices for sparse vectors
53-
optional uint32 vectors_count = 3; // Number of vectors per multi vector
69+
repeated float data = 1; // Vector data (flatten for multi vectors), deprecated
70+
optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated
71+
optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated
72+
oneof vector {
73+
DenseVector dense = 101; // Dense vector
74+
SparseVector sparse = 102; // Sparse vector
75+
MultiDenseVector multi_dense = 103; // Multi dense vector
76+
Document document = 104;
77+
Image image = 105;
78+
InferenceObject object = 106;
79+
}
80+
}
81+
82+
message VectorOutput {
83+
repeated float data = 1; // Vector data (flatten for multi vectors), deprecated
84+
optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated
85+
optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated
86+
oneof vector {
87+
DenseVector dense = 101; // Dense vector
88+
SparseVector sparse = 102; // Sparse vector
89+
MultiDenseVector multi_dense = 103; // Multi dense vector
90+
}
5491
}
5592

5693
message DenseVector {
@@ -73,6 +110,9 @@ message VectorInput {
73110
DenseVector dense = 2;
74111
SparseVector sparse = 3;
75112
MultiDenseVector multi_dense = 4;
113+
Document document = 5;
114+
Image image = 6;
115+
InferenceObject object = 7;
76116
}
77117
}
78118

@@ -214,13 +254,24 @@ message NamedVectors {
214254
map<string, Vector> vectors = 1;
215255
}
216256

257+
message NamedVectorsOutput {
258+
map<string, VectorOutput> vectors = 1;
259+
}
260+
217261
message Vectors {
218262
oneof vectors_options {
219263
Vector vector = 1;
220264
NamedVectors vectors = 2;
221265
}
222266
}
223267

268+
message VectorsOutput {
269+
oneof vectors_options {
270+
VectorOutput vector = 1;
271+
NamedVectorsOutput vectors = 2;
272+
}
273+
}
274+
224275
message VectorsSelector {
225276
repeated string names = 1; // List of vectors to include into result
226277
}
@@ -737,7 +788,7 @@ message ScoredPoint {
737788
float score = 3; // Similarity score
738789
reserved 4; // deprecated "vector" field
739790
uint64 version = 5; // Last update operation applied to this point
740-
optional Vectors vectors = 6; // Vectors to search
791+
optional VectorsOutput vectors = 6; // Vectors to search
741792
optional ShardKey shard_key = 7; // Shard key
742793
optional OrderValue order_value = 8; // Order by value
743794
}
@@ -766,21 +817,25 @@ message GroupsResult {
766817
message SearchResponse {
767818
repeated ScoredPoint result = 1;
768819
double time = 2; // Time spent to process
820+
optional HardwareUsage usage = 3;
769821
}
770822

771823
message QueryResponse {
772824
repeated ScoredPoint result = 1;
773825
double time = 2; // Time spent to process
826+
optional HardwareUsage usage = 3;
774827
}
775828

776829
message QueryBatchResponse {
777830
repeated BatchResult result = 1;
778831
double time = 2; // Time spent to process
832+
optional HardwareUsage usage = 3;
779833
}
780834

781835
message QueryGroupsResponse {
782836
GroupsResult result = 1;
783837
double time = 2; // Time spent to process
838+
optional HardwareUsage usage = 3;
784839
}
785840

786841
message BatchResult {
@@ -790,16 +845,19 @@ message BatchResult {
790845
message SearchBatchResponse {
791846
repeated BatchResult result = 1;
792847
double time = 2; // Time spent to process
848+
optional HardwareUsage usage = 3;
793849
}
794850

795851
message SearchGroupsResponse {
796852
GroupsResult result = 1;
797853
double time = 2; // Time spent to process
854+
optional HardwareUsage usage = 3;
798855
}
799856

800857
message CountResponse {
801858
CountResult result = 1;
802859
double time = 2; // Time spent to process
860+
optional HardwareUsage usage = 3;
803861
}
804862

805863
message ScrollResponse {
@@ -816,7 +874,7 @@ message RetrievedPoint {
816874
PointId id = 1;
817875
map<string, Value> payload = 2;
818876
reserved 3; // deprecated "vector" field
819-
optional Vectors vectors = 4;
877+
optional VectorsOutput vectors = 4;
820878
optional ShardKey shard_key = 5; // Shard key
821879
optional OrderValue order_value = 6; // Order-by value
822880
}
@@ -829,26 +887,31 @@ message GetResponse {
829887
message RecommendResponse {
830888
repeated ScoredPoint result = 1;
831889
double time = 2; // Time spent to process
890+
optional HardwareUsage usage = 3;
832891
}
833892

834893
message RecommendBatchResponse {
835894
repeated BatchResult result = 1;
836895
double time = 2; // Time spent to process
896+
optional HardwareUsage usage = 3;
837897
}
838898

839899
message DiscoverResponse {
840900
repeated ScoredPoint result = 1;
841901
double time = 2; // Time spent to process
902+
optional HardwareUsage usage = 3;
842903
}
843904

844905
message DiscoverBatchResponse {
845906
repeated BatchResult result = 1;
846907
double time = 2; // Time spent to process
908+
optional HardwareUsage usage = 3;
847909
}
848910

849911
message RecommendGroupsResponse {
850912
GroupsResult result = 1;
851913
double time = 2; // Time spent to process
914+
optional HardwareUsage usage = 3;
852915
}
853916

854917
message UpdateBatchResponse {
@@ -864,11 +927,13 @@ message FacetResponse {
864927
message SearchMatrixPairsResponse {
865928
SearchMatrixPairs result = 1;
866929
double time = 2; // Time spent to process
930+
optional HardwareUsage usage = 3;
867931
}
868932

869933
message SearchMatrixOffsetsResponse {
870934
SearchMatrixOffsets result = 1;
871935
double time = 2; // Time spent to process
936+
optional HardwareUsage usage = 3;
872937
}
873938

874939
// ---------------------------------------------
@@ -895,6 +960,7 @@ message Condition {
895960
Filter filter = 4;
896961
IsNullCondition is_null = 5;
897962
NestedCondition nested = 6;
963+
HasVectorCondition has_vector = 7;
898964
}
899965
}
900966

@@ -910,6 +976,10 @@ message HasIdCondition {
910976
repeated PointId has_id = 1;
911977
}
912978

979+
message HasVectorCondition {
980+
string has_vector = 1;
981+
}
982+
913983
message NestedCondition {
914984
string key = 1; // Path to nested object
915985
Filter filter = 2; // Filter condition
@@ -1021,3 +1091,13 @@ message GeoPoint {
10211091
double lon = 1;
10221092
double lat = 2;
10231093
}
1094+
1095+
// ---------------------------------------------
1096+
// ------------ Hardware measurements ----------
1097+
// ---------------------------------------------
1098+
1099+
message HardwareUsage {
1100+
uint64 cpu = 1;
1101+
uint64 io_read = 2;
1102+
uint64 io_write = 3;
1103+
}

0 commit comments

Comments
 (0)