test(vertex): pin gemini-embedding-2 cost tests to the local map

TestProcessEmbedContentResponseUsage hard-codes the per-image and
per-second rates this branch registers for gemini-embedding-2. litellm
loads model_cost from the network fetched main copy by default, and
main #41157 rewrote gemini-embedding-2 to per-token billing, so the
cost calls return 0.0 for image_count and video_length paths and
audio_tokens double-bills at the new per-token rate. Force the packaged
local map for the class so the assertions resolve against the same
rates they were written against.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-09-20 04:25:24 +00:00
parent 252c71c0b2
commit 3ed052ff70
No known key found for this signature in database

View file

@ -299,10 +299,17 @@ class TestProcessResponse:
)
@pytest.mark.usefixtures("local_model_cost_map")
class TestProcessEmbedContentResponseUsage:
"""Gemini Embedding 2 embedContent usageMetadata must drive spend.
Regression for multimodal calls recording prompt_tokens=0 / spend=$0.
The dollar-value assertions read the per-image and per-second rates this
branch registers for gemini-embedding-2. litellm defaults to the network
fetched main model_cost, which now bills the modalities per token, so the
cost calls return 0.0 or the wrong audio-token amount without the local
map pinned.
"""
MODEL = "gemini-embedding-2"