Skip to content

feat: support model display aliases#431

Open
CodePirate7 wants to merge 1 commit intolukilabs:mainfrom
CodePirate7:feat/model-display-alias
Open

feat: support model display aliases#431
CodePirate7 wants to merge 1 commit intolukilabs:mainfrom
CodePirate7:feat/model-display-alias

Conversation

@CodePirate7
Copy link
Copy Markdown

Summary

  • Allow users to define display aliases for models using model_id:alias syntax in the model input field (e.g., claude-sonnet-4-6:My Sonnet, gpt-5.2:GPT5)
  • Aliases are purely cosmetic — the underlying model ID sent to the provider stays the same
  • Aliases are stored per-connection via modelAliases: Record<string, string> and shown in model selectors and settings

Motivation

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 — Add displayAlias to ModelDefinition; update getModelDisplayName() and getModelShortName() to prefer alias
  • packages/shared/src/config/llm-connections.ts — Add modelAliases field to LlmConnection
  • packages/shared/src/protocol/dto.ts — Add modelAliases to LlmConnectionSetup DTO
  • packages/server-core/src/handlers/rpc/llm-connections.ts — Persist modelAliases in setup handler
  • apps/electron/src/renderer/components/apisetup/ApiKeyInput.tsx — Parse model_id:alias format, pass aliases through submit
  • apps/electron/src/renderer/hooks/useOnboarding.ts — Thread modelAliases through save config pipeline
  • apps/electron/src/renderer/components/app-shell/input/FreeFormInput.tsx — Show aliases in model selector dropdown
  • apps/electron/src/renderer/pages/settings/AiSettingsPage.tsx — Show aliases in settings; serialize back to id:alias format when editing

Test plan

  • Configure a connection with models using alias syntax: model-id-1:Alias1, model-id-2:Alias2
  • Verify aliases appear in the model selector dropdown and settings page
  • Verify the actual model ID (not alias) is sent to the provider
  • Verify editing an existing connection preserves aliases in the input field
  • Verify connections without aliases continue to work unchanged

🤖 Generated with Claude Code

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>
@CodePirate7 CodePirate7 force-pushed the feat/model-display-alias branch from ef8e7bc to 2c35487 Compare March 16, 2026 13:11
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.

1 participant