feat: support model display aliases#431
Open
CodePirate7 wants to merge 1 commit intolukilabs:mainfrom
Open
Conversation
Allow users to define display aliases for models using `model_id:alias` syntax in the model input field. Aliases are purely cosmetic — the underlying model ID sent to the provider remains unchanged. Changes: - Add `modelAliases` field to LlmConnection and LlmConnectionSetup - Add `displayAlias` field to ModelDefinition - Update getModelDisplayName/getModelShortName to prefer aliases - Parse `model_id:alias` format in ApiKeyInput - Show aliases in model selector (FreeFormInput) and settings page - Persist aliases through the setupLlmConnection IPC handler Co-Authored-By: Craft Agent <agents-noreply@craft.do>
ef8e7bc to
2c35487
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
model_id:aliassyntax in the model input field (e.g.,claude-sonnet-4-6:My Sonnet, gpt-5.2:GPT5)modelAliases: Record<string, string>and shown in model selectors and settingsMotivation
When many models are configured (especially with custom providers), they can be hard to distinguish. Display aliases let users assign memorable short names.
Changes
packages/shared/src/config/models.ts— AdddisplayAliastoModelDefinition; updategetModelDisplayName()andgetModelShortName()to prefer aliaspackages/shared/src/config/llm-connections.ts— AddmodelAliasesfield toLlmConnectionpackages/shared/src/protocol/dto.ts— AddmodelAliasestoLlmConnectionSetupDTOpackages/server-core/src/handlers/rpc/llm-connections.ts— PersistmodelAliasesin setup handlerapps/electron/src/renderer/components/apisetup/ApiKeyInput.tsx— Parsemodel_id:aliasformat, pass aliases through submitapps/electron/src/renderer/hooks/useOnboarding.ts— ThreadmodelAliasesthrough save config pipelineapps/electron/src/renderer/components/app-shell/input/FreeFormInput.tsx— Show aliases in model selector dropdownapps/electron/src/renderer/pages/settings/AiSettingsPage.tsx— Show aliases in settings; serialize back toid:aliasformat when editingTest plan
model-id-1:Alias1, model-id-2:Alias2🤖 Generated with Claude Code