feat: add groupIcon property to modelSpecs for custom group icons

Added the ability to define icons for custom model spec groups in the UI selector.

Changes:
- Added  property to TModelSpec type and schema in data-provider
- Created GroupIcon component to render URL or built-in endpoint icons
- Updated CustomGroup component to display group icons
- Added documentation and examples in librechat.example.yaml

Usage:

The groupIcon can be:
- A built-in endpoint key (e.g., "openAI", "anthropic", "groq")
- A URL to a custom icon image

Only the first spec in a group needs groupIcon - all specs share the same icon.
This commit is contained in:
odrec 2025-12-03 10:51:18 +01:00
parent 8bdc808074
commit 308347a7ad
4 changed files with 102 additions and 8 deletions

View file

@ -22,6 +22,12 @@ export type TModelSpec = {
* - If omitted, the spec appears as a standalone item at the top level
*/
group?: string;
/**
* Optional icon URL for the group this spec belongs to.
* Only needs to be set on one spec per group - the first one found with a groupIcon will be used.
* Can be a URL or an endpoint name to use its icon.
*/
groupIcon?: string | EModelEndpoint;
showIconInMenu?: boolean;
showIconInHeader?: boolean;
iconURL?: string | EModelEndpoint; // Allow using project-included icons
@ -40,6 +46,7 @@ export const tModelSpecSchema = z.object({
default: z.boolean().optional(),
description: z.string().optional(),
group: z.string().optional(),
groupIcon: z.union([z.string(), eModelEndpointSchema]).optional(),
showIconInMenu: z.boolean().optional(),
showIconInHeader: z.boolean().optional(),
iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),