Skip to content

feat: support modelTypes whitelist for discovered LM Studio models#26

Open
scott1028 wants to merge 1 commit into
agustif:mainfrom
scott1028:main
Open

feat: support modelTypes whitelist for discovered LM Studio models#26
scott1028 wants to merge 1 commit into
agustif:mainfrom
scott1028:main

Conversation

@scott1028
Copy link
Copy Markdown

Summary

This PR adds support for filtering auto-discovered LM Studio models via provider.lmstudio.options.modelTypes.

Previously, the plugin always added every discovered model that was not already configured. With this change, users can optionally whitelist discovered models by type.

Supported values:

  • chat
  • embedding
  • unknown

The legacy options.model_types key is also preserved for backward compatibility.

Changes

  • add modelTypes / model_types parsing in config enhancement
  • filter discovered models before adding them to provider.lmstudio.models
  • validate configured model type values
  • add a validation hint for the common typo embedded -> embedding
  • document the new modelTypes option in the README
  • add test coverage for:
    • baseline behavior when modelTypes is not configured
    • filtering by chat
    • filtering by unknown
    • invalid modelTypes values
    • typo suggestion for embedded
    • backward compatibility for legacy model_types

Behavior Notes

  • modelTypes is currently inferred from the LM Studio model id, not from a dedicated type field returned by the API.
  • unknown means the discovered model ID does not match the plugin's current chat or embedding categorization rules.

Testing

  • npm run test:run
  • all tests passed (22/22)

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.

1 participant