vectordb-bench 0.0.1__1-py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. vectordb_bench/__init__.py +30 -0
  2. vectordb_bench/__main__.py +39 -0
  3. vectordb_bench/backend/__init__.py +0 -0
  4. vectordb_bench/backend/assembler.py +57 -0
  5. vectordb_bench/backend/cases.py +124 -0
  6. vectordb_bench/backend/clients/__init__.py +57 -0
  7. vectordb_bench/backend/clients/api.py +179 -0
  8. vectordb_bench/backend/clients/elastic_cloud/config.py +56 -0
  9. vectordb_bench/backend/clients/elastic_cloud/elastic_cloud.py +152 -0
  10. vectordb_bench/backend/clients/milvus/config.py +123 -0
  11. vectordb_bench/backend/clients/milvus/milvus.py +182 -0
  12. vectordb_bench/backend/clients/pinecone/config.py +15 -0
  13. vectordb_bench/backend/clients/pinecone/pinecone.py +113 -0
  14. vectordb_bench/backend/clients/qdrant_cloud/config.py +16 -0
  15. vectordb_bench/backend/clients/qdrant_cloud/qdrant_cloud.py +169 -0
  16. vectordb_bench/backend/clients/weaviate_cloud/config.py +45 -0
  17. vectordb_bench/backend/clients/weaviate_cloud/weaviate_cloud.py +151 -0
  18. vectordb_bench/backend/clients/zilliz_cloud/config.py +34 -0
  19. vectordb_bench/backend/clients/zilliz_cloud/zilliz_cloud.py +35 -0
  20. vectordb_bench/backend/dataset.py +393 -0
  21. vectordb_bench/backend/result_collector.py +15 -0
  22. vectordb_bench/backend/runner/__init__.py +12 -0
  23. vectordb_bench/backend/runner/mp_runner.py +124 -0
  24. vectordb_bench/backend/runner/serial_runner.py +164 -0
  25. vectordb_bench/backend/task_runner.py +290 -0
  26. vectordb_bench/backend/utils.py +85 -0
  27. vectordb_bench/base.py +6 -0
  28. vectordb_bench/frontend/components/check_results/charts.py +175 -0
  29. vectordb_bench/frontend/components/check_results/data.py +86 -0
  30. vectordb_bench/frontend/components/check_results/filters.py +97 -0
  31. vectordb_bench/frontend/components/check_results/headerIcon.py +18 -0
  32. vectordb_bench/frontend/components/check_results/nav.py +21 -0
  33. vectordb_bench/frontend/components/check_results/priceTable.py +48 -0
  34. vectordb_bench/frontend/components/run_test/autoRefresh.py +10 -0
  35. vectordb_bench/frontend/components/run_test/caseSelector.py +87 -0
  36. vectordb_bench/frontend/components/run_test/dbConfigSetting.py +47 -0
  37. vectordb_bench/frontend/components/run_test/dbSelector.py +36 -0
  38. vectordb_bench/frontend/components/run_test/generateTasks.py +21 -0
  39. vectordb_bench/frontend/components/run_test/hideSidebar.py +10 -0
  40. vectordb_bench/frontend/components/run_test/submitTask.py +69 -0
  41. vectordb_bench/frontend/const.py +391 -0
  42. vectordb_bench/frontend/pages/qps_with_price.py +60 -0
  43. vectordb_bench/frontend/pages/run_test.py +59 -0
  44. vectordb_bench/frontend/utils.py +6 -0
  45. vectordb_bench/frontend/vdb_benchmark.py +42 -0
  46. vectordb_bench/interface.py +239 -0
  47. vectordb_bench/log_util.py +103 -0
  48. vectordb_bench/metric.py +53 -0
  49. vectordb_bench/models.py +234 -0
  50. vectordb_bench/results/result_20230609_standard.json +3228 -0
  51. vectordb_bench-0.0.1.dist-info/LICENSE +21 -0
  52. vectordb_bench-0.0.1.dist-info/METADATA +226 -0
  53. vectordb_bench-0.0.1.dist-info/RECORD +56 -0
  54. vectordb_bench-0.0.1.dist-info/WHEEL +5 -0
  55. vectordb_bench-0.0.1.dist-info/entry_points.txt +2 -0
  56. vectordb_bench-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,69 @@
