Skip to content

Conversation

pnancarrow
Copy link

@pnancarrow pnancarrow commented Oct 7, 2025

Summary

This Adds optional group field to modelSpecs configuration, so that you can group modelSpecs together in the top level endpoints selector. The goal here was to be able to add descriptions to models without losing the organization of the selector menu.

image

Putting this in in responses to several conversations regarding descriptions to models without losing the UI organization of models.

#8444
https://discord.com/channels/1086345563026489514/1107675256782598195/threads/1387425830627442830
https://discord.com/channels/1086345563026489514/1349414162429775974/1349414162429775974

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Refer to the librechat.example.yaml for configuration options.

Test Configuration:

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
  • A pull request for updating the documentation has been submitted.

I recognize that this needs documentation updates, which I am happy to make if this looks good to get merged.

import { ModelSelectorProvider, useModelSelectorContext } from './ModelSelectorContext';
import { ModelSelectorChatProvider } from './ModelSelectorChatContext';
import { renderModelSpecs, renderEndpoints, renderSearchResults } from './components';
import { renderModelSpecs, renderEndpoints, renderSearchResults, renderCustomGroups } from './components';

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace ·renderModelSpecs,·renderEndpoints,·renderSearchResults,·renderCustomGroups· with ⏎··renderModelSpecs,⏎··renderEndpoints,⏎··renderSearchResults,⏎··renderCustomGroups,⏎
@@ -0,0 +1,66 @@
import { useMemo } from 'react';

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'useMemo' is defined but never used. Allowed unused vars must match /^_/u.
endpointRequiresUserKey,
} = useModelSelectorContext();
const { model: selectedModel, endpoint: selectedEndpoint } = selectedValues;
const { model: selectedModel, endpoint: selectedEndpoint, modelSpec: selectedSpec } = selectedValues;

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace ·model:·selectedModel,·endpoint:·selectedEndpoint,·modelSpec:·selectedSpec with ⏎····model:·selectedModel,⏎····endpoint:·selectedEndpoint,⏎····modelSpec:·selectedSpec,⏎·
className="flex w-full cursor-pointer items-center justify-between rounded-lg px-2 text-sm"
>
<div className="flex items-center gap-2">
<div className="flex w-full min-w-0 gap-2 px-1 py-1 items-center">

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace gap-2·px-1·py-1·items-center with items-center·gap-2·px-1·py-1
) : (isAgentsEndpoint(endpoint.value) || isAssistantsEndpoint(endpoint.value)) &&
endpoint.icon ? (
<div className="flex h-5 w-5 items-center justify-center overflow-hidden rounded-full">
) : (isAgentsEndpoint(endpoint.value) || isAssistantsEndpoint(endpoint.value)) && endpoint.icon ? (

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Insert ⏎·········
) : null}
<span>{modelName}</span>
<span className="truncate text-left">{modelName}</span>
{isGlobal && <EarthIcon className="ml-auto size-4 flex-shrink-0 self-center text-green-400" />}

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace <EarthIcon·className="ml-auto·size-4·flex-shrink-0·self-center·text-green-400"·/> with (⏎··········<EarthIcon·className="ml-auto·size-4·flex-shrink-0·self-center·text-green-400"·/>⏎········)
Comment on lines 180 to 187
}, [
filteredEndpoints,
endpointsConfig,
modelsQuery.data,
agents,
assistants,
azureAssistants,
]);

Check failure

Code scanning / ESLint

Ensure code is properly formatted, use insertion, deletion, or replacement to obtain desired formatting. Error

Replace ⏎····filteredEndpoints,⏎····endpointsConfig,⏎····modelsQuery.data,⏎····agents,⏎····assistants,⏎····azureAssistants,⏎·· with filteredEndpoints,·endpointsConfig,·modelsQuery.data,·agents,·assistants,·azureAssistants
@danny-avila
Copy link
Owner

Thanks for the PR. Please fix the ESLint issues.

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