litellm/tests/unit/llms/hosted_vllm
SanthoshSachin 28a71ab46c
fix(images): send image_edit markup as a multipart file part (#53815)
* fix(images): send image_edit markup as a multipart file part

* fix(images): unpack FileTypes tuples for multipart uploads and add Final annotations

* fix(images): avoid Unknown tuple narrowing in _build_upload_part for basedpyright

* fix(images): send tuple mask uploads through the shared upload part helper

Mask uploads now go through _add_image_to_files like image and markup, so a (filename, content[, content_type[, headers]]) mask tuple is sent as that file instead of nested as the part's content

* fix(images): reject JSON image references for mask and markup, send the first markup of a list, and let Azure drop markup

A mask or markup given as a JSON image reference now gets a 400 from LiteLLM before any provider call, instead of a 500 from the multipart send

A markup list sends its first file, the same as mask

Azure answers Unknown parameter for markup, so Azure no longer lists it, and drop_params drops it

The FLUX 2 edit config now returns list[str] like its parent

* fix(hosted_vllm): exclude unsupported markup param from image_edit config

* fix(images): stop listing markup for Azure AI FLUX Kontext and name the resolved provider on image edit errors

The JSON image reference 400 used litellm_params built before the provider was resolved, so azure, azure_ai and litellm_proxy errors said openai. The hosted vLLM markup test now goes through litellm.image_edit, and the JSON reference test covers a list holding a reference

* fix(images): let the markup type hint take a list like image

* fix(images): read pathlib.Path image edit uploads, send base file names and reject string mask or markup

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 04:14:57 +00:00
..
chat fix(hosted_vllm,azure): leave the caller's messages untouched when building the chat request (#51841) 2026-11-24 00:22:33 +00:00
embedding test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
image_edit fix(images): send image_edit markup as a multipart file part (#53815) 2026-11-25 04:14:57 +00:00
responses fix(llms): move later developer messages for models declared system-first (#48897) 2026-10-29 04:12:13 -07:00
videos test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
test_hosted_vllm_rerank_transformation.py fix(rerank): preserve token usage in spend logs (#49308) 2026-10-30 13:46:27 -07:00