Skip to content

🥷 feat: Add showInMenu Option to Model Specs - #14034

Merged
danny-avila merged 1 commit into
LibreChat-AI:devfrom
alexkorep:feat/model-spec-hide-in-menu
Jun 30, 2026
Merged

danny-avila merged 1 commit into
LibreChat-AI:devfrom
alexkorep:feat/model-spec-hide-in-menu

Conversation

@alexkorep

Copy link
Copy Markdown
Contributor

Summary

Adds 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 it remains resolvable server-side by name — a request that sends spec: "<name>" still works, because server-side resolution uses the full, unfiltered list.

This is useful when an integration (or any external caller) needs to invoke a spec by name without exposing it to end users in the model picker.

Unlike showIconInMenu (which only hides the icon), showInMenu hides the whole entry. The flag is optional and defaults to listed, so existing specs are unaffected.

Implementation

  • New excludeHiddenModelSpecs() helper in packages/api/src/modelSpecs that filters out showInMenu: false specs. It is non-mutating, treats an omitted flag as listed (backwards compatible), and returns the config unchanged when there is no list.
  • Wired into GET /api/config (api/server/routes/config.js), applied before sanitizeModelSpecs.
  • New optional showInMenu field on TModelSpec and its zod schema (packages/data-provider/src/models.ts).

No new dependencies. A corresponding docs update for the librechat.ai repo can follow if this is accepted.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

Unit tests — added packages/api/src/modelSpecs/excludeHiddenModelSpecs.test.ts, covering:

  • drops specs marked showInMenu: false, keeps true and omitted-flag specs;
  • an omitted flag is treated as listed (backwards compatible);
  • the input config is not mutated;
  • configs with no list (including undefined/null) are returned unchanged.

Manual

  1. Add a spec with showInMenu: false to librechat.yaml, alongside at least one normal spec.
  2. Load the app — confirm the hidden spec does not appear in the model selector, and is absent from the modelSpecs.list of the GET /api/config response.
  3. Send a chat request with spec: "<hidden spec name>" — confirm it resolves and runs with that spec's preset/prompt.
  4. Confirm specs with showInMenu: true or no flag still appear as before.

Test Configuration:

  • librechat.yaml with at least one showInMenu: false spec and one normal spec.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

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.
Copilot AI review requested due to automatic review settings June 30, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new optional showInMenu flag to model specs so specific specs can be hidden from the client model selector and /api/config output while remaining resolvable server-side by name.

Changes:

  • Extend TModelSpec + zod schema with showInMenu?: boolean.
  • Add excludeHiddenModelSpecs() helper to filter showInMenu: false entries from advertised config.
  • Apply the filter in GET /api/config before sanitizeModelSpecs, and add unit tests for the helper.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/data-provider/src/models.ts Adds showInMenu to the model spec type and schema for config parsing/typing.
packages/api/src/modelSpecs/index.ts Introduces excludeHiddenModelSpecs() to filter hidden specs from client-advertised config.
packages/api/src/modelSpecs/excludeHiddenModelSpecs.test.ts Unit tests covering filter behavior, backwards compatibility, and non-mutation.
api/server/routes/config.js Wires excludeHiddenModelSpecs() into the /api/config payload before sanitization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/data-provider/src/models.ts
Comment thread api/server/routes/config.js
@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 8ec7686011

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila changed the base branch from main to dev June 30, 2026 23:32
@danny-avila danny-avila changed the title feat: add showInMenu option to model specs feat: add showInMenu option to model specs Jun 30, 2026
@danny-avila danny-avila changed the title feat: add showInMenu option to model specs 🥷 feat: Add showInMenu Option to Model Specs Jun 30, 2026
@danny-avila
danny-avila merged commit ac759ef into LibreChat-AI:dev Jun 30, 2026
30 checks passed
Gevtolev pushed a commit to Gevtolev/ChatChat that referenced this pull request Jul 2, 2026
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.

(cherry picked from commit ac759ef)
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jul 7, 2026
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.
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
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.
LogicalAbsurd pushed a commit to LogicalAbsurd/LibreChat that referenced this pull request Aug 27, 2026
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.
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.

3 participants