mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Fix HostedVLLMRerankConfig will not be used (#16352)
* Fix HostedVLLMRerankConfig will not be used Signed-off-by: Jun-Fei Cherng <jfcherng@realtek.com> * Fix no usage statistics in rerank with hosted_vllm Signed-off-by: Jun-Fei Cherng <jfcherng@realtek.com> * Revise typo in comment Signed-off-by: Jun-Fei Cherng <jfcherng@realtek.com> --------- Signed-off-by: Jun-Fei Cherng <jfcherng@realtek.com>
This commit is contained in:
parent
0a527bd1d8
commit
2ab34f9a52
4 changed files with 14 additions and 1 deletions
|
|
@ -1098,6 +1098,7 @@ from .llms.azure_ai.rerank.transformation import AzureAIRerankConfig
|
|||
from .llms.infinity.rerank.transformation import InfinityRerankConfig
|
||||
from .llms.jina_ai.rerank.transformation import JinaAIRerankConfig
|
||||
from .llms.deepinfra.rerank.transformation import DeepinfraRerankConfig
|
||||
from .llms.hosted_vllm.rerank.transformation import HostedVLLMRerankConfig
|
||||
from .llms.nvidia_nim.rerank.transformation import NvidiaNimRerankConfig
|
||||
from .llms.vertex_ai.rerank.transformation import VertexAIRerankConfig
|
||||
from .llms.clarifai.chat.transformation import ClarifaiConfig
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class HostedVLLMRerankConfig(BaseRerankConfig):
|
|||
f"Error parsing response: {raw_response.text}, status_code={raw_response.status_code}"
|
||||
)
|
||||
|
||||
return RerankResponse(**raw_response_json)
|
||||
return self._transform_response(raw_response_json)
|
||||
|
||||
def get_error_class(
|
||||
self, error_message: str, status_code: int, headers: Union[dict, httpx.Headers]
|
||||
|
|
|
|||
|
|
@ -7294,6 +7294,8 @@ class ProviderConfigManager:
|
|||
return litellm.InfinityRerankConfig()
|
||||
elif litellm.LlmProviders.JINA_AI == provider:
|
||||
return litellm.JinaAIRerankConfig()
|
||||
elif litellm.LlmProviders.HOSTED_VLLM == provider:
|
||||
return litellm.HostedVLLMRerankConfig()
|
||||
elif litellm.LlmProviders.HUGGINGFACE == provider:
|
||||
return litellm.HuggingFaceRerankConfig()
|
||||
elif litellm.LlmProviders.DEEPINFRA == provider:
|
||||
|
|
|
|||
|
|
@ -845,6 +845,16 @@ def test_check_provider_match():
|
|||
model_info = {"litellm_provider": "bedrock"}
|
||||
assert litellm.utils._check_provider_match(model_info, "openai") is False
|
||||
|
||||
def test_get_provider_rerank_config():
|
||||
"""
|
||||
Test the get_provider_rerank_config function for various providers
|
||||
"""
|
||||
from litellm import HostedVLLMRerankConfig
|
||||
from litellm.utils import LlmProviders, ProviderConfigManager
|
||||
|
||||
# Test for hosted_vllm provider
|
||||
config = ProviderConfigManager.get_provider_rerank_config("my_model", LlmProviders.HOSTED_VLLM, 'http://localhost', [])
|
||||
assert isinstance(config, HostedVLLMRerankConfig)
|
||||
|
||||
# Models that should be skipped during testing
|
||||
OLD_PROVIDERS = ["aleph_alpha", "palm"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue