litellm/tests/test_litellm/llms/ollama
Pawan Shahane 9bad2c35e5
fix(ollama): send PNG and JPEG images without requiring Pillow. (#41979)
* fix(ollama): send PNG and JPEG images without requiring Pillow

The ollama/ completion transport imported Pillow before it looked at the image, so every image request failed with a 500 on installs without Pillow. That includes the Docker image, where Pillow is only a CI dependency

Detect PNG and JPEG from their leading bytes and pass them through untouched. Pillow is now imported only when another format has to be re-encoded as JPEG, and that case still raises the same install hint

* fix(ollama): address Greptile findings on image conversion

Catch all exceptions on Pillow import, not just ImportError, so the helpful
install hint always appears. Break a line that exceeded 120 characters
2026-09-22 17:09:39 -07:00
..
test_ollama_chat_transformation.py fix(streaming): keep an explicit provider prompt_tokens=0 or completion_tokens=0 in streamed usage 2026-09-21 14:01:08 -07:00
test_ollama_completion_transformation.py fix(ollama): send PNG and JPEG images without requiring Pillow. (#41979) 2026-09-22 17:09:39 -07:00
test_ollama_embedding.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_ollama_model_info.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00