🪢 feat: Langfuse Connection Configuration#94
Draft
dustinhealy wants to merge 7 commits into
Draft
Conversation
Surface a per-tenant Langfuse connection section (enabled, base URL, public key, secret key) in the admin config UI. It saves through the existing /api/admin/config field API. The pinned librechat-data-provider (0.8.509) predates the langfuse config group, so a forward-compat shim extends configSchema locally until a data-provider version defining langfuse is published and pinned, mirroring the READ_AUDIT_LOG capability shim. The shim no-ops once upstream ships it.
Custom section renderer for the Langfuse config: enable toggle, host, public key, a masked (PasswordInput) secret that is write-only and only sent on change, the configured-key fingerprint returned by the backend, and a Test connection action. Adds an admin-gated testLangfuseConnectionFn that validates credentials against the Langfuse public projects endpoint.
Inject the langfuse section as a SchemaField instead of extending the pinned data-provider schema, which mixed zod v4 (app) with v3 (data-provider) and left the section unintrospected so it fell back to the generic renderer. Read saved values from parentValue (the base config slice) rather than getValue leaf paths, which only resolve edited/scope values, so a configured connection repopulates on reload with the secret redacted and its fingerprint shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on the LibreChat side shipping
langfuseinlibrechat-data-provider'sconfigSchema(danny-avila/LibreChat#14107).Until a data-provider version defining
langfuseis published and pinned here, a forward-compat shim (LANGFUSE_SHIM_FIELDinsrc/server/config.ts) injects the section into the schema tree; it self-disables once the pinned data-provider defineslangfuse, and can then be removed.Summary
Adds a per-tenant Langfuse connection section to the configuration page (Features tab): enable toggle, host, public key, write-only secret key, and a test-connection action. Values are saved through the existing
/api/admin/configfield API; the secret is encrypted at rest and reads return only a fingerprint, never the key.Change Type
Testing
Local CI gates green:
bunx eslint src/ --max-warnings 0,bunx tsc --noEmit,bun run test.Manual, against a local LibreChat backend on
:3080with the admin panel on:3010:v3:prefix) with asecretKeyFingerprint, reads redact the secret, and reload repopulates host/public-key with the secret masked and the fingerprint shown.Empty / Unconfigured
Filled (secret masked)
Successful Test Connection
Configured / Saved
Note: Toggle is to right of text in final form - screenshots were taken prior to that change:
Test Configuration:
LibreChat backend on
:3080(branchlangfuse-config-encryption), local MongoDB, admin user.Checklist