Skip to content

fix(model-prices): remove duplicate vertex_ai/gemini-embedding-2-preview entry#23599

Merged
Chesars merged 1 commit intoBerriAI:litellm_oss_staging_03_13_2026from
Chesars:fix/remove-duplicate-gemini-embedding-2-preview
Mar 14, 2026
Merged

fix(model-prices): remove duplicate vertex_ai/gemini-embedding-2-preview entry#23599
Chesars merged 1 commit intoBerriAI:litellm_oss_staging_03_13_2026from
Chesars:fix/remove-duplicate-gemini-embedding-2-preview

Conversation

@Chesars
Copy link
Collaborator

@Chesars Chesars commented Mar 14, 2026

Relevant issues

Fixes #23578

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details — N/A: JSON-only data change, no code logic affected
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

The key "vertex_ai/gemini-embedding-2-preview" appeared twice in model_prices_and_context_window.json with different pricing values. In JSON, duplicate keys cause the second entry to silently overwrite the first, which led to the more complete multimodal pricing (audio, image, video) being lost.

Removed: The second entry (text-only, sourced from Gemini API docs)
Kept: The first entry with complete multimodal pricing sourced from Vertex AI pricing

@vercel
Copy link

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Mar 14, 2026 3:37am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 14, 2026

Greptile Summary

This PR removes a duplicate "vertex_ai/gemini-embedding-2-preview" key from model_prices_and_context_window.json. Because JSON parsers silently let a later key overwrite an earlier one with the same name, the second entry was replacing the first, complete multimodal entry, causing audio/image/video pricing fields and the correct token rate to be lost at runtime.

Changes:

  • Removes the second "vertex_ai/gemini-embedding-2-preview" entry (text-only pricing sourced from Gemini API docs)
  • Keeps the first entry with complete multimodal pricing (input_cost_per_audio_per_second, input_cost_per_image, input_cost_per_video_per_second, supports_multimodal: true) sourced from Vertex AI pricing

Notes:

  • The sibling entry "gemini-embedding-2-preview" (provider vertex_ai-embedding-models, line 14545) is missing supports_multimodal: true compared to the explicit vertex_ai/ and gemini/ prefixed entries — this is a pre-existing inconsistency outside the scope of this PR but may be worth a follow-up
  • No code logic is changed; this is a data-only fix, making a dedicated test unnecessary

Confidence Score: 5/5

  • This PR is safe to merge — it is a targeted, data-only removal of a duplicate JSON key with no code logic changes.
  • The change is minimal (12 lines removed from a JSON file), clearly correct, and directly verified against the Vertex AI pricing source. No code paths are modified, no tests are required, and the kept entry is demonstrably more complete than the removed one.
  • No files require special attention.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Removes a duplicate vertex_ai/gemini-embedding-2-preview key that was silently overwriting the complete multimodal pricing entry. The kept entry (sourced from Vertex AI pricing, input_cost_per_token: 2e-07) includes audio/image/video unit costs and supports_multimodal: true; the removed entry lacked those pricing dimensions and referenced a lower token rate (1.5e-07) from the Gemini API docs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[JSON Parse Start] --> B["1st occurrence of vertex_ai/gemini-embedding-2-preview\nFull multimodal pricing: audio, image, video, token\nsupports_multimodal: true\nSource: Vertex AI pricing"]
    B --> C["2nd occurrence of vertex_ai/gemini-embedding-2-preview\nText-only token pricing\nSource: Gemini API docs"]
    C -- "Silent overwrite - JSON duplicate key behaviour" --> D["BEFORE: Only 2nd entry survives\nMultimodal pricing lost"]

    E["After PR fix: single vertex_ai/gemini-embedding-2-preview entry\nFull multimodal pricing preserved"] --> F["Correct pricing returned to callers"]
Loading

Last reviewed commit: 07d0129

@Chesars Chesars changed the base branch from main to litellm_oss_staging_03_13_2026 March 14, 2026 03:15
…iew entry

Fixes BerriAI#23578

The key "vertex_ai/gemini-embedding-2-preview" appeared twice in the JSON
with different pricing. In JSON, duplicate keys cause the second to silently
overwrite the first. Removed the second (text-only) entry and kept the first
which has complete multimodal pricing (audio, image, video) sourced from
Vertex AI pricing docs.
@Chesars Chesars force-pushed the fix/remove-duplicate-gemini-embedding-2-preview branch from 925e258 to 07d0129 Compare March 14, 2026 03:35
@Chesars Chesars merged commit f82f4a1 into BerriAI:litellm_oss_staging_03_13_2026 Mar 14, 2026
3 of 4 checks passed
@Chesars Chesars deleted the fix/remove-duplicate-gemini-embedding-2-preview branch March 14, 2026 03:37
ndgigliotti added a commit to ndgigliotti/litellm that referenced this pull request Mar 17, 2026
…I#23599

Main has two duplicate keys for vertex_ai/gemini-embedding-2-preview.
Our JSON round-trip collapsed them to the second (text-only) entry, but
PR BerriAI#23599 intentionally keeps the first (multimodal pricing) entry.
Restore the multimodal entry to avoid conflicts.
ndgigliotti added a commit to ndgigliotti/litellm that referenced this pull request Mar 17, 2026
…I#23599

Main has two duplicate keys for vertex_ai/gemini-embedding-2-preview.
Our JSON round-trip collapsed them to the second (text-only) entry, but
PR BerriAI#23599 intentionally keeps the first (multimodal pricing) entry.
Restore the multimodal entry to avoid conflicts.
ndgigliotti added a commit to ndgigliotti/litellm that referenced this pull request Mar 21, 2026
…I#23599

Main has two duplicate keys for vertex_ai/gemini-embedding-2-preview.
Our JSON round-trip collapsed them to the second (text-only) entry, but
PR BerriAI#23599 intentionally keeps the first (multimodal pricing) entry.
Restore the multimodal entry to avoid conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Duplicate key in model_prices_and_context_window.json

1 participant