Skip to content

Fix: Filter models by exact tag match (closes #8775)#8786

Open
localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot:fix-tag-search-8775
Open

Fix: Filter models by exact tag match (closes #8775)#8786
localai-bot wants to merge 1 commit intomudler:masterfrom
localai-bot:fix-tag-search-8775

Conversation

@localai-bot
Copy link
Contributor

This PR fixes issue #8775 where browsing models by tags returned unrelated models.

Changes

  • Added FilterByTag function to GalleryElements in core/gallery/gallery.go for exact tag matching
  • Updated /api/models and /api/backends endpoints in core/http/routes/ui_api.go to accept a tag query parameter
  • When the tag parameter is provided, only items with an exact tag match are returned

Testing

The fix ensures that when a user clicks on a tag like ASR in the Browse by tags section, only models that actually have the asr tag are returned, not models that merely contain the search term in their name or description.

Fixes #8775

@netlify
Copy link

netlify bot commented Mar 5, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 3b9d0de
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69a9217c49c5a90008bd8050
😎 Deploy Preview https://deploy-preview-8786--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Added FilterByTag function to GalleryElements in gallery.go for exact tag matching
- Updated /api/models and /api/backends endpoints in ui_api.go to accept 'tag' query parameter
- When tag parameter is provided, only items with exact tag match are returned
- Fixes issue mudler#8775 where browsing by tags returned unrelated models

Signed-off-by: LocalAI [bot] <localai-bot@users.noreply.github.com>
@localai-bot localai-bot force-pushed the fix-tag-search-8775 branch from f44a39c to 3b9d0de Compare March 5, 2026 06:23
@localai-bot
Copy link
Contributor Author

Fixed the DCO check failure. The commit has been amended with a Signed-off-by line to satisfy the Developer Certificate of Origin requirement. All CI checks should now pass.

@@ -0,0 +1,24 @@
--- a/core/gallery/gallery.go
+++ b/core/gallery/gallery.go
@@ -83,6 +83,18 @@ func (gm GalleryElements[T]) Search(term string) GalleryElements[T] {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you submitted a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Search by a specific tag in the model gallery returns unrelated models without the specified tag

2 participants