Skip to content

Sort models alphabetically in Chat view #5090

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

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Conversation

fbricon
Copy link
Contributor

@fbricon fbricon commented Apr 10, 2025

Description

I have a *ton of models installed on Ollama, and selecting one of them in the Chat view is a PITA, because they're not sorted alphabetically. This PR fixes that, while maintaining the existing sort where models without an API key are listed at the end.
Also applied to the Models section.

Checklist

  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screenshots

Before:                                                 After:
Screenshot 2025-04-10 at 10 19 08      Screenshot 2025-04-10 at 10 29 41

In Models section:
Screenshot 2025-04-10 at 10 53 54

Testing instructions

Just have several models to choose from, they should be listed alphabetically in the Chat view

@fbricon fbricon requested a review from a team as a code owner April 10, 2025 08:41
@fbricon fbricon requested review from RomneyDa and removed request for a team April 10, 2025 08:41
Copy link

netlify bot commented Apr 10, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 41269e0
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67f788823b602b00087f1d61

@RomneyDa
Copy link
Collaborator

What if we sorted by LRU first and alphabetical second?

@fbricon
Copy link
Contributor Author

fbricon commented Apr 10, 2025

Are we keeping track of each model usage?

@Patrick-Erichsen
Copy link
Collaborator

Patrick-Erichsen commented Apr 11, 2025

What if we sorted by LRU first and alphabetical second?

This sounds nice in theory but in practice I feel it might be a bit too clever. I think alphabetical is a good lazy solution that would be an improvement over current state imo, but if we want to take it further, I would probably push for something like "drag to reorder" or pinning that isn't as dynamic as LRU.

@fbricon
Copy link
Contributor Author

fbricon commented Apr 11, 2025

I think alphabetical is a good lazy solution that would be an improvement over current state imo, but if we want to take it further, I would probably push for something like "drag to reorder" or pinning that isn't as dynamic as LRU.

that seems a bit over-engineered to my taste. I'd rather stick to "lazy" (i'd say low-hanging fruit)

@RomneyDa
Copy link
Collaborator

quick win for now sounds good!

@RomneyDa RomneyDa merged commit e10e326 into continuedev:main Apr 25, 2025
31 checks passed
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.

3 participants