1
+ from datetime import datetime
2
+ from vectordb_bench.frontend.const import *
3
+ from vectordb_bench.interface import benchMarkRunner
4
+
5
+
6
+ def submitTask(st, tasks):
7
+ st.markdown(
8
+ "<div style='height: 24px;'></div>",
9
+ unsafe_allow_html=True,
10
+ )
11
+ st.subheader("STEP 3: Task Label")
12
+ st.markdown(
13
+ "<div style='color: #647489; margin-bottom: 20px; margin-top: -12px;'>This description is used to mark the result. </div>",
14
+ unsafe_allow_html=True,
15
+ )
16
+
17
+ taskLabel = taskLabelInput(st)
18
+
19
+ st.markdown(
20
+ "<div style='height: 24px;'></div>",
21
+ unsafe_allow_html=True,
22
+ )
23
+
24
+ controlPanelContainer = st.container()
25
+ controlPanel(controlPanelContainer, tasks, taskLabel)
26
+
27
+
28
+ def taskLabelInput(st):
29
+ defaultTaskLabel = datetime.now().strftime("%Y%m%d%H")
30
+ columns = st.columns(TASK_LABEL_INPUT_COLUMNS)
31
+ taskLabel = columns[0].text_input("task_label", defaultTaskLabel, label_visibility="collapsed")
32
+ return taskLabel
33
+
34
+
35
+ def controlPanel(st, tasks, taskLabel):
36
+ isRunning = benchMarkRunner.has_running()
37
+ runHandler = lambda: benchMarkRunner.run(tasks, taskLabel)
38
+ stopHandler = lambda: benchMarkRunner.stop_running()
39
+
40
+ if isRunning:
41
+ currentTaskId = benchMarkRunner.get_current_task_id()
42
+ tasksCount = benchMarkRunner.get_tasks_count()
43
+ text = f":running: Running Task {currentTaskId} / {tasksCount}"
44
+ st.progress(currentTaskId / tasksCount, text=text)
45
+
46
+ columns = st.columns(6)
47
+ columns[0].button(
48
+ "Run Your Test",
49
+ disabled=True,
50
+ on_click=runHandler,
51
+ type="primary",
52
+ )
53
+ columns[1].button(
54
+ "Stop",
55
+ on_click=stopHandler,
56
+ type="primary",
57
+ )
58
+
59
+ else:
60
+ errorText = benchMarkRunner.latest_error or ""
61
+ if len(errorText) > 0:
62
+ st.error(errorText)
63
+ disabled = True if len(tasks) == 0 else False
64
+ st.button(
65
+ "Run Your Test",
66
+ disabled=disabled,
67
+ on_click=runHandler,
68
+ type="primary",
69
+ )
@@ -0,0 +1,391 @@
1
+ from enum import IntEnum
2
+ from vectordb_bench.models import DB, CaseType, IndexType, CaseConfigParamType
3
+ from pydantic import BaseModel
4
+ import typing
5
+
6
+ # style const
7
+ DB_SELECTOR_COLUMNS = 6
8
+ DB_CONFIG_SETTING_COLUMNS = 3
9
+ CASE_CONFIG_SETTING_COLUMNS = 4
10
+ CHECKBOX_INDENT = 30
11
+ TASK_LABEL_INPUT_COLUMNS = 2
12
+ CHECKBOX_MAX_COLUMNS = 4
13
+ DB_CONFIG_INPUT_MAX_COLUMNS = 2
14
+ CASE_CONFIG_INPUT_MAX_COLUMNS = 3
15
+ DB_CONFIG_INPUT_WIDTH_RADIO = 2
16
+ CASE_CONFIG_INPUT_WIDTH_RADIO = 0.98
17
+ CASE_INTRO_RATIO = 3
18
+ MAX_STREAMLIT_INT = (1 << 53) - 1
19
+
20
+ LEGEND_RECT_WIDTH = 24
21
+ LEGEND_RECT_HEIGHT = 16
22
+ LEGEND_TEXT_FONT_SIZE = 14
23
+
24
+ PATTERN_SHAPES = ["", "+", "\\", "x", ".", "|", "/", "-"]
25
+
26
+
27
+ def getPatternShape(i):
28
+ return PATTERN_SHAPES[i % len(PATTERN_SHAPES)]
29
+
30
+
31
+ MAX_AUTO_REFRESH_COUNT = 999999
32
+ MAX_AUTO_REFRESH_INTERVAL = 5000 # 2s
33
+
34
+
35
+ DB_LIST = [d for d in DB]
36
+
37
+ DB_TO_ICON = {
38
+ DB.Milvus: "https://assets.zilliz.com/milvus_c30b0d1994.png",
39
+ DB.ZillizCloud: "https://assets.zilliz.com/zilliz_5f4cc9b050.png",
40
+ DB.ElasticCloud: "https://assets.zilliz.com/elasticsearch_beffeadc29.png",
41
+ DB.Pinecone: "https://assets.zilliz.com/pinecone_94d8154979.png",
42
+ DB.QdrantCloud: "https://assets.zilliz.com/qdrant_b691674fcd.png",
43
+ DB.WeaviateCloud: "https://assets.zilliz.com/weaviate_4f6f171ebe.png",
44
+ }
45
+
46
+ COLOR_MAP = {
47
+ DB.Milvus.value: "#0DCAF0",
48
+ DB.ZillizCloud.value: "#0D6EFD",
49
+ DB.ElasticCloud.value: "#fdc613",
50
+ DB.Pinecone.value: "#6610F2",
51
+ DB.QdrantCloud.value: "#D91AD9",
52
+ DB.WeaviateCloud.value: "#20C997",
53
+ }
54
+
55
+ CASE_LIST = [
56
+ {
57
+ "name": CaseType.CapacitySDim,
58
+ "intro": """This case tests the vector database's loading capacity by repeatedly inserting small-dimension vectors (SIFT 100K vectors, <b>128 dimensions</b>) until it is fully loaded.
59
+ Number of inserted vectors will be reported.""",
60
+ },
61
+ {
62
+ "name": CaseType.CapacityLDim,
63
+ "divider": True,
64
+ "intro": """This case tests the vector database's loading capacity by repeatedly inserting large-dimension vectors (GIST 100K vectors, <b>960 dimensions</b>) until it is fully loaded.
65
+ Number of inserted vectors will be reported.
66
+ """,
67
+ },
68
+ {
69
+ "name": CaseType.PerformanceSZero,
70
+ "intro": """This case tests the search performance of a vector database with a small dataset (<b>Cohere 100K vectors</b>, 768 dimensions) at varying parallel levels.
71
+ Results will show index building time, recall, and maximum QPS.""",
72
+ },
73
+ {
74
+ "name": CaseType.PerformanceMZero,
75
+ "intro": """This case tests the search performance of a vector database with a medium dataset (<b>Cohere 1M vectors</b>, 768 dimensions) at varying parallel levels.
76
+ Results will show index building time, recall, and maximum QPS.""",
77
+ },
78
+ {
79
+ "name": CaseType.PerformanceLZero,
80
+ "intro": """This case tests the search performance of a vector database with a large dataset (<b>Cohere 10M vectors</b>, 768 dimensions) at varying parallel levels.
81
+ Results will show index building time, recall, and maximum QPS.""",
82
+ },
83
+ {
84
+ "name": CaseType.Performance100M,
85
+ "divider": True,
86
+ "intro": """This case tests the search performance of a vector database with a large 100M dataset (<b>LAION 100M vectors</b>, 768 dimensions), at varying parallel levels.
87
+ Results will show index building time, recall, and maximum QPS.""",
88
+ },
89
+ {
90
+ "name": CaseType.PerformanceSLow,
91
+ "intro": """This case tests the search performance of a vector database with a small dataset (<b>Cohere 100K vectors</b>, 768 dimensions) under a low filtering rate (<b>1% vectors</b>), at varying parallel levels.
92
+ Results will show index building time, recall, and maximum QPS.""",
93
+ },
94
+ {
95
+ "name": CaseType.PerformanceMLow,
96
+ "intro": """This case tests the search performance of a vector database with a medium dataset (<b>Cohere 1M vectors</b>, 768 dimensions) under a low filtering rate (<b>1% vectors</b>), at varying parallel levels.
97
+ Results will show index building time, recall, and maximum QPS.""",
98
+ },
99
+ {
100
+ "name": CaseType.PerformanceLLow,
101
+ "intro": """This case tests the search performance of a vector database with a large dataset (<b>Cohere 10M vectors</b>, 768 dimensions) under a low filtering rate (<b>1% vectors</b>), at varying parallel levels.
102
+ Results will show index building time, recall, and maximum QPS.""",
103
+ },
104
+ {
105
+ "name": CaseType.PerformanceSHigh,
106
+ "intro": """This case tests the search performance of a vector database with a small dataset (<b>Cohere 100K vectors</b>, 768 dimensions) under a high filtering rate (<b>99% vectors</b>), at varying parallel levels.
107
+ Results will show index building time, recall, and maximum QPS.""",
108
+ },
109
+ {
110
+ "name": CaseType.PerformanceMHigh,
111
+ "intro": """This case tests the search performance of a vector database with a medium dataset (<b>Cohere 1M vectors</b>, 768 dimensions) under a high filtering rate (<b>99% vectors</b>), at varying parallel levels.
112
+ Results will show index building time, recall, and maximum QPS.""",
113
+ },
114
+ {
115
+ "name": CaseType.PerformanceLHigh,
116
+ "intro": """This case tests the search performance of a vector database with a large dataset (<b>Cohere 10M vectors</b>, 768 dimensions) under a high filtering rate (<b>99% vectors</b>), at varying parallel levels.
117
+ Results will show index building time, recall, and maximum QPS.""",
118
+ },
119
+ ]
120
+
121
+
122
+ class InputType(IntEnum):
123
+ Text = 20001
124
+ Number = 20002
125
+ Option = 20003
126
+
127
+
128
+ class CaseConfigInput(BaseModel):
129
+ label: CaseConfigParamType
130
+ inputType: InputType = InputType.Text
131
+ inputConfig: dict = {}
132
+ # todo type should be a function
133
+ isDisplayed: typing.Any = lambda x: True
134
+
135
+
136
+ CaseConfigParamInput_IndexType = CaseConfigInput(
137
+ label=CaseConfigParamType.IndexType,
138
+ inputType=InputType.Option,
139
+ inputConfig={
140
+ "options": [
141
+ IndexType.HNSW.value,
142
+ IndexType.IVFFlat.value,
143
+ IndexType.DISKANN.value,
144
+ IndexType.Flat.value,
145
+ IndexType.AUTOINDEX.value,
146
+ ],
147
+ },
148
+ )
149
+
150
+ CaseConfigParamInput_M = CaseConfigInput(
151
+ label=CaseConfigParamType.M,
152
+ inputType=InputType.Number,
153
+ inputConfig={
154
+ "min": 4,
155
+ "max": 64,
156
+ "value": 30,
157
+ },
158
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
159
+ == IndexType.HNSW.value,
160
+ )
161
+
162
+ CaseConfigParamInput_EFConstruction_Milvus = CaseConfigInput(
163
+ label=CaseConfigParamType.EFConstruction,
164
+ inputType=InputType.Number,
165
+ inputConfig={
166
+ "min": 8,
167
+ "max": 512,
168
+ "value": 360,
169
+ },
170
+ isDisplayed=lambda config: config[CaseConfigParamType.IndexType]
171
+ == IndexType.HNSW.value,
172
+ )
173
+
174
+ CaseConfigParamInput_EFConstruction_Weaviate = CaseConfigInput(
175
+ label=CaseConfigParamType.EFConstruction,
176
+ inputType=InputType.Number,
177
+ inputConfig={
178
+ "min": 8,
179
+ "max": 512,
180
+ "value": 128,
181
+ },
182
+ )
183
+
184
+ CaseConfigParamInput_EFConstruction_ES = CaseConfigInput(
185
+ label=CaseConfigParamType.EFConstruction,
186
+ inputType=InputType.Number,
187
+ inputConfig={
188
+ "min": 8,
189
+ "max": 512,
190
+ "value": 360,
191
+ },
192
+ )
193
+
194
+ CaseConfigParamInput_M_ES = CaseConfigInput(
195
+ label=CaseConfigParamType.M,
196
+ inputType=InputType.Number,
197
+ inputConfig={
198
+ "min": 4,
199
+ "max": 64,
200
+ "value": 30,
201
+ },
202
+ )
203
+
204
+ CaseConfigParamInput_NumCandidates_ES = CaseConfigInput(
205
+ label=CaseConfigParamType.numCandidates,
206
+ inputType=InputType.Number,
207
+ inputConfig={
208
+ "min": 1,
209
+ "max": 10000,
210
+ "value": 100,
211
+ },
212
+ )
213
+
214
+ CaseConfigParamInput_EF_Milvus = CaseConfigInput(
215
+ label=CaseConfigParamType.EF,
216
+ inputType=InputType.Number,
217
+ inputConfig={
218
+ "min": 100,
219
+ "max": MAX_STREAMLIT_INT,
220
+ "value": 100,
221
+ },
222
+ isDisplayed=lambda config: config[CaseConfigParamType.IndexType]
223
+ == IndexType.HNSW.value,
224
+ )
225
+
226
+ CaseConfigParamInput_EF_Weaviate = CaseConfigInput(
227
+ label=CaseConfigParamType.EF,
228
+ inputType=InputType.Number,
229
+ inputConfig={
230
+ "min": -1,
231
+ "max": MAX_STREAMLIT_INT,
232
+ "value": -1,
233
+ },
234
+ )
235
+
236
+ CaseConfigParamInput_MaxConnections = CaseConfigInput(
237
+ label=CaseConfigParamType.MaxConnections,
238
+ inputType=InputType.Number,
239
+ inputConfig={"min": 1, "max": MAX_STREAMLIT_INT, "value": 64},
240
+ )
241
+
242
+ CaseConfigParamInput_SearchList = CaseConfigInput(
243
+ label=CaseConfigParamType.SearchList,
244
+ inputType=InputType.Number,
245
+ inputConfig={
246
+ "min": 100,
247
+ "max": MAX_STREAMLIT_INT,
248
+ "value": 100,
249
+ },
250
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
251
+ == IndexType.DISKANN.value,
252
+ )
253
+
254
+ CaseConfigParamInput_Nlist = CaseConfigInput(
255
+ label=CaseConfigParamType.Nlist,
256
+ inputType=InputType.Number,
257
+ inputConfig={
258
+ "min": 1,
259
+ "max": 65536,
260
+ "value": 1000,
261
+ },
262
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
263
+ == IndexType.IVFFlat.value,
264
+ )
265
+
266
+ CaseConfigParamInput_Nprobe = CaseConfigInput(
267
+ label=CaseConfigParamType.Nprobe,
268
+ inputType=InputType.Number,
269
+ inputConfig={
270
+ "min": 1,
271
+ "max": 65536,
272
+ "value": 10,
273
+ },
274
+ isDisplayed=lambda config: config.get(CaseConfigParamType.IndexType, None)
275
+ == IndexType.IVFFlat.value,
276
+ )
277
+
278
+
279
+ MilvusLoadConfig = [
280
+ CaseConfigParamInput_IndexType,
281
+ CaseConfigParamInput_M,
282
+ CaseConfigParamInput_EFConstruction_Milvus,
283
+ CaseConfigParamInput_Nlist,
284
+ ]
285
+
286
+
287
+ MilvusPerformanceConfig = [
288
+ CaseConfigParamInput_IndexType,
289
+ CaseConfigParamInput_M,
290
+ CaseConfigParamInput_EFConstruction_Milvus,
291
+ CaseConfigParamInput_EF_Milvus,
292
+ CaseConfigParamInput_SearchList,
293
+ CaseConfigParamInput_Nlist,
294
+ CaseConfigParamInput_Nprobe,
295
+ ]
296
+
297
+ WeaviateLoadConfig = [
298
+ CaseConfigParamInput_MaxConnections,
299
+ CaseConfigParamInput_EFConstruction_Weaviate,
300
+ ]
301
+
302
+ WeaviatePerformanceConfig = [
303
+ CaseConfigParamInput_MaxConnections,
304
+ CaseConfigParamInput_EFConstruction_Weaviate,
305
+ CaseConfigParamInput_EF_Weaviate,
306
+ ]
307
+
308
+ ESLoadingConfig = [CaseConfigParamInput_EFConstruction_ES, CaseConfigParamInput_M_ES]
309
+
310
+ ESPerformanceConfig = [
311
+ CaseConfigParamInput_EFConstruction_ES,
312
+ CaseConfigParamInput_M_ES,
313
+ CaseConfigParamInput_NumCandidates_ES,
314
+ ]
315
+
316
+ CASE_CONFIG_MAP = {
317
+ DB.Milvus: {
318
+ CaseType.CapacityLDim: MilvusLoadConfig,
319
+ CaseType.CapacitySDim: MilvusLoadConfig,
320
+ CaseType.PerformanceLZero: MilvusPerformanceConfig,
321
+ CaseType.PerformanceMZero: MilvusPerformanceConfig,
322
+ CaseType.PerformanceSZero: MilvusPerformanceConfig,
323
+ CaseType.PerformanceLLow: MilvusPerformanceConfig,
324
+ CaseType.PerformanceMLow: MilvusPerformanceConfig,
325
+ CaseType.PerformanceSLow: MilvusPerformanceConfig,
326
+ CaseType.PerformanceLHigh: MilvusPerformanceConfig,
327
+ CaseType.PerformanceMHigh: MilvusPerformanceConfig,
328
+ CaseType.PerformanceSHigh: MilvusPerformanceConfig,
329
+ CaseType.Performance100M: MilvusPerformanceConfig,
330
+ },
331
+ DB.WeaviateCloud: {
332
+ CaseType.CapacityLDim: WeaviateLoadConfig,
333
+ CaseType.CapacitySDim: WeaviateLoadConfig,
334
+ CaseType.PerformanceLZero: WeaviatePerformanceConfig,
335
+ CaseType.PerformanceMZero: WeaviatePerformanceConfig,
336
+ CaseType.PerformanceSZero: WeaviatePerformanceConfig,
337
+ CaseType.PerformanceLLow: WeaviatePerformanceConfig,
338
+ CaseType.PerformanceMLow: WeaviatePerformanceConfig,
339
+ CaseType.PerformanceSLow: WeaviatePerformanceConfig,
340
+ CaseType.PerformanceLHigh: WeaviatePerformanceConfig,
341
+ CaseType.PerformanceMHigh: WeaviatePerformanceConfig,
342
+ CaseType.PerformanceSHigh: WeaviatePerformanceConfig,
343
+ CaseType.Performance100M: WeaviatePerformanceConfig,
344
+ },
345
+ DB.ElasticCloud: {
346
+ CaseType.CapacityLDim: ESLoadingConfig,
347
+ CaseType.CapacitySDim: ESLoadingConfig,
348
+ CaseType.PerformanceLZero: ESPerformanceConfig,
349
+ CaseType.PerformanceMZero: ESPerformanceConfig,
350
+ CaseType.PerformanceSZero: ESPerformanceConfig,
351
+ CaseType.PerformanceLLow: ESPerformanceConfig,
352
+ CaseType.PerformanceMLow: ESPerformanceConfig,
353
+ CaseType.PerformanceSLow: ESPerformanceConfig,
354
+ CaseType.PerformanceLHigh: ESPerformanceConfig,
355
+ CaseType.PerformanceMHigh: ESPerformanceConfig,
356
+ CaseType.PerformanceSHigh: ESPerformanceConfig,
357
+ CaseType.Performance100M: ESPerformanceConfig,
358
+ },
359
+ }
360
+
361
+ DB_DBLABEL_TO_PRICE = {
362
+ DB.Milvus.value: {},
363
+ DB.ZillizCloud.value: {
364
+ "1cu-perf": 0.159,
365
+ "8cu-perf": 1.272,
366
+ "1cu-cap": 0.159,
367
+ "2cu-cap": 0.318,
368
+ },
369
+ DB.WeaviateCloud.value: {
370
+ # "sandox": 0, # emmmm
371
+ "standard": 10.10,
372
+ "bus_crit": 32.60,
373
+ },
374
+ DB.ElasticCloud.value: {
375
+ "free-5c8g": 0.260,
376
+ "upTo2.5c8g": 0.4793,
377
+ },
378
+ DB.QdrantCloud.value: {
379
+ "0.5c4g-1node": 0.052,
380
+ "2c8g-1node": 0.166,
381
+ "4c16g-5node": 1.426,
382
+ },
383
+ DB.Pinecone.value: {
384
+ "s1.x1": 0.0973,
385
+ "s1.x2": 0.194,
386
+ "p1.x1": 0.0973,
387
+ "p1.x5-2pod": 0.973,
388
+ "p2.x1": 0.146,
389
+ "p2.x5-2pod": 1.46,
390
+ },
391
+ }
@@ -0,0 +1,60 @@
1
+ import streamlit as st
2
+ from vectordb_bench.frontend.components.check_results.priceTable import priceTable
3
+ from vectordb_bench.frontend.const import *
4
+ from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
5
+ from vectordb_bench.frontend.components.check_results.nav import NavToResults, NavToRunTest
6
+ from vectordb_bench.frontend.components.check_results.charts import drawMetricChart
7
+ from vectordb_bench.frontend.components.check_results.filters import getshownData
8
+ from vectordb_bench.interface import benchMarkRunner
9
+
10
+
11
+ def main():
12
+ st.set_page_config(
13
+ page_title="VectorDB Benchmark",
14
+ page_icon="https://assets.zilliz.com/favicon_f7f922fe27.png",
15
+ # layout="wide",
16
+ # initial_sidebar_state="collapsed",
17
+ )
18
+
19
+ # header
20
+ drawHeaderIcon(st)
21
+
22
+ allResults = benchMarkRunner.get_results()
23
+
24
+ st.title("Vector DB Benchmark (QPS / Price)")
25
+ st.subheader("Price List")
26
+
27
+ # results selector
28
+ resultSelectorContainer = st.sidebar.container()
29
+ shownData, failedTasks, showCases = getshownData(allResults, resultSelectorContainer)
30
+
31
+ resultSelectorContainer.divider()
32
+
33
+ # nav
34
+ navContainer = st.sidebar.container()
35
+ NavToRunTest(navContainer)
36
+ NavToResults(navContainer)
37
+
38
+ # price table
39
+ priceTableContainer = st.container()
40
+ priceMap = priceTable(priceTableContainer, shownData)
41
+
42
+ # charts
43
+ for case in showCases:
44
+ chartContainer = st.container()
45
+ data = [data for data in shownData if data["case"] == case]
46
+ dataWithMetric = []
47
+ metric = "qps_per_dollar (qps / price)"
48
+ for d in data:
49
+ qps = d.get("qps", 0)
50
+ price = priceMap.get(d["db"], {}).get(d["db_label"], 0)
51
+ if qps > 0 and price > 0:
52
+ d[metric] = d["qps"] / price
53
+ dataWithMetric.append(d)
54
+ if len(dataWithMetric) > 0:
55
+ chartContainer.subheader(case)
56
+ drawMetricChart(data, metric, chartContainer)
57
+
58
+
59
+ if __name__ == "__main__":
60
+ main()
@@ -0,0 +1,59 @@
1
+ import streamlit as st
2
+ from vectordb_bench.frontend.components.run_test.autoRefresh import autoRefresh
3
+ from vectordb_bench.frontend.components.run_test.caseSelector import caseSelector
4
+ from vectordb_bench.frontend.components.run_test.dbConfigSetting import dbConfigSettings
5
+ from vectordb_bench.frontend.components.run_test.dbSelector import dbSelector
6
+ from vectordb_bench.frontend.components.run_test.generateTasks import generate_tasks
7
+ from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
8
+ from vectordb_bench.frontend.components.run_test.hideSidebar import hideSidebar
9
+ from vectordb_bench.frontend.components.check_results.nav import NavToResults
10
+ from vectordb_bench.frontend.components.run_test.submitTask import submitTask
11
+
12
+
13
+ def main():
14
+ st.set_page_config(
15
+ page_title="VectorDB Benchmark",
16
+ page_icon="https://assets.zilliz.com/favicon_f7f922fe27.png",
17
+ # layout="wide",
18
+ initial_sidebar_state="collapsed",
19
+ )
20
+ # header
21
+ drawHeaderIcon(st)
22
+
23
+ # hide sidebar
24
+ hideSidebar(st)
25
+
26
+ # nav to results
27
+ NavToResults(st)
28
+
29
+ # header
30
+ st.title("Run Your Test")
31
+ # st.write("description [todo]")
32
+
33
+ # select db
34
+ dbSelectorContainer = st.container()
35
+ activedDbList = dbSelector(dbSelectorContainer)
36
+
37
+ # db config setting
38
+ dbConfigs = {}
39
+ if len(activedDbList) > 0:
40
+ dbConfigContainer = st.container()
41
+ dbConfigs = dbConfigSettings(dbConfigContainer, activedDbList)
42
+
43
+ # select case and set db_case_config
44
+ caseSelectorContainer = st.container()
45
+ activedCaseList, allCaseConfigs = caseSelector(caseSelectorContainer, activedDbList)
46
+
47
+ # generate tasks
48
+ tasks = generate_tasks(activedDbList, dbConfigs, activedCaseList, allCaseConfigs)
49
+
50
+ # submit
51
+ submitContainer = st.container()
52
+ submitTask(submitContainer, tasks)
53
+
54
+ # autofresh
55
+ autoRefresh()
56
+
57
+
58
+ if __name__ == "__main__":
59
+ main()
@@ -0,0 +1,6 @@
1
+ from vectordb_bench.models import CaseType
2
+
3
+ passwordKeys = ["password", "api_key"]
4
+ def inputIsPassword(key: str) -> bool:
5
+ return key.lower() in passwordKeys
6
+
@@ -0,0 +1,42 @@
1
+ import streamlit as st
2
+ from vectordb_bench.frontend.const import *
3
+ from vectordb_bench.frontend.components.check_results.headerIcon import drawHeaderIcon
4
+ from vectordb_bench.frontend.components.check_results.nav import NavToQPSWithPrice, NavToRunTest
5
+ from vectordb_bench.frontend.components.check_results.charts import drawCharts
6
+ from vectordb_bench.frontend.components.check_results.filters import getshownData
7
+ from vectordb_bench.interface import benchMarkRunner
8
+
9
+
10
+ def main():
11
+ st.set_page_config(
12
+ page_title="VectorDB Benchmark",
13
+ page_icon="https://assets.zilliz.com/favicon_f7f922fe27.png",
14
+ # layout="wide",
15
+ # initial_sidebar_state="collapsed",
16
+ )
17
+
18
+ # header
19
+ drawHeaderIcon(st)
20
+
21
+ allResults = benchMarkRunner.get_results()
22
+
23
+ st.title("Vector Database Benchmark")
24
+ # st.write("description [todo]")
25
+
26
+ # results selector
27
+ resultSelectorContainer = st.sidebar.container()
28
+ shownData, failedTasks, showCases = getshownData(allResults, resultSelectorContainer)
29
+
30
+ resultSelectorContainer.divider()
31
+
32
+ # nav
33
+ navContainer = st.sidebar.container()
34
+ NavToRunTest(navContainer)
35
+ NavToQPSWithPrice(navContainer)
36
+
37
+ # charts
38
+ drawCharts(st, shownData, failedTasks, showCases)
39
+
40
+
41
+ if __name__ == "__main__":
42
+ main()