Skip to content

Conversation

@aron-muon
Copy link
Contributor

@aron-muon aron-muon commented Dec 11, 2025

Summary

Adds a new hideBaseModels configuration option to model specs that allows hiding base/raw models from the model selector when model specs are defined for an endpoint.

Related Discussion: #10220 (reply in thread)
Documentation PR: LibreChat-AI/librechat.ai#465

Problem

When using modelSpecs to provide preconfigured models (e.g., a "gpt-5-codex" with specific settings like Responses API enabled), both the model spec AND the base model appear in the selector. This creates confusion:

  • Users see duplicate entries (the spec and the raw model)
  • No clear indication of which to choose
  • Adds unnecessary clutter when administrators want to present only curated model options

Solution

This PR implements the hideBaseModels option suggested in the discussion:

modelSpecs:
  hideBaseModels: true  # Hide base models when specs exist for an endpoint
  list:
    - name: "My Custom Model"
      # ...

When hideBaseModels: true is set, base models are hidden only for endpoints that have model specs defined. Endpoints without any specs will continue to show their models normally.

Change Type

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

Implementation

  • Added hideBaseModels boolean to the specsConfigSchema (defaults to false)
  • Exposed the value from startup config via the model selector context
  • Updated the endpoint item rendering logic to conditionally hide base models when hideBaseModels is true and the endpoint has specs defined
  • Added unit tests for schema validation
  • Added example configuration to librechat.example.yaml

Testing

Unit Tests

npx jest specs/models.spec.ts

Tests verify:

  • hideBaseModels defaults to false when not provided
  • hideBaseModels: true is accepted
  • hideBaseModels: false is accepted
  • Non-boolean values are rejected

Manual Testing

  1. Set hideBaseModels: false (or omit) → Base models show as normal alongside specs
  2. Set hideBaseModels: true with specs for an endpoint → Only specs are shown, base models hidden
  3. Set hideBaseModels: true for endpoint with NO specs → Base models still shown (no specs to replace them)

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
  • I have made pertinent documentation changes
  • 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

@aron-muon aron-muon changed the title Add hideBaseModels to ModelSelectorContext feat: optional hide "base" models flag, when models are defined in modelspec Dec 11, 2025
@aron-muon aron-muon changed the title feat: optional hide "base" models flag, when models are defined in modelspec feat: optional hide "base" models flag on modelspec Dec 11, 2025
@aron-muon aron-muon marked this pull request as ready for review December 11, 2025 16:44
@aron-muon aron-muon changed the title feat: optional hide "base" models flag on modelspec feat: add hide "base" models flag to model spec Dec 11, 2025
@aron-muon
Copy link
Contributor Author

@danny-avila this is ready for review!

@aron-muon
Copy link
Contributor Author

aron-muon commented Dec 17, 2025

With a config like this,

  "modelSpecs": {
    "enforce": false,
    "prioritize": true,
    "hideBaseModels": true,
    "addedEndpoints": [
      "anthropic",
      "google",
      "agents"
    ],
    "list": [
      {
        "name": "claude-opus-4-5",
        "label": "Claude Opus 4.5",
        "iconURL": "anthropic",
        "description": "Latest slow flagship model with Claude.",
        "group": "anthropic",
        "showIconInMenu": true,
        "showIconInHeader": true,
        "preset": {
          "endpoint": "anthropic",
          "model": "claude-opus-4-5",
          "web_search": true,
          "promptCache": true,
          "modelLabel": "Claude Opus 4.5"
        }
      },
      {
        "name": "claude-opus-4-1",
        "label": "Claude Opus 4.1",
        "iconURL": "anthropic",
        "description": "Slow, but accurate chat with Claude.",
        "group": "anthropic",
        "showIconInMenu": true,
        "showIconInHeader": true,
        "preset": {
          "endpoint": "anthropic",
          "model": "claude-opus-4-1",
          "web_search": true,
          "promptCache": true,
          "modelLabel": "Claude Opus 4.1"
        }
      },
      {
        "name": "claude-sonnet-4-5",
        "label": "Claude Sonnet 4.5",
        "iconURL": "anthropic",
        "description": "Medium-fast chat with Claude.",
        "group": "anthropic",
        "showIconInMenu": true,
        "showIconInHeader": true,
        "preset": {
          "endpoint": "anthropic",
          "model": "claude-sonnet-4-5",
          "web_search": true,
          "promptCache": true,
          "modelLabel": "Claude Sonnet 4.5"
        }
      },
      {
        "name": "claude-haiku-4-5",
        "label": "Claude Haiku 4.5",
        "iconURL": "anthropic",
        "description": "Fast chat with Claude.",
        "group": "anthropic",
        "showIconInMenu": true,
        "showIconInHeader": true,
        "preset": {
          "endpoint": "anthropic",
          "model": "claude-haiku-4-5",
          "web_search": true,
          "promptCache": true,
          "modelLabel": "Claude Haiku 4.5"
        }
      }
    ]
  },

Without this new feature, this is shown:
image

But with this new feature, this is shown instead - much less confusing, much more understandable.
image

@aron-muon aron-muon closed this Jan 12, 2026
@aron-muon aron-muon deleted the patch-1 branch January 12, 2026 13:56
@MaximilianoGutierrez
Copy link

MaximilianoGutierrez commented Jan 20, 2026

I used this configuration to hide the base models; however, they are still appearing despite hideBaseModels being set to true. The expectation was that only the models explicitly defined in the list section would be visible.

modelSpecs:
  enforce: true
  prioritize: true
  hideBaseModels: true
  #addedEndpoints: ["azureOpenAI", "google", "anthropic"]
  addedEndpoints:
    - azureOpenAI
    - google
    - anthropic
  list:
  #Anthropic models
    - name: "claude-sonnet-4-5"
      label: "claude-sonnet-4-5"
      default: true
      iconURL: "anthropic"
      description: "Prueba de descripcion"
      group: "anthropic"
      showIconInMenu: true
      showIconInHeader: true
      preset:
        endpoint: "anthropic"
        model: "claude-sonnet-4-5"
        #useResponsesApi: true
        promptPrefix: |
          You are claude-sonnet-4-5, a helpful AI assistant created by Anthropic.
          The current date is {{current_date}}.
          IMPORTANT: Calculate the day of the week from the date above. Do not assume or guess.
image

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.

2 participants