Skip to content

feat: add custom AI model support in selector#1349

Open
souvikDevloper wants to merge 1 commit intofoss42:mainfrom
souvikDevloper:resolve-issue-1315-add-custom-model-v2
Open

feat: add custom AI model support in selector#1349
souvikDevloper wants to merge 1 commit intofoss42:mainfrom
souvikDevloper:resolve-issue-1315-add-custom-model-v2

Conversation

@souvikDevloper
Copy link
Contributor

@souvikDevloper souvikDevloper commented Mar 16, 2026

PR Description

This PR adds support for creating and appending a custom AI model from the AI Model Selector dialog.

Implemented changes:

  • addNewModel now returns a Model
  • empty model ID is rejected
  • display name defaults to model ID when left blank
  • the Add button in the AI Model Selector is wired and appends the new model to the currently selected provider
  • added tests for validation, display-name fallback, and successful add flow

Demo: custom AI model add flow for #1315

API.Dash.2026-03-16.17-14-13.mp4

The demo shows:

  1. Opening the AI Model Selector
  2. Clicking the Add button
  3. Rejecting empty model ID
  4. Leaving display name blank so it falls back to the model ID
  5. Successfully adding a custom model, seeing it appear immediately in the selected provider’s model list, selecting it, and saving it back to the AI request screen

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: please replace this line with details on why tests have not been included

Added tests:

  • rejects empty model ID
  • uses model ID as display name when blank
  • successful add flow updates selector data/UI

Testing

  • dart analyze lib/screens/common_widgets/ai/dialog_add_ai_model.dart lib/screens/common_widgets/ai/ai_model_selector_dialog.dart test/screens/common_widgets/ai/ai_model_selector_dialog_test.dart
  • flutter test test/screens/common_widgets/ai/ai_model_selector_dialog_test.dart

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

@souvikDevloper
Copy link
Contributor Author

@animator as per your previous feedback i included the demo video please review the details and let me know your feedback!

@rafiamaqsood
Copy link

rafiamaqsood commented Mar 17, 2026

Hi @souvikDevloper , I’ve also been working on this issue and implemented a similar solution locally
I’ll review your PR and suggest improvements or help with testing if needed.

@souvikDevloper
Copy link
Contributor Author

Hi @souvikDevloper , I’ve also been working on this issue and implemented a similar solution locally I’ll review your PR and suggest improvements or help with testing if needed.

fine let first maintainers @animator give feedback then we can split the work

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.

Implement "Add Custom Model" functionality in AI Model Selector

2 participants