-
-
Notifications
You must be signed in to change notification settings - Fork 432
[litellm] Display model IDs to match search string #1445
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
Conversation
Thank you for starting this Sanjiv. I was able to reproduce the bug you are reporting. I tried using the ![]() In addition to using the
None of these fixed the bug. Over my entire history of working on JAI, I've cumulatively spent at least 15 hours trying to get Autocomplete components working. The conclusion I've arrived at is that the MUI Autocomplete component just doesn't work. |
@srdas If you're up for it, I think the next best step is to re-implement the The MUI Docs: https://mui.com/material-ui/react-menu/#positioned-menu |
Sure, I'll work on this. |
@dlqqq Thanks for the ideas above, based on which I have updated this PR. Given that there are thousands of models available on LiteLLM, I changed the If the search string fails to find a match then the model-input.mov |
@srdas This is a clever way of reducing the performance impact incurred filtering & sorting a list of up to 1000 entries. However, requiring a user to click to show suggestions is less intuitive than showing suggestions automatically. Users will expect search bars to show suggestions automatically like Google/Bing. When building interfaces, it is generally good to "minimize surprise" and align our UIs with what an average user would expect. I recommend building an automatic suggestion UI first and optimizing for performance later. |
Thanks David for approving this.
* update prettier ignore file * fix prettier errors & warnings * fix mypy errors in jupyter_ai * skip ConfigManager and inline completion tests until fixed in v3 * add tests for secrets manager * fix mypy error * run minimum dependency tests on Python 3.10 * comment out precommit job to be added in future * updated test_magics.py --------- Co-authored-by: Sanjiv Das <srdas@scu.edu>
@dlqqq I have managed to get the autocomplete working -- see the video: Screen.Recording.2025-08-15.at.11.12.22.AM.movThere were some quirks in the way React Autocomplete works, i.e., it seems to add a few extra matches some of the time if you enter strings that are long. I fixed it to only start matching strings of 3 or more characters and this solved it barring a minimal edge case as shown below: Screen.Recording.2025-08-15.at.11.16.45.AM.movI have checked that it does not miss any matches. |
@srdas This does seem more reliable! Tested it locally. There a couple of bugs present:
Personally, I still feel like it is worth replacing the I will spend about an hour exploring whether a custom Autocomplete component is feasible. Autocompletion is useful for virtually any text input we have in our frontend, so it is worth investing some time to get this right. Will keep you posted. |
@srdas Hey Sanjiv, I've opened a new PR on your fork that adds a custom Autocomplete component. Hopefully you're able to verify that it is has fewer bugs than MUI's Autocomplete component. If it looks good to you, feel free to merge that PR into your branch and continue working here in PR 1445. There's just a couple of things I would like help with:
![]() |
Implement `SimpleAutocomplete` and use it in `ModelIdInput`
I've tested it, looks good, awesome stuff! Merged it into my fork and will work on the remaining suggestions before resubmitting the PR for merge into the litellm branch. TY for the super help here. |
@dlqqq This fixes the non-highlighting bug for an exact match: Added the 'x' button as well, see video: Screen.Recording.2025-08-15.at.4.05.28.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you Sanjiv! This is perfect. Merging.
Enjoy your weekend! 👋
Fixes #1428
Screen.Recording.2025-08-08.at.6.41.25.AM.mov