mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-11 03:54:23 +01:00
🪧 feat: Add Custom Group Icon Support for Model Specs (#10782)
Some checks failed
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Publish `librechat-data-provider` to NPM / build (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
Some checks failed
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
Publish `librechat-data-provider` to NPM / build (push) Has been cancelled
Publish `librechat-data-provider` to NPM / publish-npm (push) Has been cancelled
* 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.
* fix: address Copilot review comments for GroupIcon component
- Changed URL detection from includes('http') to checking if iconURL exists in icons map (more robust approach)
- Removed redundant !iconURL check since iconURL is always a string from props
---------
Co-authored-by: odrec <odrec@users.noreply.github.com>
Co-authored-by: Odrec <odrec@Odrecs-MacBook-Pro.local>
This commit is contained in:
parent
b9792160e2
commit
8a4c2931f6
4 changed files with 102 additions and 8 deletions
|
|
@ -371,6 +371,10 @@ endpoints:
|
|||
# - If 'group' matches an endpoint name (e.g., "openAI", "groq"), the spec appears nested under that endpoint
|
||||
# - If 'group' is a custom name (doesn't match any endpoint), it creates a separate collapsible section
|
||||
# - If 'group' is omitted, the spec appears as a standalone item at the top level
|
||||
#
|
||||
# The 'groupIcon' field sets an icon for custom groups:
|
||||
# - Only needs to be set on one spec per group (first one is used)
|
||||
# - Can be a URL or a built-in endpoint key (e.g., "openAI", "anthropic", "groq")
|
||||
# modelSpecs:
|
||||
# list:
|
||||
# # Example 1: Nested under an endpoint (grouped with openAI endpoint)
|
||||
|
|
@ -391,11 +395,12 @@ endpoints:
|
|||
# endpoint: "groq"
|
||||
# model: "llama3-70b-8192"
|
||||
#
|
||||
# # Example 3: Custom group (creates a separate collapsible section)
|
||||
# # Example 3: Custom group with icon (creates a separate collapsible section)
|
||||
# - name: "coding-assistant"
|
||||
# label: "Coding Assistant"
|
||||
# description: "Specialized for coding tasks"
|
||||
# group: "my-assistants" # Custom string - doesn't match any endpoint, so creates its own group
|
||||
# groupIcon: "https://example.com/icons/assistants.png" # Icon URL for the group
|
||||
# preset:
|
||||
# endpoint: "openAI"
|
||||
# model: "gpt-4o"
|
||||
|
|
@ -406,12 +411,22 @@ endpoints:
|
|||
# label: "Writing Assistant"
|
||||
# description: "Specialized for creative writing"
|
||||
# group: "my-assistants" # Same custom group name - both specs appear in same section
|
||||
# # No need to set groupIcon again - the first spec's icon is used
|
||||
# preset:
|
||||
# endpoint: "anthropic"
|
||||
# model: "claude-sonnet-4"
|
||||
# instructions: "You are a creative writing expert..."
|
||||
#
|
||||
# # Example 4: Standalone (no group - appears at top level)
|
||||
# # Example 4: Custom group using built-in icon key
|
||||
# - name: "fast-models"
|
||||
# label: "Fast Response Model"
|
||||
# group: "Fast Models"
|
||||
# groupIcon: "groq" # Uses the built-in Groq icon
|
||||
# preset:
|
||||
# endpoint: "groq"
|
||||
# model: "llama3-8b-8192"
|
||||
#
|
||||
# # Example 5: Standalone (no group - appears at top level)
|
||||
# - name: "general-assistant"
|
||||
# label: "General Assistant"
|
||||
# description: "General purpose assistant"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue