feat: add reranker models to ProviderCredential and improve FastEmbedReranker scoring

- Added `rerankerModels` property to the `ProviderCredential` interface in `litellm-api-config.ts` to support additional reranker configurations.
- Introduced a numerically stable sigmoid function in `FastEmbedReranker` for score normalization.
- Updated the scoring logic in `FastEmbedReranker` to use raw float scores from the encoder and normalize them using the new sigmoid function.
- Adjusted the result mapping to maintain original document order while applying normalization.
This commit is contained in:
catlog22
2026-01-03 22:20:06 +08:00
parent 74ad2d0463
commit 504ccfebbc
6 changed files with 1277 additions and 451 deletions

View File

@@ -1465,6 +1465,10 @@ const i18n = {
'apiSettings.noProvidersFound': 'No providers found',
'apiSettings.llmModels': 'LLM Models',
'apiSettings.embeddingModels': 'Embedding Models',
'apiSettings.rerankerModels': 'Reranker Models',
'apiSettings.addRerankerModel': 'Add Reranker Model',
'apiSettings.rerankerTopK': 'Default Top K',
'apiSettings.rerankerTopKHint': 'Number of top results to return (default: 10)',
'apiSettings.manageModels': 'Manage',
'apiSettings.addModel': 'Add Model',
'apiSettings.multiKeySettings': 'Multi-Key Settings',
@@ -3416,6 +3420,10 @@ const i18n = {
'apiSettings.noProvidersFound': '未找到供应商',
'apiSettings.llmModels': '大语言模型',
'apiSettings.embeddingModels': '向量模型',
'apiSettings.rerankerModels': '重排模型',
'apiSettings.addRerankerModel': '添加重排模型',
'apiSettings.rerankerTopK': '默认 Top K',
'apiSettings.rerankerTopKHint': '返回的最高排名结果数量默认10',
'apiSettings.manageModels': '管理',
'apiSettings.addModel': '添加模型',
'apiSettings.multiKeySettings': '多密钥设置',