Skip to content

馃彙 feat: Stage YAML-Only Classifier Provider Settings - #16419

Draft
lia-by-librechat[bot] wants to merge 1 commit into
devfrom
lia/classification-config-sdk-ready
Draft

lia-by-librechat[bot] wants to merge 1 commit into
devfrom
lia/classification-config-sdk-ready

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

LibreChat's classifier configuration is currently bundled with a duplicate HTTP classifier in #16180. That leaves no independently reviewable application config for Jev and self-hosted Laya while the agents SDK classifier in LibreChat-AI/agents#561 is still draft. This PR introduces only a disabled-by-default YAML contract, not a model call, SDK dependency, adapter, probability policy, or consumer behavior.

classification validates the selected provider, an optional full HTTP(S) URL and model, wire-envelope options, deadline/retry settings, optional authentication and the name of an environment variable holding a bearer key. Self-hosted Laya can use an operator-supplied /v1/systemone URL without forcing a model or a key. Malformed endpoints fail config validation rather than throwing. AppService projects the validated configuration to a backend-only field and treats invalid blocks as disabled.

Outbound classifier hosts are YAML-only. Admin upserts, field patches, tombstones and stored overrides cannot change the resolved provider, including when an override arrives as a dotted property. The example documents why Jev and Laya confidence thresholds must be evaluated independently. There is no classifier request or change to tool discovery or memory processing in this PR.

How it works

librechat.yaml -> classificationSchema -> AppService.classification (backend-only)
admin write / stored override -> base-only guard -> original YAML host

Once the SDK contract is ready, #16180 can use this config, remove its duplicate transport and import the released SDK. #16181 must preserve its existing deferred-tool and memory fallbacks, and must not use probability thresholds with an unmeasured LLM decision.

Type of change

  • Feature (configuration preparation only)
  • Tests / tooling / CI

Testing

Tested environments/configuration: Node 24; Jest with the repository's existing local MongoDB test setup; unauthenticated Laya config and deliberately invalid URLs. No inference services were contacted.

Automated tests: packages/data-provider: specs/config-schemas.spec.ts and src/classification.spec.ts (168 passed); packages/data-schemas: src/app/service.spec.ts and src/app/resolution.spec.ts (71 passed); packages/api: admin config and AppService consumer tests (226 passed). npx tsc --noEmit passed independently in each changed TypeScript workspace. build:data-provider, build:data-schemas, and build:api passed. npm run static-checks -- --against origin/dev passed touched-file ESLint, Prettier, import sorting, and circular-dependency checks.

Local Lighthouse: npm run lighthouse was attempted; the production frontend build passed, but the disposable MongoMemoryServer stopped with an fassert error before any browser audit. No Chrome or Chromium executable is available on this host, so the Lighthouse median is unverified locally. This patch adds no database reads or browser payload; the CI Lighthouse lane is the independent gate. An inference comparison awaits SDK integration.

Screenshots / recordings

Not applicable. This PR changes backend configuration only and adds no browser-visible controls.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Review handoff for head 3ec5d6038fe91cd24ad9699e601594f1d0c8b81c: this PR stages only a validated, disabled-by-default classifier YAML contract with a Laya-ready endpoint and optional bearer-variable name; AppService exposes the validated config, and admin/stored overrides cannot replace the resolved host. No agents SDK dependency, classifier calls, thresholds, or changes to tool or memory fallbacks are included. Focused tests and all three changed-workspace typechecks passed for this head. A maintainer must trigger any AI review for this exact SHA.

@danny-avila
danny-avila marked this pull request as draft September 28, 2026 00:10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant