Skip to content

Commit 3ef2a5a

Browse files
authored
refactor!: ensure compatibility with the latest Langfuse version (#93)
This pull request introduces significant updates to the RAG infrastructure and evaluation codebase, primarily focused on improving Langfuse integration, updating dependencies, and refactoring configuration for external service management. The changes enhance traceability, simplify environment setup, and ensure compatibility with the latest Langfuse version. **Langfuse Integration and Evaluation Refactor:** * Refactored the Langfuse evaluation workflow in `langfuse_ragas_evaluator.py` to use context managers (`start_as_current_generation` and `run`) for better trace and generation handling, and replaced manual scoring and linking with direct trace scoring. [[1]](diffhunk://#diff-fe148c64db46f85d0ef8df1dfbebe80d8a816c2025bef7c15f7ae9282457ac81R165-R198) [[2]](diffhunk://#diff-fe148c64db46f85d0ef8df1dfbebe80d8a816c2025bef7c15f7ae9282457ac81L213-R219) * Updated the dataset creation method to use the new Langfuse API signature (`create_dataset(name=...)`). **Dependency Updates:** * Upgraded the `langfuse` Python package from `3.0.0` to `3.3.4` across all relevant `pyproject.toml` files for improved compatibility and features. [[1]](diffhunk://#diff-9c5aeb0db77c2eec077d07ddc3b3810ae1a4a1e50ee7061fba37a46706c513fbL107-R107) [[2]](diffhunk://#diff-9c4162cc1c16dd4c7ec5e95e79df285e8c0882a1db7ff2892c746a0537d26c36L34-R34) [[3]](diffhunk://#diff-b19ab043535569caf9345971969d115d6515ae951a21b00a278145a28230fba1L21-R21) **Infrastructure Configuration Improvements:** * Updated the Langfuse Helm chart dependency version from `0.12.1` to `1.5.1` in `Chart.yaml`. * Overhauled `values.yaml` to externalize configuration for PostgreSQL, Redis (KeyDB), ClickHouse, and S3/MinIO, removing embedded environment variable definitions and introducing dedicated configuration sections for each service. [[1]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3L448-R480) [[2]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3L482-R497) [[3]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3R512-R582) * Removed internal deployment of MinIO and Valkey, and clarified that KeyDB is used for Redis functionality. [[1]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3L448-R480) [[2]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3L540-L543) [[3]](diffhunk://#diff-673dd2d3d4e66a8fd4e45f9c1c9900711313f946bf8b6a89e96c954988fc14f3R615-R619) **Tracing Enhancements:** * Improved tracing in `traced_runnable.py` by updating span names to reflect the actual chain class and including input/output in the trace, enabling more detailed observability.
1 parent 4abad9d commit 3ef2a5a

File tree

15 files changed

+209
-548
lines changed

15 files changed

+209
-548
lines changed

infrastructure/rag/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dependencies:
22
- name: langfuse
33
repository: https://langfuse.github.io/langfuse-k8s
4-
version: 0.12.1
4+
version: 1.5.1
55
- name: qdrant
66
repository: https://qdrant.github.io/qdrant-helm
77
version: 1.15.4
@@ -14,5 +14,5 @@ dependencies:
1414
- name: ollama
1515
repository: https://otwld.github.io/ollama-helm/
1616
version: 1.27.0
17-
digest: sha256:27cfa430e217d545d1d85479029dc83bf946e32ae1744d35eb94050f1c4714c4
18-
generated: "2025-09-24T12:23:52.977733+02:00"
17+
digest: sha256:86652599791c7f3ae4e66e6ed4404630d733cf35503c4b94b90da9c3c950c7fb
18+
generated: "2025-10-07T10:23:59.709679+02:00"

infrastructure/rag/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ appVersion: "1.0.0"
1010
dependencies:
1111
- name: langfuse
1212
repository: https://langfuse.github.io/langfuse-k8s
13-
version: "0.12.1"
13+
version: "1.5.1"
1414
condition: features.langfuse.enabled
1515
- name: qdrant
1616
version: 1.15.4

infrastructure/rag/values.yaml

Lines changed: 107 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -450,39 +450,39 @@ shared:
450450

451451

452452
langfuse:
453-
minio:
454-
image:
455-
repository: bitnamilegacy/minio
456-
deploy: false
457-
valkey:
458-
image:
459-
repository: bitnamilegacy/valkey
460-
deploy: false #<--- keydb is used instead of valkey
461-
image:
462-
repository: ghcr.io/langfuse/langfuse
463-
pullPolicy: Always
464-
tag: "3.27.2"
465-
postgresql:
466-
image:
467-
repository: bitnamilegacy/postgresql
468-
deploy: true
469-
auth:
470-
username: postgres
471-
password: postgres
472-
database: langfuse
473-
clickhouse:
474-
image:
475-
repository: bitnamilegacy/clickhouse
476-
zookeeper:
453+
# Core Langfuse Configuration
454+
langfuse:
455+
# Used to hash API keys
456+
salt:
457+
value: "changeme"
458+
459+
# Authentication settings
460+
features:
461+
telemetryEnabled: true
462+
signUpDisabled: false
463+
464+
# Web deployment configuration
465+
web:
477466
image:
478-
repository: bitnamilegacy/zookeeper
467+
repository: langfuse/langfuse
468+
tag: "3.106.3"
469+
pullPolicy: Always
479470

471+
# Worker deployment configuration
472+
worker:
473+
image:
474+
repository: langfuse/langfuse-worker
475+
tag: "3.106.3"
476+
pullPolicy: Always
477+
port: 3030
480478

481-
langfuse:
479+
# NextAuth configuration
482480
nextauth:
483481
url: http://localhost:3000
484-
secret: changeme
485-
salt: changeme
482+
secret:
483+
value: "changeme"
484+
485+
# Additional environment variables (only for init values)
486486
additionalEnv:
487487
- name: LANGFUSE_INIT_ORG_ID
488488
value: ""
@@ -498,33 +498,8 @@ langfuse:
498498
value: ""
499499
- name: LANGFUSE_INIT_USER_PASSWORD
500500
value: ""
501-
# REDIS
502-
- name: "REDIS_CONNECTION_STRING"
503-
value: "redis://rag-keydb:6379"
504-
# CLICKHOUSE
505-
- name: "CLICKHOUSE_MIGRATION_URL"
506-
value: "clickhouse://rag-clickhouse:9000"
507-
- name: "CLICKHOUSE_URL"
508-
value: "http://rag-clickhouse:8123"
509-
- name: "CLICKHOUSE_USER"
510-
value: "default"
511-
- name: "CLICKHOUSE_PASSWORD"
512-
value: "changeme"
513-
# S3 / MinIO
514-
- name: "LANGFUSE_S3_EVENT_UPLOAD_ENABLED"
515-
value: "true"
516-
- name: "LANGFUSE_S3_EVENT_UPLOAD_BUCKET"
517-
value: "langfuse"
518-
- name: "LANGFUSE_S3_EVENT_UPLOAD_REGION"
519-
value: "auto"
520-
- name: "LANGFUSE_S3_EVENT_UPLOAD_ACCESS_KEY_ID"
521-
value: "admin"
522-
- name: "LANGFUSE_S3_EVENT_UPLOAD_SECRET_ACCESS_KEY"
523-
value: "adminpassword"
524-
- name: "LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT"
525-
value: "http://rag-minio:9000"
526-
- name: "LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE"
527-
value: "true"
501+
502+
# Additional init containers
528503
extraInitContainers:
529504
- name: wait-for-postgres
530505
image: busybox
@@ -539,6 +514,77 @@ langfuse:
539514
# Define a reasonable timeout in case PostgreSQL fails to come up
540515
timeoutSeconds: 300
541516

517+
# PostgreSQL Configuration (use external PostgreSQL)
518+
postgresql:
519+
deploy: true
520+
host: "rag-postgresql"
521+
port: 5432
522+
auth:
523+
username: postgres
524+
password: postgres
525+
database: langfuse
526+
527+
# Redis Configuration (external KeyDB)
528+
redis:
529+
deploy: false
530+
host: "rag-keydb"
531+
port: 6379
532+
auth:
533+
username: "default"
534+
password: ""
535+
536+
# ClickHouse Configuration (external ClickHouse)
537+
clickhouse:
538+
deploy: true
539+
host: "rag-clickhouse"
540+
httpPort: 8123
541+
nativePort: 9000
542+
auth:
543+
username: "default"
544+
password: "changeme"
545+
migration:
546+
url: "clickhouse://rag-clickhouse:9000"
547+
ssl: false
548+
autoMigrate: true
549+
resources:
550+
limits:
551+
cpu: "2"
552+
memory: "8Gi"
553+
requests:
554+
cpu: "2"
555+
memory: "4Gi"
556+
557+
zookeeper:
558+
resources:
559+
limits:
560+
cpu: "2"
561+
memory: "2Gi"
562+
requests:
563+
cpu: "1"
564+
memory: "1Gi"
565+
566+
# S3/MinIO Configuration (external MinIO)
567+
s3:
568+
deploy: false
569+
bucket: "langfuse"
570+
region: "auto"
571+
endpoint: "http://rag-minio:9000"
572+
forcePathStyle: true
573+
accessKeyId:
574+
value: "admin"
575+
secretAccessKey:
576+
value: "adminpassword"
577+
eventUpload:
578+
enabled: true
579+
bucket: "langfuse"
580+
region: "auto"
581+
endpoint: "http://rag-minio:9000"
582+
forcePathStyle: true
583+
accessKeyId:
584+
value: "admin"
585+
secretAccessKey:
586+
value: "adminpassword"
587+
542588
minio:
543589
image:
544590
repository: bitnamilegacy/minio
@@ -558,13 +604,9 @@ minio:
558604
enabled: false
559605
mode: standalone
560606

561-
562-
563-
564-
565607
ollama:
566608
image:
567-
tag: 0.5.1
609+
tag: 0.12.3
568610
ollama:
569611
models:
570612
pull:
@@ -577,3 +619,8 @@ ollama:
577619
qdrant:
578620
image:
579621
tag: v1.15.4
622+
623+
keydb:
624+
multiMaster: "no"
625+
activeReplicas: "no"
626+
nodes: 1

libs/admin-api-lib/poetry.lock

Lines changed: 7 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)