Skip to content

feat: Add /model command for temporary model switching#336

Merged
edenreich merged 11 commits intomainfrom
feat/model-shortcut-command
Dec 12, 2025
Merged

feat: Add /model command for temporary model switching#336
edenreich merged 11 commits intomainfrom
feat/model-shortcut-command

Conversation

@edenreich
Copy link
Contributor

@edenreich edenreich commented Dec 11, 2025

Adds a new /model <model-name> <prompt> shortcut that allows executing a prompt with a specific model while maintaining the current conversation context. The model automatically switches back to the original after the prompt completes. Includes autocomplete support for model names with pricing display.

Key Changes

New Features

  • /model command: Execute a prompt with a specific model temporarily
  • Automatic model restoration: Original model is restored after the prompt completes
  • Model pricing display: Shows pricing information in autocomplete and model selector
  • Streaming model indicator: Shows which model is being used during streaming responses

Implementation Details

  • New internal/shortcuts/model.go with the /model shortcut implementation
  • Enhanced autocomplete to show model pricing information
  • Updated model selection view to display pricing
  • Added comprehensive tests for the new functionality
  • Integrated with existing pricing service for accurate cost display

Usage Examples

/model openai/gpt-4o-mini "What's in this image? [Image # 1]"
/model deepseek/deepseek-chat "Can you fix the frontend?"

Technical Improvements

  • Added pricing service tests (internal/services/pricing_service_test.go)
  • Enhanced UI components to show model context during streaming
  • Improved model switching logic to preserve conversation state
  • Added model name validation and error handling

This feature enables users to quickly experiment with different models for specific prompts without permanently changing their model selection, making it easier to compare model outputs and optimize for cost/performance trade-offs.

@edenreich
Copy link
Contributor Author

edenreich commented Dec 11, 2025

TODO - I think the shortcut "/switch [model]" it's a bit misleading I should remove the argument from there since it's only get opened in the model selection view.

I should probably consider using the arrow down key binding to let the user actually select the model instead of typing a shortcut - same goes for theme etc..

Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
This helps for troubleshooting the image that was pasted from the clipboard to see what will actually get sent, and then we simply remove it ensure filesystem not getting bloated.

Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
…not only the first - user intent

Making it configurable.

Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich edenreich merged commit 09baf39 into main Dec 12, 2025
5 checks passed
@edenreich edenreich deleted the feat/model-shortcut-command branch December 12, 2025 16:43
ig-semantic-release-bot bot pushed a commit that referenced this pull request Dec 12, 2025
## [0.89.0](v0.88.0...v0.89.0) (2025-12-12)

### 🚀 Features

* Add /model command for temporary model switching ([#336](#336)) ([09baf39](09baf39))
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.89.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments