You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Feat: make document parsing and embedding batch sizes configurable via environment variables (#8266) ### Description This PR introduces two new environment variables, ‎`DOC_BULK_SIZE` and ‎`EMBEDDING_BATCH_SIZE`, to allow flexible tuning of batch sizes for document parsing and embedding vectorization in RAGFlow. By making these parameters configurable, users can optimize performance and resource usage according to their hardware capabilities and workload requirements. ### What problem does this PR solve? Previously, the batch sizes for document parsing and embedding were hardcoded, limiting the ability to adjust throughput and memory consumption. This PR enables users to set these values via environment variables (in ‎`.env`, Helm chart, or directly in the deployment environment), improving flexibility and scalability for both small and large deployments. - ‎`DOC_BULK_SIZE`: Controls how many document chunks are processed in a single batch during document parsing (default: 4). - ‎`EMBEDDING_BATCH_SIZE`: Controls how many text chunks are processed in a single batch during embedding vectorization (default: 16). This change updates the codebase, documentation, and configuration files to reflect the new options. ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [x] Documentation Update - [ ] Refactoring - [x] Performance Improvement - [ ] Other (please describe): ### Additional context - Updated ‎`.env`, ‎`helm/values.yaml`, and documentation to describe the new variables. - Modified relevant code paths to use the environment variables instead of hardcoded values. - Users can now tune these parameters to achieve better throughput or reduce memory usage as needed. Before: Default value: <img width="643" alt="image" src="https://github.com/user-attachments/assets/086e1173-18f3-419d-a0f5-68394f63866a" /> After: 10x: <img width="777" alt="image" src="https://github.com/user-attachments/assets/5722bbc0-0bcb-4536-b928-077031e550f1" />
4 maanden geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Based on docker compose .env file
  2. env:
  3. # The type of doc engine to use.
  4. # Available options:
  5. # - `elasticsearch` (default)
  6. # - `infinity` (https://github.com/infiniflow/infinity)
  7. # DOC_ENGINE: elasticsearch
  8. DOC_ENGINE: infinity
  9. # The version of Elasticsearch.
  10. STACK_VERSION: "8.11.3"
  11. # The password for Elasticsearch
  12. ELASTIC_PASSWORD: infini_rag_flow_helm
  13. # The password for MySQL
  14. MYSQL_PASSWORD: infini_rag_flow_helm
  15. # The database of the MySQL service to use
  16. MYSQL_DBNAME: rag_flow
  17. # The username for MinIO.
  18. MINIO_ROOT_USER: rag_flow
  19. # The password for MinIO
  20. MINIO_PASSWORD: infini_rag_flow_helm
  21. # The password for Redis
  22. REDIS_PASSWORD: infini_rag_flow_helm
  23. # The RAGFlow Docker image to download.
  24. # Defaults to the v0.19.1-slim edition, which is the RAGFlow Docker image without embedding models.
  25. RAGFLOW_IMAGE: infiniflow/ragflow:v0.19.1-slim
  26. #
  27. # To download the RAGFlow Docker image with embedding models, uncomment the following line instead:
  28. # RAGFLOW_IMAGE: infiniflow/ragflow:v0.19.1
  29. #
  30. # The Docker image of the v0.19.1 edition includes:
  31. # - Built-in embedding models:
  32. # - BAAI/bge-large-zh-v1.5
  33. # - BAAI/bge-reranker-v2-m3
  34. # - maidalun1020/bce-embedding-base_v1
  35. # - maidalun1020/bce-reranker-base_v1
  36. # - Embedding models that will be downloaded once you select them in the RAGFlow UI:
  37. # - BAAI/bge-base-en-v1.5
  38. # - BAAI/bge-large-en-v1.5
  39. # - BAAI/bge-small-en-v1.5
  40. # - BAAI/bge-small-zh-v1.5
  41. # - jinaai/jina-embeddings-v2-base-en
  42. # - jinaai/jina-embeddings-v2-small-en
  43. # - nomic-ai/nomic-embed-text-v1.5
  44. # - sentence-transformers/all-MiniLM-L6-v2
  45. #
  46. #
  47. # The local time zone.
  48. TIMEZONE: "Asia/Shanghai"
  49. # Uncomment the following line if you have limited access to huggingface.co:
  50. # HF_ENDPOINT: https://hf-mirror.com
  51. # The maximum file size for each uploaded file, in bytes.
  52. # You can uncomment this line and update the value if you wish to change 128M file size limit
  53. # MAX_CONTENT_LENGTH: "134217728"
  54. # After making the change, ensure you update `client_max_body_size` in nginx/nginx.conf correspondingly.
  55. # The number of document chunks processed in a single batch during document parsing.
  56. DOC_BULK_SIZE: 4
  57. # The number of text chunks processed in a single batch during embedding vectorization.
  58. EMBEDDING_BATCH_SIZE: 16
  59. ragflow:
  60. deployment:
  61. strategy:
  62. resources:
  63. service:
  64. # Use LoadBalancer to expose the web interface externally
  65. type: ClusterIP
  66. api:
  67. service:
  68. enabled: true
  69. type: ClusterIP
  70. infinity:
  71. image:
  72. repository: infiniflow/infinity
  73. tag: v0.6.0-dev3
  74. storage:
  75. className:
  76. capacity: 5Gi
  77. deployment:
  78. strategy:
  79. resources:
  80. service:
  81. type: ClusterIP
  82. elasticsearch:
  83. storage:
  84. className:
  85. capacity: 20Gi
  86. deployment:
  87. strategy:
  88. resources:
  89. requests:
  90. cpu: "4"
  91. memory: "16Gi"
  92. service:
  93. type: ClusterIP
  94. minio:
  95. image:
  96. repository: quay.io/minio/minio
  97. tag: RELEASE.2023-12-20T01-00-02Z
  98. storage:
  99. className:
  100. capacity: 5Gi
  101. deployment:
  102. strategy:
  103. resources:
  104. service:
  105. type: ClusterIP
  106. mysql:
  107. image:
  108. repository: mysql
  109. tag: 8.0.39
  110. storage:
  111. className:
  112. capacity: 5Gi
  113. deployment:
  114. strategy:
  115. resources:
  116. service:
  117. type: ClusterIP
  118. redis:
  119. image:
  120. repository: valkey/valkey
  121. tag: 8
  122. storage:
  123. className:
  124. capacity: 5Gi
  125. persistence:
  126. enabled: true
  127. deployment:
  128. strategy:
  129. resources:
  130. service:
  131. type: ClusterIP
  132. # This block is for setting up web service ingress. For more information, see:
  133. # https://kubernetes.io/docs/concepts/services-networking/ingress/
  134. ingress:
  135. enabled: false
  136. className: ""
  137. annotations: {}
  138. # kubernetes.io/ingress.class: nginx
  139. # kubernetes.io/tls-acme: "true"
  140. hosts:
  141. - host: chart-example.local
  142. paths:
  143. - path: /
  144. pathType: ImplementationSpecific
  145. tls: []
  146. # - secretName: chart-example-tls
  147. # hosts:
  148. # - chart-example.local