litellm/tests/image_gen_tests
Mateo Wang b7f28bd89f
feat(aiml): add openai/gpt-image-2 image model (#31323)
* feat(aiml): add openai/gpt-image-2 image model

Adds aiml/openai/gpt-image-2 to the cost map and teaches AimlImageGenerationConfig
to route OpenAI-style image models through the upstream OpenAI request schema
instead of the AI/ML flux schema. Without this, size, n, and response_format would
be remapped to image_size/num_images/output_format, which the gpt-image-2 endpoint
on api.aimlapi.com does not accept.

Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>

* chore(aiml): note gpt-image-2 flat-rate pricing basis; apply ruff format

Documents in the cost-map notes that output_cost_per_image is AI/ML's
published medium-quality rate, billed as a flat per-image price like the
other aiml image entries. Reformats the touched files under the repo's
ruff formatter (migrated from black in #31317).

* fix(aiml): drop /v1/images/edits from gpt-image-2 supported_endpoints

LiteLLM only implements an image generation transformer for AIML, so
listing /v1/images/edits overclaimed support. Align with every other
aiml image entry, which lists only /v1/images/generations.

* style(aiml): format transformation.py at line-length 88

The repo formats litellm/ with ruff at line-length 88 (Makefile/CI call
sites), while ruff.toml's global 120 only governs E501/import sorting.
Reformat the transformer to 88 so make format-check / CI lint pass, and
restore the test files to their original layout since tests/ is not part
of the auto-formatted tree.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
2026-06-25 16:41:43 -07:00
..
request_payloads test(image_gen): align Azure image gen fixture with body omitting model 2026-05-04 18:09:30 +05:30
base_image_generation_test.py fix(ci): remove unused is_expired variable (ruff F841) and handle ModelDeprecated in image gen test 2026-03-12 01:27:42 +00:00
conftest.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
ishaan_github.png [Feat] Add Image Edits Support to LiteLLM (#11020) 2025-05-21 14:03:09 -07:00
litellm_site.png [Feat] Add Image Edits Support to LiteLLM (#11020) 2025-05-21 14:03:09 -07:00
test_bedrock_image_gen_unit_tests.py Revert "chore(tests): migrate Bedrock CI to AWS account 941277531214 (#28728)" (#29326) 2026-05-30 11:26:24 -07:00
test_fal_ai_image_generation.py feat(fal_ai): add Nano Banana / Gemini 2.5 Flash Image generation support (#29798) 2026-06-06 11:16:44 -07:00
test_image.png [BETA] Add OpenAI /images/variations + Topaz API support (#7700) 2025-01-11 23:27:46 -08:00
test_image_edit.png test: cleanup tests 2026-03-30 16:20:01 -07:00
test_image_edits.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
test_image_generation.py feat(aiml): add openai/gpt-image-2 image model (#31323) 2026-06-25 16:41:43 -07:00
test_image_variation.py Fix: varaitions endpoint geting 401 2026-03-09 12:51:21 +05:30
test_xinference.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vertex_key.json test: update to new vertex ai keys 2026-03-28 20:19:05 -07:00