Commit fa15196
committed
fix: allow known_usecases to override backend heuristic checks for rerank
This fix addresses issue mudler#8658 where users setting known_usecases: [rerank]
in their model config still get 'This server does not support reranking'
error because GuessUsecases() overrides the explicit known_usecases setting.
The issue is that when a model config has known_usecases set (e.g., 'rerank'),
the HasUsecases() method first checks if KnownUsecases is set and matches,
but if it doesn't match exactly, it falls back to GuessUsecases() which
has hardcoded backend name checks (e.g., requires backend == 'rerankers').
This change makes GuessUsecases() return false early if KnownUsecases is
already set, allowing the explicit user configuration to take precedence
over the heuristic backend name checks.1 parent 00abf1b commit fa15196
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
612 | 617 | | |
613 | 618 | | |
614 | 619 | | |
| |||
0 commit comments