diff --git a/litellm/llms/vertex_ai/ocr/deepseek_transformation.py b/litellm/llms/vertex_ai/ocr/deepseek_transformation.py index b57a87c3325..2603552152d 100644 --- a/litellm/llms/vertex_ai/ocr/deepseek_transformation.py +++ b/litellm/llms/vertex_ai/ocr/deepseek_transformation.py @@ -177,9 +177,8 @@ class VertexAIDeepSeekOCRConfig(BaseOCRConfig): content_item = {"type": "image_url", "image_url": document_url} # Build DeepSeek OCR request - provider_model: Final = model if model.startswith("deepseek-ai/") else f"deepseek-ai/{model}" data: Final = { - "model": provider_model, + "model": "deepseek-ai/" + model, "messages": [{"role": "user", "content": [content_item]}], } diff --git a/litellm/ocr/main.py b/litellm/ocr/main.py index f3ecb545f66..b918f013700 100644 --- a/litellm/ocr/main.py +++ b/litellm/ocr/main.py @@ -191,10 +191,6 @@ def _prepare_ocr_request( def _rust_ocr_supported(prepared_request: _PreparedOCRRequest) -> bool: if prepared_request.optional_params.get(OCR_REQUEST_FORMAT_PARAM) == "native": return False - if prepared_request.extra_headers is not None and any( - not isinstance(value, str) for value in prepared_request.extra_headers.values() - ): - return False return prepared_request.custom_llm_provider in _RUST_OCR_PROVIDERS diff --git a/tests/test_litellm/ocr/test_fixture_models.py b/tests/test_litellm/ocr/test_fixture_models.py index 34856a7bee1..24fb946e9bb 100644 --- a/tests/test_litellm/ocr/test_fixture_models.py +++ b/tests/test_litellm/ocr/test_fixture_models.py @@ -457,19 +457,6 @@ def test_unqualified_reducto_models_accept_explicit_provider( assert sdk_input.model == model -@pytest.mark.parametrize("model", ("deepseek-ocr-maas", "deepseek-ai/deepseek-ocr-maas")) -def test_vertex_deepseek_request_uses_single_provider_namespace(model: str) -> None: - request: Final = VertexAIDeepSeekOCRConfig().transform_ocr_request( # pyright: ignore[reportUnknownMemberType] - model=model, - document={"type": "image_url", "image_url": "data:image/png;base64,AA=="}, - optional_params={}, - headers={}, - ) - - data: Final = cast(dict[str, object], request.data) - assert data["model"] == "deepseek-ai/deepseek-ocr-maas" - - @pytest.mark.parametrize( "document", ( diff --git a/tests/test_litellm/ocr/test_sdk_parity.py b/tests/test_litellm/ocr/test_sdk_parity.py index edce2840a0a..a60e536a3ac 100644 --- a/tests/test_litellm/ocr/test_sdk_parity.py +++ b/tests/test_litellm/ocr/test_sdk_parity.py @@ -147,15 +147,6 @@ INVALID_OCR_CASES: Final = ( expected_message="Invalid `features` for Azure Document Intelligence", extra_kwargs=(("features", [1]),), ), - InvalidOcrCase( - name="invalid_header_value", - model="mistral/mistral-ocr-latest", - document={"type": "document_url", "document_url": "data:application/pdf;base64,AA=="}, - expected_exception_type="litellm.exceptions.InternalServerError", - expected_status_code=500, - expected_message="Header value must be str or bytes", - extra_kwargs=(("extra_headers", {"x-invalid": 1}),), - ), )