isage-rag-benchmark 0.1.0.1__cp311-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 (48) hide show
  1. isage_rag_benchmark-0.1.0.1.dist-info/METADATA +63 -0
  2. isage_rag_benchmark-0.1.0.1.dist-info/RECORD +48 -0
  3. isage_rag_benchmark-0.1.0.1.dist-info/WHEEL +5 -0
  4. isage_rag_benchmark-0.1.0.1.dist-info/licenses/LICENSE +21 -0
  5. isage_rag_benchmark-0.1.0.1.dist-info/top_level.txt +1 -0
  6. sage/__init__.py +0 -0
  7. sage/benchmark_rag/__init__.py +16 -0
  8. sage/benchmark_rag/_version.py +4 -0
  9. sage/benchmark_rag/config/config_bm25s.yaml +51 -0
  10. sage/benchmark_rag/config/config_dense_milvus.yaml +61 -0
  11. sage/benchmark_rag/config/config_hf.yaml +43 -0
  12. sage/benchmark_rag/config/config_mixed.yaml +53 -0
  13. sage/benchmark_rag/config/config_monitoring_demo.yaml +59 -0
  14. sage/benchmark_rag/config/config_multiplex.yaml +79 -0
  15. sage/benchmark_rag/config/config_qa_chroma.yaml +51 -0
  16. sage/benchmark_rag/config/config_ray.yaml +57 -0
  17. sage/benchmark_rag/config/config_refiner.yaml +75 -0
  18. sage/benchmark_rag/config/config_rerank.yaml +56 -0
  19. sage/benchmark_rag/config/config_selfrag.yaml +24 -0
  20. sage/benchmark_rag/config/config_source.yaml +30 -0
  21. sage/benchmark_rag/config/config_source_local.yaml +21 -0
  22. sage/benchmark_rag/config/config_sparse_milvus.yaml +49 -0
  23. sage/benchmark_rag/evaluation/__init__.py +10 -0
  24. sage/benchmark_rag/evaluation/benchmark_runner.py +337 -0
  25. sage/benchmark_rag/evaluation/config/benchmark_config.yaml +35 -0
  26. sage/benchmark_rag/evaluation/evaluate_results.py +389 -0
  27. sage/benchmark_rag/implementations/__init__.py +31 -0
  28. sage/benchmark_rag/implementations/pipelines/__init__.py +24 -0
  29. sage/benchmark_rag/implementations/pipelines/qa_bm25_retrieval.py +55 -0
  30. sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval.py +56 -0
  31. sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_chroma.py +71 -0
  32. sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_milvus.py +78 -0
  33. sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_mixed.py +58 -0
  34. sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_ray.py +174 -0
  35. sage/benchmark_rag/implementations/pipelines/qa_hf_model.py +57 -0
  36. sage/benchmark_rag/implementations/pipelines/qa_monitoring_demo.py +139 -0
  37. sage/benchmark_rag/implementations/pipelines/qa_multimodal_fusion.py +318 -0
  38. sage/benchmark_rag/implementations/pipelines/qa_multiplex.py +91 -0
  39. sage/benchmark_rag/implementations/pipelines/qa_refiner.py +91 -0
  40. sage/benchmark_rag/implementations/pipelines/qa_rerank.py +76 -0
  41. sage/benchmark_rag/implementations/pipelines/qa_sparse_retrieval_milvus.py +76 -0
  42. sage/benchmark_rag/implementations/pipelines/selfrag.py +226 -0
  43. sage/benchmark_rag/implementations/tools/__init__.py +17 -0
  44. sage/benchmark_rag/implementations/tools/build_chroma_index.py +261 -0
  45. sage/benchmark_rag/implementations/tools/build_milvus_dense_index.py +86 -0
  46. sage/benchmark_rag/implementations/tools/build_milvus_index.py +59 -0
  47. sage/benchmark_rag/implementations/tools/build_milvus_sparse_index.py +85 -0
  48. sage/benchmark_rag/implementations/tools/loaders/document_loaders.py +42 -0
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: isage-rag-benchmark
3
+ Version: 0.1.0.1
4
+ Summary: RAG benchmarking suite for the SAGE ecosystem
5
+ Author-email: IntelliStream Team <shuhao_zhang@hust.edu.cn>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/intellistream/sage-rag-benchmark
8
+ Project-URL: Documentation, https://github.com/intellistream/sage-rag-benchmark#readme
9
+ Project-URL: Repository, https://github.com/intellistream/sage-rag-benchmark
10
+ Project-URL: Issues, https://github.com/intellistream/sage-rag-benchmark/issues
11
+ Keywords: sage,benchmark,rag,retrieval-augmented-generation,evaluation,intellistream
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: isage-common
24
+ Requires-Dist: isage-kernel
25
+ Requires-Dist: isage-middleware>=0.2.4.0
26
+ Requires-Dist: isage-libs
27
+ Requires-Dist: sentence-transformers<4.0.0,>=3.1.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Requires-Dist: chromadb>=1.0.20
30
+ Requires-Dist: pymilvus[model]>=2.4.0
31
+ Requires-Dist: faiss-cpu<2.0.0,>=1.7.0
32
+ Requires-Dist: pandas>=2.0.0
33
+ Requires-Dist: numpy<2.3.0,>=1.26.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
36
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
37
+ Requires-Dist: black>=23.0.0; extra == "dev"
38
+ Requires-Dist: ruff==0.14.6; extra == "dev"
39
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
41
+ Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
42
+ Dynamic: license-file
43
+
44
+ # SAGE RAG Benchmark
45
+
46
+ RAG benchmarking suite for the SAGE ecosystem. This repository provides
47
+ pipelines, evaluation utilities, and configuration templates for evaluating
48
+ retrieval-augmented generation systems.
49
+
50
+ ## Install
51
+
52
+ ```bash
53
+ pip install isage-rag-benchmark
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ See the configs under `src/sage/benchmark_rag/config/` and the implementations
59
+ in `src/sage/benchmark_rag/implementations/`.
60
+
61
+ ## Repository
62
+
63
+ - GitHub: https://github.com/intellistream/sage-rag-benchmark
@@ -0,0 +1,48 @@
1
+ isage_rag_benchmark-0.1.0.1.dist-info/licenses/LICENSE,sha256=vBNVIGkYYZY0B8f0Ui1ITYwRu7WNtSwyxvIAVGYS6jU,1075
2
+ sage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ sage/benchmark_rag/__init__.py,sha256=7p8QRU5ShDaYMjqiFOVr_1aAlMULm6z8Mle39sX5c2Y,561
4
+ sage/benchmark_rag/_version.py,sha256=qd_nvt_nQyHmhAy0bKVhzaD5BSHwZtyFAFIfgbH2EuY,147
5
+ sage/benchmark_rag/config/config_bm25s.yaml,sha256=oSAKyk4YoU_C65c6EDo8vVZxFuFOkvsVBaedgLeW7m0,905
6
+ sage/benchmark_rag/config/config_dense_milvus.yaml,sha256=OjB6r06n1nvpeh1_vh-cGQ3fOddh10L4Xqaodsh1Org,1716
7
+ sage/benchmark_rag/config/config_hf.yaml,sha256=TGS8_05qRiElPpBy0A5rLlZvKsCbJuqo1bVtW8e8fa0,1008
8
+ sage/benchmark_rag/config/config_mixed.yaml,sha256=wbSquG4SQYxM1teuXvPx559wXtCA8imZ7BxbNnVgIbw,954
9
+ sage/benchmark_rag/config/config_monitoring_demo.yaml,sha256=iYE5Kh8UiIGeVq0jFq-1cPwQLLf-vqDbBLLZ2y4nshY,1622
10
+ sage/benchmark_rag/config/config_multiplex.yaml,sha256=R2uyAw5Jxzge_ohEjfi_18i25vtd3qODChNijYqiv-M,1605
11
+ sage/benchmark_rag/config/config_qa_chroma.yaml,sha256=WzOvBNYMJ-CAkV1yTkJFdDYJ_Uv_e-fc8my4nq3fl6I,1168
12
+ sage/benchmark_rag/config/config_ray.yaml,sha256=1J-ZGBAEyKXb_WERAAQuS9LTWmaxL1ViugGRSgbQZxc,999
13
+ sage/benchmark_rag/config/config_refiner.yaml,sha256=Y-8UDsEqfptZPchdpZRgk-F-uPgj7hF_5PBuuXo_GlU,1976
14
+ sage/benchmark_rag/config/config_rerank.yaml,sha256=Rp65KPCjQYaA53VMTe9DglAoXuHYy-27XNfJQI2De9o,1253
15
+ sage/benchmark_rag/config/config_selfrag.yaml,sha256=kZlwdMsttTiuDQ7CQq-hF4Z4pJhHGvF0K6h4OL7uCcQ,657
16
+ sage/benchmark_rag/config/config_source.yaml,sha256=oP19eedcvFfB654iFgFfI6pweQOigSq6vuy5YkOZz1g,554
17
+ sage/benchmark_rag/config/config_source_local.yaml,sha256=gz2BwBQX4akdodhuS5finNXnSYgxC6VdgdqMp191ZUc,378
18
+ sage/benchmark_rag/config/config_sparse_milvus.yaml,sha256=TvAM4CqYqTPDJ7_ZknKx8kNBLwM0R7BYz9-7LzpC0FA,1308
19
+ sage/benchmark_rag/evaluation/__init__.py,sha256=dfDLqVIsgMV7WCZKVjMzMFfZUAC6vUZ4miOCZZvvWUA,296
20
+ sage/benchmark_rag/evaluation/benchmark_runner.py,sha256=8groX0mdvTnnld8a_ZrMkrTqOzHBuoidYvVag9svNQc,10840
21
+ sage/benchmark_rag/evaluation/evaluate_results.py,sha256=jma6SGq8DSNoasceGz2o55xyraTXasKOYptD7YFxcxA,13294
22
+ sage/benchmark_rag/evaluation/config/benchmark_config.yaml,sha256=4tOcF6Af0t9FaAFVH7Qxyfxc2Xm8JCJzYpBceUyPa5E,1151
23
+ sage/benchmark_rag/implementations/__init__.py,sha256=XFgI3OxoEvimYZ1lAA7xTAIHWmsUIP8ujGQc0JEyolE,812
24
+ sage/benchmark_rag/implementations/pipelines/__init__.py,sha256=2jv6g8Cd_N6g7uk-qTMcEllhdfrFfVCz4VUGmK55TDc,630
25
+ sage/benchmark_rag/implementations/pipelines/qa_bm25_retrieval.py,sha256=s1QrQE4gyagHVY1Yt3S1idp2hhSxi7qwNzFG0Q0Wx9I,2207
26
+ sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval.py,sha256=jZEtC_gyOcpf6oauNYsdm5EmGtwf9hplXujXf2eWvdE,2064
27
+ sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_chroma.py,sha256=scFrU93cU82xzzZPtKh53w7mKyqmnaLOclTxU0rypEo,2506
28
+ sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_milvus.py,sha256=Y8G2ForbqZz7kUXPHhRj5VLNT_56zfgSdoVXb-n5Flw,2784
29
+ sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_mixed.py,sha256=7DfoeCiUV6c1282rdWdfzRCG_x-S1mJSXCtjo-2Nzfw,2259
30
+ sage/benchmark_rag/implementations/pipelines/qa_dense_retrieval_ray.py,sha256=3CQd_Cr1QmmqpQl0goUCsPmvXd_YHNh5lQ5uh1oK67A,6582
31
+ sage/benchmark_rag/implementations/pipelines/qa_hf_model.py,sha256=XcGLVUkQoAdOIMjM8mdttTNKePyA7EGEjtnQtz0AY6A,1790
32
+ sage/benchmark_rag/implementations/pipelines/qa_monitoring_demo.py,sha256=Go6GBcW-dgsEWVmruwb76tsuS3vcYeTFfSxOv4vs5Uk,5861
33
+ sage/benchmark_rag/implementations/pipelines/qa_multimodal_fusion.py,sha256=UhzszEQteBTNTsiC03guIgNst93VBOgu9k2NrrKHWCg,10855
34
+ sage/benchmark_rag/implementations/pipelines/qa_multiplex.py,sha256=cTvn1k1gHbcaTgmKZnhahmaPGy0FgjyFD_GzMyz2jFE,3241
35
+ sage/benchmark_rag/implementations/pipelines/qa_refiner.py,sha256=68TpwwvcCQ8mCMFEzHhWI0xigBzXMhVWOSv0xk51ALw,3126
36
+ sage/benchmark_rag/implementations/pipelines/qa_rerank.py,sha256=ueDnEFRXzRJFKWZJbk7PLWXIfwUqG8ix2q3PlVozilY,2225
37
+ sage/benchmark_rag/implementations/pipelines/qa_sparse_retrieval_milvus.py,sha256=u2iD1CIedv-uuuOdCG4VZ6H_2ZT6TS3mRvMFRYYYc58,2648
38
+ sage/benchmark_rag/implementations/pipelines/selfrag.py,sha256=DeIOCBqRYz7u7rmPUDrZd10dppDJWmubIQsZrTL7LfU,6914
39
+ sage/benchmark_rag/implementations/tools/__init__.py,sha256=Wm5XCdGogWYRamK6qwja1VWTMLkLthbvsT8yZetV3zQ,528
40
+ sage/benchmark_rag/implementations/tools/build_chroma_index.py,sha256=sEDlRoRcxzDCUId4UMQZFG0Pbw04-D3xNn8_12cS-1Y,9139
41
+ sage/benchmark_rag/implementations/tools/build_milvus_dense_index.py,sha256=zQYxIoZLiS47owcqIj0wiLBYmgiRQgaJx_7hf2BIkTE,3010
42
+ sage/benchmark_rag/implementations/tools/build_milvus_index.py,sha256=HLsG7CGWqSZkzppiawqqnHP0bFw9XVoH_9sM0E39X_o,2153
43
+ sage/benchmark_rag/implementations/tools/build_milvus_sparse_index.py,sha256=Z4ucYYOCFx_CYlM7eM2-Q-php178Naminrgd6TXjJ-k,2994
44
+ sage/benchmark_rag/implementations/tools/loaders/document_loaders.py,sha256=LfXWZ_H1bxiBOlx2Vk9g63TbNSVW1N2nGS6F5tOBFCM,1196
45
+ isage_rag_benchmark-0.1.0.1.dist-info/METADATA,sha256=N1kRfa8YLjkJZ3nyajpk6G9gEIHv5CNcRJTIikIFy4s,2339
46
+ isage_rag_benchmark-0.1.0.1.dist-info/WHEEL,sha256=yk-B4c9kYsinhQ_MzhPAVcDm9mhkAVmdo0rg0jgFCmo,94
47
+ isage_rag_benchmark-0.1.0.1.dist-info/top_level.txt,sha256=hibFyzQHiLOMK68qL1OWsNKaXOmSXqZjeLTBem6Yy7I,5
48
+ isage_rag_benchmark-0.1.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: cp311-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IntelliStream Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
sage/__init__.py ADDED
File without changes
@@ -0,0 +1,16 @@
1
+ """
2
+ RAG Benchmarking Tools
3
+ ======================
4
+
5
+ Tools for benchmarking and evaluating RAG (Retrieval-Augmented Generation) systems.
6
+
7
+ This module provides:
8
+ - **implementations/**: Various RAG implementation approaches (dense, sparse, hybrid, multimodal)
9
+ - **evaluation/**: Pipeline experiments for batch processing and evaluation
10
+ - **config/**: Configuration files for different RAG setups
11
+
12
+ Test datasets and queries are located in the shared `data/qa/` directory.
13
+ Evaluation metrics include: Accuracy, F1, Exact Match, and more.
14
+ """
15
+
16
+ __all__: list[str] = []
@@ -0,0 +1,4 @@
1
+ """Version information for sage-rag-benchmark."""
2
+ __version__ = "0.1.0.0"
3
+ __author__ = "IntelliStream Team"
4
+ __email__ = "shuhao_zhang@hust.edu.cn"
@@ -0,0 +1,51 @@
1
+ pipeline:
2
+ name: "sage-api-operator-test"
3
+ description: "Test pipeline for Sage API Operator"
4
+ version: "1.0.0"
5
+ type: "remote"
6
+
7
+ source:
8
+ data_path: "packages/sage-benchmark/src/sage/data/qa/sample/question.txt"
9
+
10
+ retriever:
11
+ kv_collection:
12
+ bm25s: true
13
+ topk: 3
14
+ ltm:
15
+ topk: 3
16
+
17
+ reranker:
18
+ model_name: "BAAI/bge-reranker-v2-m3"
19
+ top_k: 3
20
+
21
+ promptor:
22
+
23
+ refiner:
24
+ method: "openai"
25
+ model_name: "qwen-turbo-0919"
26
+ base_url: "http://127.0.0.1:8889/v1"
27
+ api_key: ""
28
+ seed: 42
29
+
30
+ generator:
31
+ local:
32
+ method: "hf"
33
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
34
+ seed: 42
35
+
36
+ vllm:
37
+ api_key: ""
38
+ method: "openai"
39
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
40
+ base_url: "http://sage3:8000/v1"
41
+ seed: 42
42
+
43
+ remote:
44
+ api_key: ""
45
+ method: "openai"
46
+ model_name: "qwen-turbo-0919"
47
+ base_url: "http://127.0.0.1:8889/v1"
48
+ seed: 42
49
+
50
+ sink:
51
+ file_path: "output.txt"
@@ -0,0 +1,61 @@
1
+ # Milvus 稠密向量检索配置(适配 MilvusDenseRetriever)
2
+
3
+ source:
4
+ data_path: "./packages/sage-benchmark/src/sage/data/qa/queries.jsonl"
5
+ platform: "local"
6
+
7
+ retriever:
8
+ preload_knowledge_file:
9
+ - "./packages/sage-benchmark/src/sage/data/qa/qa_knowledge_chromaDB.txt"
10
+ - "./packages/sage-benchmark/src/sage/data/qa/qa_knowledge_rag.md"
11
+
12
+ # 通用参数
13
+ dimension: 384 # 向量维度,应与 embedding 模型一致
14
+ top_k: 2 # 返回文档数量
15
+
16
+ # 嵌入模型配置(用于对文档和查询编码)
17
+ embedding:
18
+ method: "hf"
19
+ model: "sentence-transformers/all-MiniLM-L6-v2"
20
+
21
+ # Milvus 后端(稠密检索)
22
+ milvus_dense:
23
+ # 本地 Milvus Lite(推荐用于快速试用)
24
+ persistence_path: "./data/milvus_qa_dense.db"
25
+
26
+ # 远程 Milvus(如需远程,请注释上面的 persistence_path,改为如下配置)
27
+ # host: "127.0.0.1"
28
+ # port: 19530
29
+ # force_http: true
30
+
31
+ collection_name: "qa_dense_collection"
32
+ dim: 384
33
+ metric_type: "COSINE" # 只允许: IP / COSINE / L2
34
+ search_type: "dense" # 稠密检索
35
+
36
+ # 可选项
37
+ dense_insert_batch_size: 128
38
+ # 知识文件(可选):提供后将自动按段落读取并入库
39
+ # knowledge_file: "./packages/sage-benchmark/src/sage/data/qa/qa_knowledge_base.txt"
40
+
41
+ promptor:
42
+ template: |
43
+ 基于以下检索到的相关文档,回答用户问题:
44
+
45
+ 相关文档:
46
+ {retrieved_documents}
47
+
48
+ 用户问题:{query}
49
+
50
+ 请提供准确、有用的回答:
51
+
52
+ generator:
53
+ vllm:
54
+ api_key: ""
55
+ method: "openai"
56
+ model_name: "meta-llama/Llama-2-7b-chat-hf"
57
+ base_url: "http://sage3:8000/v1"
58
+ seed: 42
59
+
60
+ sink:
61
+ enable_log: true
@@ -0,0 +1,43 @@
1
+ source:
2
+ data_path: "./packages/sage-benchmark/src/sage/data/qa/queries.jsonl" # 修正相对路径
3
+ platform: "local"
4
+
5
+ retriever:
6
+ # ChromaDB 专用配置
7
+ dimension: 384 # 修改为与 HuggingFace all-MiniLM-L6-v2 匹配
8
+ top_k: 2
9
+
10
+ chroma:
11
+ persistence_path: "./data/chroma_qa_database"
12
+ collection_name: "qa_knowledge_base"
13
+ use_embedding_query: true
14
+
15
+ # 知识库已预加载,注释掉自动加载
16
+ # knowledge_file: "../../data/qa_knowledge_base.txt"
17
+
18
+ # ChromaDB 元数据配置 (简化格式)
19
+ metadata:
20
+ hnsw:space: "cosine" # 距离度量
21
+
22
+ # 嵌入模型配置
23
+ embedding:
24
+ method: "hf"
25
+ model: "sentence-transformers/all-MiniLM-L6-v2"
26
+
27
+ promptor:
28
+ template: |
29
+ 基于以下检索到的相关文档,回答用户问题:
30
+
31
+ 相关文档:
32
+ {external_corpus}
33
+
34
+ 请提供准确、有用的回答。
35
+
36
+ generator:
37
+ local:
38
+ method: "hf"
39
+ model_name: "mistralai/Mistral-7B-Instruct-v0.1"
40
+ seed: 42
41
+
42
+ sink:
43
+ enable_log: true
@@ -0,0 +1,53 @@
1
+ pipeline:
2
+ name: "sage-api-operator-operator_test"
3
+ description: "Test pipeline for Sage API Operator"
4
+ version: "1.0.0"
5
+ type: "remote"
6
+
7
+ source:
8
+ # data_path: "sample/one_question.txt"
9
+ data_path: "packages/sage-benchmark/src/sage/data/qa/sample/question.txt"
10
+
11
+ retriever:
12
+ platform: "remote"
13
+ ltm:
14
+ topk: 3
15
+
16
+ reranker:
17
+ model_name: "BAAI/bge-reranker-v2-m3"
18
+ top_k: 3
19
+
20
+ refiner:
21
+ method: "openai"
22
+ model_name: "qwen-turbo-0919"
23
+ base_url: "http://127.0.0.1:8889/v1"
24
+ api_key: ""
25
+ seed: 42
26
+
27
+ generator:
28
+ local:
29
+ method: "hf"
30
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
31
+ seed: 42
32
+
33
+ vllm:
34
+ api_key: ""
35
+ method: "openai"
36
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
37
+ base_url: "http://sage3:8000/v1"
38
+ seed: 42
39
+
40
+ remote:
41
+ api_key: ""
42
+ method: "openai"
43
+ model_name: "qwen-turbo-0919"
44
+ base_url: "http://127.0.0.1:8889/v1"
45
+ seed: 42
46
+
47
+ writer:
48
+
49
+ promptor:
50
+ platform: "local"
51
+
52
+ sink:
53
+ platform: "local"
@@ -0,0 +1,59 @@
1
+ # Performance Monitoring Demo 配置文件
2
+ # 简化的 RAG Pipeline: Retrieval -> Prompt -> Generation
3
+ # 启用性能监控功能,收集 TPS/延迟/资源使用等指标
4
+
5
+
6
+ source:
7
+ data_path: "packages/sage-benchmark/src/sage/data/qa/queries.jsonl"
8
+ platform: "local"
9
+
10
+ retriever:
11
+ # ChromaDB 向量检索配置
12
+ dimension: 384 # 使用 HuggingFace all-MiniLM-L6-v2 embedding 模型
13
+ top_k: 3 # 检索 top-3 相关文档
14
+
15
+ chroma:
16
+ persistence_path: "./data/chroma_qa_database"
17
+ collection_name: "qa_knowledge_base"
18
+ use_embedding_query: true
19
+
20
+ # ChromaDB 元数据配置
21
+ metadata:
22
+ hnsw:space: "cosine" # 余弦相似度
23
+
24
+ # 嵌入模型配置
25
+ embedding:
26
+ method: "hf"
27
+ model: "sentence-transformers/all-MiniLM-L6-v2"
28
+
29
+ promptor:
30
+ template: |
31
+ 基于以下检索到的相关文档,回答用户问题:
32
+
33
+ 相关文档:
34
+ {retrieved_documents}
35
+
36
+ 用户问题:{query}
37
+
38
+ 请提供准确、有用的回答:
39
+
40
+ generator:
41
+ vllm:
42
+ api_key: ""
43
+ method: "openai"
44
+ model_name: "meta-llama/Llama-2-7b-chat-hf"
45
+ base_url: "http://sage3:8000/v1"
46
+ seed: 42
47
+ max_tokens: 256 # 限制生成长度以加快测试
48
+ temperature: 0.7
49
+
50
+ sink:
51
+ enable_log: true
52
+
53
+ # 监控配置 (可选,如果需要自定义监控参数)
54
+ monitoring:
55
+ enabled: true # 启用监控
56
+ metrics_window_size: 1000 # 滑动窗口大小
57
+ resource_monitoring: true # 启用 CPU/内存监控
58
+ sample_interval: 1.0 # 资源采样间隔(秒)
59
+ auto_report: false # 不自动打印报告(由主程序控制)
@@ -0,0 +1,79 @@
1
+ pipeline:
2
+ name: "sage-api-operator-operator_test"
3
+ description: "Test pipeline for Sage API Operator"
4
+ version: "1.0.0"
5
+
6
+ source:
7
+ # data_path: "sample/one_question.txt"
8
+ data_path: "packages/sage-benchmark/src/sage/data/qa/sample/question.txt"
9
+ platform: "local"
10
+
11
+ retriever:
12
+ # ChromaDB 专用配置
13
+ dimension: 384 # 修改为与 HuggingFace all-MiniLM-L6-v2 匹配
14
+ top_k: 2
15
+
16
+ chroma:
17
+ persistence_path: "./data/chroma_qa_database"
18
+ collection_name: "qa_knowledge_base"
19
+ use_embedding_query: true
20
+
21
+ # 知识库已预加载,注释掉自动加载
22
+ # knowledge_file: "../../data/qa_knowledge_base.txt"
23
+
24
+ # ChromaDB 元数据配置 (简化格式)
25
+ metadata:
26
+ hnsw:space: "cosine" # 距离度量
27
+
28
+ # 嵌入模型配置
29
+ embedding:
30
+ method: "hf"
31
+ model: "sentence-transformers/all-MiniLM-L6-v2"
32
+
33
+ reranker:
34
+ platform: "local"
35
+ model_name: "BAAI/bge-reranker-v2-m3"
36
+ top_k: 3
37
+
38
+ refiner:
39
+ platform: "local"
40
+ method: "openai"
41
+ model_name: "qwen-turbo-0919"
42
+ base_url: "http://127.0.0.1:8889/v1"
43
+ api_key: ""
44
+ seed: 42
45
+
46
+ generator:
47
+ local:
48
+ method: "hf"
49
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
50
+ seed: 42
51
+
52
+ vllm:
53
+ api_key: ""
54
+ method: "openai"
55
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
56
+ base_url: "http://sage3:8000/v1"
57
+ seed: 42
58
+
59
+ remote:
60
+ api_key: ""
61
+ method: "openai"
62
+ model_name: "qwen-turbo-0919"
63
+ base_url: "http://127.0.0.1:8889/v1"
64
+ seed: 42
65
+
66
+ writer:
67
+
68
+ promptor:
69
+ platform: "local"
70
+
71
+ sink_true:
72
+ file_path: "output_true.txt"
73
+
74
+
75
+ sink_false:
76
+ file_path: "output_false.txt"
77
+
78
+
79
+ sink_terminal:
@@ -0,0 +1,51 @@
1
+ # ChromaDB 专用 QA 配置文件
2
+ # 适用于 qa_openai.py 的简化配置
3
+
4
+
5
+ source:
6
+ data_path: "./packages/sage-benchmark/src/sage/data/qa/queries.jsonl" # 修正相对路径
7
+ platform: "local"
8
+
9
+ retriever:
10
+ # ChromaDB 专用配置
11
+ dimension: 384 # 修改为与 HuggingFace all-MiniLM-L6-v2 匹配
12
+ top_k: 2
13
+
14
+ chroma:
15
+ persistence_path: "./data/chroma_qa_database"
16
+ collection_name: "qa_knowledge_base"
17
+ use_embedding_query: true
18
+
19
+ # 知识库已预加载,注释掉自动加载
20
+ # knowledge_file: "../../data/qa_knowledge_base.txt"
21
+
22
+ # ChromaDB 元数据配置 (简化格式)
23
+ metadata:
24
+ hnsw:space: "cosine" # 距离度量
25
+
26
+ # 嵌入模型配置
27
+ embedding:
28
+ method: "hf"
29
+ model: "sentence-transformers/all-MiniLM-L6-v2"
30
+
31
+ promptor:
32
+ template: |
33
+ 基于以下检索到的相关文档,回答用户问题:
34
+
35
+ 相关文档:
36
+ {retrieved_documents}
37
+
38
+ 用户问题:{query}
39
+
40
+ 请提供准确、有用的回答:
41
+
42
+ generator:
43
+ vllm:
44
+ api_key: ""
45
+ method: "openai"
46
+ model_name: "meta-llama/Llama-2-7b-chat-hf"
47
+ base_url: "http://sage3:8000/v1"
48
+ seed: 42
49
+
50
+ sink:
51
+ enable_log: true
@@ -0,0 +1,57 @@
1
+ pipeline:
2
+ name: "sage-api-operator-operator_test"
3
+ description: "Test pipeline for Sage API Operator"
4
+ version: "1.0.0"
5
+
6
+
7
+
8
+ source:
9
+ # data_path: "sample/one_question.txt"
10
+ data_path: "packages/sage-benchmark/src/sage/data/qa/sample/question.txt"
11
+ platform: "remote"
12
+
13
+ retriever:
14
+ platform: "remote"
15
+ ltm:
16
+ topk: 3
17
+
18
+ reranker:
19
+ platform: "remote"
20
+ model_name: "BAAI/bge-reranker-v2-m3"
21
+ top_k: 3
22
+
23
+ refiner:
24
+ platform: "remote"
25
+ method: "openai"
26
+ model_name: "qwen-turbo"
27
+ base_url: "http://127.0.0.1:8889/v1"
28
+ api_key: ""
29
+ seed: 42
30
+
31
+ generator:
32
+ local:
33
+ method: "hf"
34
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
35
+ seed: 42
36
+
37
+ vllm:
38
+ api_key: ""
39
+ method: "openai"
40
+ model_name: "meta-llama/Llama-2-13b-chat-hf"
41
+ base_url: "http://sage3:8000/v1"
42
+ seed: 42
43
+
44
+ remote:
45
+ api_key: ""
46
+ method: "openai"
47
+ model_name: "qwen-turbo-0919"
48
+ base_url: "http://127.0.0.1:8889/v1"
49
+ seed: 42
50
+
51
+ writer:
52
+
53
+ promptor:
54
+ platform: "remote"
55
+
56
+ sink:
57
+ platform: "remote"