litellm/tests/unit/llms/vertex_ai
kenneth-berri 113766d4b9
fix(gemini): return n images for image generations and edits when n > 1 (#52103)
* fix(gemini): serve image n with n single-image requests

Gemini image models reject a candidate count above one on the images routes,
so n > 1 failed with a provider 400 on AI Studio and Vertex AI. The image
generation and edit handlers now ask the provider config how many identical
requests to send, and merge the returned images and token usage into one
response. Vertex AI Gemini image edits also accept n now.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(gemini): cap image fan-out and bill served images when one request fails

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(images): price each Gemini fan-out request on its own usage and give the merged response its own hidden params

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Bill completed Gemini image calls when a generations fan-out request fails

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Expect the shared logging object in the image generation router call test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-16 14:50:13 -08:00
..
agent_engine fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
audio_transcription feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
batches feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
context_caching fix(openai): stop stripping cache_control from the caller's own messages and tools (#35602) 2026-10-31 00:29:10 -07:00
count_tokens ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
files refactor(vertex_ai): remove unreachable VertexAIFilesHandler.afile_content (#51966) 2026-11-15 13:54:05 -08:00
fine_tuning fix(managed_files): send provider file ids when creating a fine-tuning job from managed files (#46552) 2026-10-19 14:40:15 -07:00
fixtures test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
gemini fix(gemini): send reasoning_effort xhigh as thinkingLevel xhigh for gemini-4-hydrogen (#52060) 2026-11-16 10:51:21 -08:00
gemini_embeddings fix(vertex_ai): send document_ocr, audio_track_extraction and auto_truncate on Gemini embeddings (#51686) 2026-11-13 12:10:13 -08:00
image_edit fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
image_generation fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
interactions feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
multimodal_embeddings feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
rag_engine
realtime fix(realtime)!: send the Gemini Live setup at the first content so session.update settings apply (#39864) 2026-10-30 01:31:39 -07:00
rerank feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
text_to_speech fix(vertex_ai): honor vertex_location for the Cloud Text-to-Speech endpoint (#50255) 2026-11-06 00:03:17 -08:00
vertex_ai_partner_models fix(vertex_ai): resolve correct default max_tokens for versioned claude ids (#40376) 2026-11-14 17:36:51 -05:00
vertex_embeddings fix(vertex_ai): send extra_body fields as predict parameters for BGE embedding models (#51662) 2026-11-16 03:30:21 +08:00
vertex_gemma_models fix(streaming)!: send the include_usage chunk with an empty choices array (#47109) 2026-10-21 02:26:05 +00:00
videos feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
__init__.py
google_genai_proxy_test_config.yaml
test_bge_embedding.py
test_bge_response_transformation.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_common_utils.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_gemini_batch_embeddings.py feat(gemini): accept file content blocks with video_metadata on multimodal embeddings (#45305) 2026-10-08 13:20:03 -07:00
test_gemini_empty_properties.py
test_gemini_header_forwarding.py
test_http_status_201.py fix(streaming): keep merged think tags balanced and split SSE lines only on CR/LF (#48755) 2026-10-28 17:00:29 -07:00
test_request_labels.py feat(vertex_ai): label Vertex requests with the caller's key, team, org, and project (#50732) 2026-11-14 00:39:01 -05:00
test_vertex.py refactor(prompt_templates): move JSON schema helpers out of common_utils into json_schema_utils (#50241) 2026-11-05 17:25:53 -08:00
test_vertex_ai_batch_transformation.py test: move 81 legacy live tests in pass-through, spend, batches, audio, search, guardrails, image and ocr dirs offline (#45288) 2026-10-08 02:38:12 -07:00
test_vertex_ai_common_utils.py fix(vertex-ai): send union-root tool schemas as parametersJsonSchema (#51835) 2026-11-14 17:29:37 -05:00
test_vertex_ai_non_gemini.py fix(vertex): report an unreadable credentials file as a read failure (#40173) 2026-10-15 02:03:56 -07:00
test_vertex_ai_psc_endpoint_support.py
test_vertex_ai_search_vector_store_transformation.py test: migrate legacy unit dirs and unrun folders into tests/unit, tests/integration and tests/e2e (#45940) 2026-10-11 06:24:57 -07:00
test_vertex_gemini_gcs_uri_mime.py fix: preserve media across Responses and Gemini conversions (#48484) 2026-10-27 18:07:10 -07:00
test_vertex_global_url_support.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_vertex_image_generation.py
test_vertex_llm_base.py fix(vertex_ai): reuse one Google token across RAG Engine searches and cold bursts (#51239) 2026-11-14 03:12:09 -05:00
test_vertex_model_garden_openapi.py
test_vertex_passthrough_logging_handler.py