Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): hide services with missing api key & models not in users pricing plan #681

Merged

Conversation

GenericMale
Copy link
Contributor

this hides all the services in the ModelCB which require an API key but don't have one configured.
also only the CodeGPT models which are in the users current PricingPlan are shown.

image

@carlrobertoh
Copy link
Owner

Thank you for contributing!

Could we please revert the models that were displayed for the CodeGPT provider, regardless of the user's pricing plan? The reason for this is that I would like to make sure which SOTA models are provided by the CodeGPT API as soon as the model dropdown is launched.

@GenericMale
Copy link
Contributor Author

done. the model list was rather confusing to me, that's why i tried to clean that up 😅

this is which models are shown based on the pricing plan:

  • Always: gpt-4o, gpt-4o-mini, claude-3.5-sonnet
  • Never: deepseek-coder-33b, wizardlm-2-8x22b
  • Anonymous: llama-3-8b
  • Free: codellama:chat, mixtral-8x22b
  • Individual: claude-3-opus, dbrx
  • Anonymous & Individual: llama-3.1-405b, deepseek-coder-v2
  • Free & Individual: llama-3-70b

and this doesn't match with the list i get from https://codegpt-api.carlrobert.ee/v1/users/details.

maybe you could clean that up a little bit and maybe have something like a Locked & Unlocked section in the ComboBox.
i fully understand that you always wanna show which models users can subscribe to.

oh also i think it might be problematic that the userDetails from your api isn't always loaded when the CB is filled. if a user is on the free or individual plan he might not get to select his preferred model.

@carlrobertoh
Copy link
Owner

Yeah, I need to go through this integration again. The goal was to offer new models as soon as they're launched without needing to upgrade the plugin itself.

I understand that the popup has grown annoyingly large, especially if you have downloaded dozens of Ollama models. However, the issue with this solution is that if you haven't checked the option to remember the keystore key/value mapping (or can't for whatever reason), then each time you boot up your IDE and open the model combobox, you will be prompted to enter your system password up to four times. I'm not sure how big of an issue this is.

Maybe instead of hiding the providers based on whether the API key is set, we could organize them in the menu better to save some space. For example, we could create multiple groups where each group represents a provider with an extensible submenu containing the models. What do you think?

@GenericMale
Copy link
Contributor Author

submenus sound good to be.
what also would help is implementing #553 by adding an enabled checkbox in all the provider setting screens and by default only have CodeGPT enabled (maybe not let users disable CodeGPT for promo reasons if you want 😉).

@carlrobertoh
Copy link
Owner

Yep, I'm aware of that ticket. I think once we lift them into separate groups, then this provider enabling/disabling will no longer be required.

Let's do it like this: leave the CodeGPT models as is and lift the rest into their own groups. The change should be relatively simple:

var openaiGroup = DefaultActionGroup.createPopupGroup(() -> "OpenAI");
openaiGroup.getTemplatePresentation().setIcon(Icons.OpenAI);
List.of(
        OpenAIChatCompletionModel.GPT_4_O,
        OpenAIChatCompletionModel.GPT_4_O_MINI,
        OpenAIChatCompletionModel.GPT_4_VISION_PREVIEW,
        OpenAIChatCompletionModel.GPT_4_0125_128k)
    .forEach(model -> openaiGroup.add(createOpenAIModelAction(model, presentation)));
actionGroup.add(openaiGroup);

If this becomes an issue, we can tackle it later.

@GenericMale
Copy link
Contributor Author

image

i would still prefer if we could somehow hide the services which aren't configured but it's an improvement 😅

@carlrobertoh
Copy link
Owner

I added a few minor changes:

combobox-menu

I think separating them by cloud vs local gives a clearer understanding of what is being offered and making it easier for users to navigate.

@GenericMale
Copy link
Contributor Author

oh yeah definitely, great change!

@carlrobertoh carlrobertoh merged commit 2d30472 into carlrobertoh:master Sep 11, 2024
2 checks passed
@GenericMale
Copy link
Contributor Author

oh btw one minor thing i tried to figure out but couldn't (because of my total lack of plugin dev experience):
right now the submenus need a click and most jetbrains menus already open on mouse over.
probably an easy thing to change...

@carlrobertoh
Copy link
Owner

Good question. I'm not sure if this is easily configurable via a single parameter. The com.intellij.openapi.ui.popup.ListPopup has an option to configure it via setShowSubmenuOnHover, but I'm unsure if this list is used by the combo box.

@GenericMale
Copy link
Contributor Author

ah yeah apparently it is ComboBoxAction.java#L80.

so i guess this should work in ModelComboBoxAction:

@Override
protected JBPopup createActionPopup(DefaultActionGroup group, @NotNull DataContext context, @Nullable Runnable disposeCallback) {
  ListPopup popup = (ListPopup) super.createActionPopup(group, context, disposeCallback);
  popup.setShowSubmenuOnHover(true);
  return popup;
}

carlrobertoh added a commit that referenced this pull request Sep 11, 2024
…rs into standalone subgroups (#681)

* feat: move models into sub-menus

* feat: improve chat model combobox menu UI

---------

Co-authored-by: GenericMale <genericmale00@gmail.com>
Co-authored-by: Carl-Robert Linnupuu <carlrobertoh@gmail.com>
carlrobertoh added a commit that referenced this pull request Sep 11, 2024
…rs into standalone subgroups (#681)

* feat: move models into sub-menus

* feat: improve chat model combobox menu UI

---------

Co-authored-by: GenericMale <genericmale00@gmail.com>
Co-authored-by: Carl-Robert Linnupuu <carlrobertoh@gmail.com>
carlrobertoh added a commit that referenced this pull request Sep 24, 2024
carlrobertoh added a commit that referenced this pull request Sep 24, 2024
carlrobertoh added a commit that referenced this pull request Sep 24, 2024
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.

2 participants