mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 09:32:24 +00:00
🥷 feat: Add showInMenu Option to Model Specs (#14034)
Add an optional `showInMenu` flag to model specs. When set to false, the spec is dropped from the model selector menu and from the client startup config (GET /api/config), but remains resolvable server-side by name — a request that sends `spec: "<name>"` still works, since server-side resolution uses the full, unfiltered list. Unlike `showIconInMenu` (which only hides the icon), this hides the whole entry. The flag is optional and defaults to listed, so existing specs are unaffected. Adds an `excludeHiddenModelSpecs()` helper (applied before `sanitizeModelSpecs`) plus unit tests.
This commit is contained in:
parent
927a5957cb
commit
ac759ef2f7
4 changed files with 79 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ const {
|
|||
resolveBuildInfo,
|
||||
resolveTitleTiming,
|
||||
sanitizeModelSpecs,
|
||||
excludeHiddenModelSpecs,
|
||||
isFileSnapshotEnabled,
|
||||
} = require('@librechat/api');
|
||||
const { EModelEndpoint, defaultSocialLogins } = require('librechat-data-provider');
|
||||
|
|
@ -265,7 +266,7 @@ router.get('/', async function (req, res) {
|
|||
endpoint: EModelEndpoint.agents,
|
||||
}),
|
||||
turnstile: appConfig?.turnstileConfig,
|
||||
modelSpecs: sanitizeModelSpecs(appConfig?.modelSpecs),
|
||||
modelSpecs: sanitizeModelSpecs(excludeHiddenModelSpecs(appConfig?.modelSpecs)),
|
||||
balance: balanceConfig,
|
||||
bundlerURL: process.env.SANDPACK_BUNDLER_URL,
|
||||
staticBundlerURL: process.env.SANDPACK_STATIC_BUNDLER_URL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue