From 965185c1065e9d51c8ce135dc86ad1719ad89b1e Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 1 May 2026 14:16:57 -0700 Subject: [PATCH] fix(tests): host PDF fixture via jsDelivr with proper application/pdf MIME Raw github serves application/octet-stream which OpenAI/Gemini reject when LiteLLM fetches the URL client-side. jsDelivr serves the same file with content-type: application/pdf. Pin to a commit SHA so the asset is immutable and jsDelivr can cache it for a year. --- tests/llm_translation/base_llm_unit_tests.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.py index 61ae5945320..5e7b2f190ea 100644 --- a/tests/llm_translation/base_llm_unit_tests.py +++ b/tests/llm_translation/base_llm_unit_tests.py @@ -401,10 +401,17 @@ class BaseLLMChatTest(ABC): { "type": "file", "file": { - # GitHub-hosted fixture (small, deterministic, reliably - # fetchable from Anthropic's egress) instead of a Wikipedia - # URL that intermittently returns 400 "Unable to download". - "file_id": "https://raw.githubusercontent.com/BerriAI/litellm/main/tests/llm_translation/fixtures/dummy.pdf" + # jsDelivr serves the repo's tests/llm_translation/fixtures/dummy.pdf + # with `Content-Type: application/pdf`. Two reasons we don't + # use raw.githubusercontent.com or upload.wikimedia.org: + # - raw GitHub returns Content-Type: application/octet-stream, + # which OpenAI/Gemini reject when LiteLLM fetches the URL + # client-side and forwards the bytes. + # - Wikimedia URLs intermittently return 400 from Anthropic's + # server-side URL fetcher. + # The URL is pinned to a specific commit SHA so jsDelivr can + # serve it as immutable (cache-control: immutable, max-age=1y). + "file_id": "https://cdn.jsdelivr.net/gh/BerriAI/litellm@aab3ef8988b12d166b20356a81c53127480f1125/tests/llm_translation/fixtures/dummy.pdf" }, }, ]