Skip to content

Commit 1585576

Browse files
authored
chore: add settings for source uploader (admin backend) (#18)
Configuration of a timeout parameter is possible. defaults to 1h.
1 parent 6ff2084 commit 1585576

File tree

6 files changed

+104
-56
lines changed

6 files changed

+104
-56
lines changed

infrastructure/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**/cr-secret.yaml
22
**/customer-values.yaml
3-
auth
4-
*\-values.yaml
3+
**/auth
4+
55
*/terraform.tfstate
66
*/Chart.lock
77
*.tgz

infrastructure/README.md

Lines changed: 85 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,23 @@ This Repository contains the helm chart for the following RAG components:
2626
- Frontend
2727
- Backend
2828

29-
> 📝 NOTE: Only the settings you are most likely to adjust are listed here. For all available settings please have a look at the [values.yaml](rag/values.yaml).
29+
> 📝 NOTE: Only the settings you are most likely to adjust are listed here. For all available settings please take a look at the [values.yaml](rag/values.yaml).
3030
3131
Except all `backend` services all components can be disabled and exchanged with components of your choice.
3232
This can be done by overwriting the following values in your `values.yaml`
3333

3434
```yaml
3535
features:
36+
ollama:
37+
enabled: false
38+
minio:
39+
enabled: false
3640
langfuse:
3741
enabled: true
3842
qdrant:
3943
enabled: true
4044
frontend:
4145
enabled: true
42-
minio:
43-
enabled: true
4446
keydb:
4547
enabled: true
4648
```
@@ -74,16 +76,28 @@ For local development, the `imagePullSecret` is not necessary.
7476
You can deploy Langfuse with initial values for the public and secret API keys. The respective values are shown below:
7577

7678
```yaml
79+
# For production deployment with external PostgreSQL
7780
langfuse:
81+
postgresql:
82+
deploy: true # If you want to use an external PostgreSQL, set this to false
7883
langfuse:
7984
additionalEnv:
80-
LANGFUSE_INIT_ORG_ID:
81-
LANGFUSE_INIT_PROJECT_ID:
82-
LANGFUSE_INIT_PROJECT_PUBLIC_KEY:
83-
LANGFUSE_INIT_PROJECT_SECRET_KEY:
84-
LANGFUSE_INIT_USER_EMAIL:
85-
LANGFUSE_INIT_USER_NAME:
86-
LANGFUSE_INIT_USER_PASSWORD:
85+
- name: DATABASE_URL
86+
value: "postgresql://username:password@postgres-host:5432/langfuse" # Your PostgreSQL connection string
87+
- name: LANGFUSE_INIT_ORG_ID
88+
value: ... # Optional: Pre-create organization
89+
- name: LANGFUSE_INIT_PROJECT_ID
90+
value: ... # Optional: Pre-create project
91+
- name: LANGFUSE_INIT_PROJECT_PUBLIC_KEY
92+
value: ... # Optional: Set initial public key
93+
- name: LANGFUSE_INIT_PROJECT_SECRET_KEY
94+
value: ... # Optional: Set initial secret key
95+
- name: LANGFUSE_INIT_USER_EMAIL
96+
value: ... # Optional: Create initial user
97+
- name: LANGFUSE_INIT_USER_NAME
98+
value: ... # Optional: Initial user name
99+
- name: LANGFUSE_INIT_USER_PASSWORD
100+
value: ... # Optional: Initial user password
87101
```
88102

89103
Besides, you can deploy Langfuse in a two-step approach. First, you deploy Langfuse without the API keys, and then you can create the API keys via the Web UI. Therefore, after deployment, you have to sign up in the Web UI and create a project in the local Langfuse instance, create API keys via the settings; see below.
@@ -134,12 +148,24 @@ The usage of the KeyDB is **only recommended for development** purposes. KeyDB i
134148
In **production**, the usage of a fully-managed Redis instance (e.g. provided by STACKIT) is recommended. The following parameters need to be adjusted in the `values.yaml` file:
135149

136150
```yaml
151+
# For production: Use external Redis instead of KeyDB
137152
adminBackend:
138-
keyValueStore:
139-
USECASE_KEYVALUE_HOST: ...
153+
envs:
154+
keyValueStore:
155+
USECASE_KEYVALUE_HOST: ... # Your Redis host (e.g., redis.yourdomain.com)
156+
USECASE_KEYVALUE_PORT: 6379
157+
140158
features:
141159
keydb:
142-
enabled: false
160+
enabled: false # Disable KeyDB for production
161+
162+
langfuse:
163+
valkey:
164+
deploy: false # Use Redis instead of KeyDB
165+
langfuse:
166+
additionalEnv:
167+
- name: REDIS_CONNECTION_STRING
168+
value: "redis:"
143169
```
144170

145171
### 1.4 Frontend
@@ -150,18 +176,21 @@ The following values should be adjusted for the deployment:
150176
frontend:
151177
envs:
152178
vite:
153-
VITE_API_URL: ... # You should add the public url to the backend here
154-
VITE_CHAT_URL: ... # You should add the public url to the chat frontend here
179+
# Required: Update these URLs for your deployment
180+
VITE_API_URL: "https://rag.yourdomain.com/api" # Your backend API URL
181+
VITE_CHAT_URL: "https://rag.yourdomain.com" # Your chat frontend URL
182+
VITE_ADMIN_URL: "https://admin.rag.yourdomain.com" # Your admin frontend URL
183+
VITE_ADMIN_API_URL: "https://admin.rag.yourdomain.com/api" # Your admin API URL
155184
156185
ingress:
157186
host:
158-
name: ... # You should add the DNS for the chat-frontend here
187+
name: ... # Your domain name (e.g., rag.yourdomain.com)
159188
160189
secrets:
161190
viteAuth:
162-
VITE_AUTH_USERNAME: ... # You should add the username for the basic auth of the backend here
163-
VITE_AUTH_PASSWORD: ... # You should add the password for the basic auth of the backend here
164-
191+
# Required: Credentials for backend authentication
192+
VITE_AUTH_USERNAME: ... # Username for basic auth
193+
VITE_AUTH_PASSWORD: ... # Password for basic auth
165194
```
166195

167196
### 1.5 Backend
@@ -171,33 +200,34 @@ The following values should be adjusted for the deployment:
171200
```yaml
172201
backend:
173202
secrets:
203+
# Required: Basic authentication for the backend API
204+
basicAuth: ... # Set your basic auth credentials
174205
175-
basicAuth: ...
206+
# Required: Langfuse API keys for observability
176207
langfuse:
177-
publicKey: ...
178-
secretKey: ...
179-
openai:
180-
apiKey: ...
181-
# LLM secrets. Only the secrets for the LLM you choose have to be provided
182-
# With the exception of the class `stackit` the embedder and llm share the secrets
183-
#
184-
# stackit
208+
publicKey: ... # Your Langfuse public key
209+
secretKey: ... # Your Langfuse secret key
210+
211+
# Required: API keys for your chosen LLM provider
212+
# STACKIT LLM provider
185213
stackitEmbedder:
186-
apiKey: ...
214+
apiKey: ... # Your STACKIT embedder API key
187215
stackitVllm:
188-
apiKey: ...
189-
# for ollama there is no apikey setting
216+
apiKey: ... # Your STACKIT vLLM API key
217+
218+
# Optional: Only needed if using RAGAS evaluation with OpenAI
219+
ragas:
220+
openaiApikey: ... # Your OpenAI API key for RAGAS evaluation
190221
191222
envs:
192-
# Decide which LLM you would like to use for answering/embedding.
193-
# These settings are independent of each other. You can use a different LLM for embedding and answering.
223+
# Required: Choose your LLM and embedder providers
194224
ragClassTypes:
195-
RAG_CLASS_TYPE_LLM_TYPE: "stackit"
225+
RAG_CLASS_TYPE_LLM_TYPE: "stackit" # Options: "stackit", "ollama"
196226
embedderClassTypes:
197-
EMBEDDER_CLASS_TYPE_EMBEDDER_TYPE: "stackit"
198-
# Settings for the retriever. These should be adjusted for your use-case.
199-
# Finding the correct setting to not retrieve too many or not enough documents from the vector database is
200-
# important for a good result.
227+
EMBEDDER_CLASS_TYPE_EMBEDDER_TYPE: "stackit" # Options: "stackit", "ollama"
228+
229+
# Optional: Adjust retriever settings for your use-case
230+
# These control how many documents are retrieved from the vector database
201231
retriever:
202232
RETRIEVER_THRESHOLD: 0.3
203233
RETRIEVER_K_DOCUMENTS: 10
@@ -208,6 +238,7 @@ backend:
208238
RETRIEVER_TABLE_K_DOCUMENTS: 10
209239
RETRIEVER_IMAGE_THRESHOLD: 0.7
210240
RETRIEVER_IMAGE_K_DOCUMENTS: 10
241+
# Optional: Adjust Reranker settings for your use-case
211242
reranker:
212243
RERANKER_K_DOCUMENTS: 5
213244
RERANKER_MIN_RELEVANCE_SCORE: 0.001
@@ -229,32 +260,32 @@ backend:
229260
RAGAS_MAX_CONCURRENCY: "5"
230261
231262
ingress:
232-
host:
233-
name: rag.localhost
263+
host:
264+
name: ... # Your domain name (e.g., rag.yourdomain.com)
234265
235-
global:
236-
ssl: true
237-
secrets:
238-
basic_auth: ...
239-
langfuse:
240-
public_key: ...
241-
secret_key: ...
266+
# Required for production deployments
267+
shared:
242268
config:
243-
envs:
244-
rag_class_types:
245-
RAG_CLASS_TYPE_LLM_TYPE: "stackit"
246-
RAG_CLASS_TYPE_EMBEDDER_TYPE: "stackit"
269+
dns:
270+
- ... # Your primary domain (e.g., rag.yourdomain.com)
271+
- ... # Your admin domain (e.g., admin.rag.yourdomain.com)
272+
273+
tls:
274+
enabled: true
275+
host: ... # Your primary domain for TLS certificate
276+
secretName: tls-certificate
277+
issuerName: letsencrypt-cluster-issuer # Adjust if using different cert issuer
247278
248279
```
249280

250-
> 📝 NOTE: All values containg `...` are placeholders and have to be replaced with real values.
281+
> 📝 NOTE: Values marked with `...` are placeholders that **must** be replaced with your actual values for deployment.
251282

252-
> ⓘ INFO: This deployment comes with multiple options. You can change the `global.config.envs.rag_class_types.RAG_CLASS_TYPE_LLM_TYPE` in `./rag/values.yaml` to one of the following values:
283+
> ⓘ INFO: This deployment comes with multiple options. You can change the `backend.envs.ragClassTypes.RAG_CLASS_TYPE_LLM_TYPE` in `./rag/values.yaml` to one of the following values:
253284
>
254285
> - `stackit`: Uses the STACKIT LLM as an LLM provider.
255286
> - `ollama`: Uses Ollama as an LLM provider.
256287
>
257-
> The same options are also available for the `backend.envs.ragClassTypes.RAG_CLASS_TYPE_EMBEDDER_TYPE`.
288+
> The same options are also available for the `backend.envs.embedderClassTypes.EMBEDDER_CLASS_TYPE_EMBEDDER_TYPE`.
258289

259290
### 1.6 Use Case Environment Variables
260291

infrastructure/rag/templates/_admin_backend_and_extractor_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
{{- printf "%s-stackit-vllm-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
6969
{{- end -}}
7070

71+
{{- define "configmap.sourceUploaderName" -}}
72+
{{- printf "%s-source-uploader-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
73+
{{- end -}}
74+
7175
# image
7276
{{- define "adminBackend.fullImageName" -}}
7377
{{- printf "%s/%s:%s" .Values.adminBackend.image.repository .Values.adminBackend.image.name .Values.adminBackend.image.tag | trimSuffix ":" }}

infrastructure/rag/templates/admin-backend/configmap.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,12 @@ data:
3333
{{- range $key, $value := .Values.adminBackend.envs.keyValueStore }}
3434
{{ $key }}: {{ $value | quote }}
3535
{{- end }}
36+
---
37+
apiVersion: v1
38+
kind: ConfigMap
39+
metadata:
40+
name: {{ template "configmap.sourceUploaderName" . }}
41+
data:
42+
{{- range $key, $value := .Values.adminBackend.envs.sourceUploader }}
43+
{{ $key }}: {{ $value | quote }}
44+
{{- end }}

infrastructure/rag/templates/admin-backend/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ spec:
104104
name: {{ template "configmap.pdfextractorName" . }}
105105
- configMapRef:
106106
name: {{ template "configmap.keyValueStoreName" . }}
107+
- configMapRef:
108+
name: {{ template "configmap.sourceUploaderName" . }}
107109
- secretRef:
108110
name: {{ template "secret.langfuseName" . }}
109111
- secretRef:

infrastructure/rag/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ adminBackend:
264264
keyValueStore:
265265
USECASE_KEYVALUE_PORT: 6379
266266
USECASE_KEYVALUE_HOST: "rag-keydb"
267+
sourceUploader:
268+
SOURCE_UPLOADER_TIMEOUT: 3600
267269

268270
extractor:
269271
replicaCount: 1

0 commit comments

Comments
 (0)