diff --git a/tests/local_testing/test_get_optional_params_embeddings.py b/tests/local_testing/test_get_optional_params_embeddings.py index 60b71c9b849..83fbfe73125 100644 --- a/tests/local_testing/test_get_optional_params_embeddings.py +++ b/tests/local_testing/test_get_optional_params_embeddings.py @@ -165,11 +165,8 @@ def test_openai_non_text_embedding_3_drop_params_global(): def test_azure_and_openai_compatible_drop_params(): """ Verify that dimensions parameter is correctly dropped on Azure and OpenAI compatible calls - when drop_params is True (either per-call or globally), and raises UnsupportedParamsError - otherwise. + when drop_params is True (either per-call or globally), while preserving it otherwise. """ - from litellm.exceptions import UnsupportedParamsError - prev_drop_params = litellm.drop_params # 1. Test Azure drop_params=True (per-call) @@ -239,3 +236,21 @@ def test_azure_and_openai_compatible_drop_params(): litellm.drop_params = prev_drop_params +@pytest.mark.parametrize("provider", ["nvidia_nim", "lm_studio", "fireworks_ai"]) +def test_dedicated_openai_compatible_providers_drop_dimensions(provider): + """Keep dedicated provider mappings reachable when dimensions is dropped.""" + prev_drop_params = litellm.drop_params + litellm.drop_params = False + try: + model, custom_llm_provider, _, _ = get_llm_provider( + model=f"{provider}/dummy-model" + ) + optional_params = get_optional_params_embeddings( + model=model, + dimensions=512, + custom_llm_provider=custom_llm_provider, + drop_params=True, + ) + assert "dimensions" not in optional_params + finally: + litellm.drop_params = prev_drop_params