Skip to content

fix: allow reranking models configured with known_usecases#8681

Merged
mudler merged 1 commit intomudler:masterfrom
localai-bot:rerank-fix
Mar 2, 2026
Merged

fix: allow reranking models configured with known_usecases#8681
mudler merged 1 commit intomudler:masterfrom
localai-bot:rerank-fix

Conversation

@localai-bot
Copy link
Copy Markdown
Contributor

Description

When a model is configured with known_usecases: [rerank] in the YAML config, the /v1/rerank endpoint was not being matched because:

  1. The GuessUsecases function only checked for backend == rerankers
  2. The syncKnownUsecasesFromString() was not being called when loading configs via yaml.Unmarshal

This results in the error: rpc error: code = Unimplemented desc = This server does not support reranking

Fix

  1. model_config.go: Updates GuessUsecases to also check if Reranking is explicitly set to true in the model config
  2. model_config_loader.go: Adds syncKnownUsecasesFromString() calls after yaml.Unmarshal to ensure known_usecases are properly parsed

Fixes #8658

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 28, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit c5c83dd
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69a5a995ab1500000855ca3e
😎 Deploy Preview https://deploy-preview-8681--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.

@localai-bot
Copy link
Copy Markdown
Contributor Author

I've fixed the DCO sign-off issue. The commit is now properly signed off by the author using their noreply email address. The DCO check should now pass. Returning to IN_REVIEW.

When a model is configured with 'known_usecases: [rerank]' in the YAML
config, the reranking endpoint was not being matched because:
1. The GuessUsecases function only checked for backend == 'rerankers'
2. The syncKnownUsecasesFromString() was not being called when loading
   configs via yaml.Unmarshal in readModelConfigsFromFile

This fix:
1. Updates GuessUsecases to also check if Reranking is explicitly set to
   true in the model config (in addition to checking backend type)
2. Adds syncKnownUsecasesFromString() calls after yaml.Unmarshal in
   readModelConfigsFromFile to ensure known_usecases are properly parsed

Fixes mudler#8658

Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
@localai-bot
Copy link
Copy Markdown
Contributor Author

Pushed rebase on upstream/master. CI has been re-triggered. Returning to IN_REVIEW.

@localai-bot
Copy link
Copy Markdown
Contributor Author

Rebased on upstream/master. CI is now up-to-date. Returning to IN_REVIEW.

@mudler mudler merged commit 6d18228 into mudler:master Mar 2, 2026
32 of 33 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in LocalAI Agent team Mar 2, 2026
localai-bot added a commit to localai-bot/LocalAI that referenced this pull request Mar 6, 2026
When a model is configured with 'known_usecases: [rerank]' in the YAML
config, the reranking endpoint was not being matched because:
1. The GuessUsecases function only checked for backend == 'rerankers'
2. The syncKnownUsecasesFromString() was not being called when loading
   configs via yaml.Unmarshal in readModelConfigsFromFile

This fix:
1. Updates GuessUsecases to also check if Reranking is explicitly set to
   true in the model config (in addition to checking backend type)
2. Adds syncKnownUsecasesFromString() calls after yaml.Unmarshal in
   readModelConfigsFromFile to ensure known_usecases are properly parsed

Fixes mudler#8658

Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
Co-authored-by: localai-bot <localai-bot@users.noreply.github.com>
localai-bot added a commit to localai-bot/LocalAI that referenced this pull request Mar 6, 2026
When a model is configured with 'known_usecases: [rerank]' in the YAML
config, the reranking endpoint was not being matched because:
1. The GuessUsecases function only checked for backend == 'rerankers'
2. The syncKnownUsecasesFromString() was not being called when loading
   configs via yaml.Unmarshal in readModelConfigsFromFile

This fix:
1. Updates GuessUsecases to also check if Reranking is explicitly set to
   true in the model config (in addition to checking backend type)
2. Adds syncKnownUsecasesFromString() calls after yaml.Unmarshal in
   readModelConfigsFromFile to ensure known_usecases are properly parsed

Fixes mudler#8658

Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
Co-authored-by: localai-bot <localai-bot@users.noreply.github.com>
@mudler mudler added the bug Something isn't working label Mar 14, 2026
localai-bot added a commit to localai-bot/LocalAI that referenced this pull request Mar 25, 2026
When a model is configured with 'known_usecases: [rerank]' in the YAML
config, the reranking endpoint was not being matched because:
1. The GuessUsecases function only checked for backend == 'rerankers'
2. The syncKnownUsecasesFromString() was not being called when loading
   configs via yaml.Unmarshal in readModelConfigsFromFile

This fix:
1. Updates GuessUsecases to also check if Reranking is explicitly set to
   true in the model config (in addition to checking backend type)
2. Adds syncKnownUsecasesFromString() calls after yaml.Unmarshal in
   readModelConfigsFromFile to ensure known_usecases are properly parsed

Fixes mudler#8658

Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
Co-authored-by: localai-bot <localai-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

This server does not support reranking

2 participants