-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: prevent duplicate LM Studio models in provider configuration (#6954) #6956
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,8 +87,9 @@ export async function getLMStudioModels(baseUrl = "http://localhost:1234"): Prom | |
| })) as Array<LLMInstanceInfo> | ||
|
|
||
| for (const lmstudioModel of loadedModels) { | ||
| models[lmstudioModel.modelKey] = parseLMStudioModel(lmstudioModel) | ||
| modelsWithLoadedDetails.add(lmstudioModel.modelKey) | ||
| // Use path as the key to avoid duplicates when a model is both downloaded and loaded | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good fix! The comment clearly explains why we're using path as the key. This should resolve the duplicate model issue reported in #6954. |
||
| models[lmstudioModel.path] = parseLMStudioModel(lmstudioModel) | ||
| modelsWithLoadedDetails.add(lmstudioModel.path) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice consistency - updating the Set to track paths instead of modelKeys aligns with the new keying strategy. |
||
| } | ||
| } catch (error) { | ||
| if (error.code === "ECONNREFUSED") { | ||
|
|
||
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.
Test correctly updated to expect the path as the key instead of modelKey. Good to see the test coverage maintained.