litellm/tests/integration/cost_calculation/cases
mateo-berri 97015c5f18 fix(gemini): give each cached batch embedding its own modality tokens
The embedding cache split a batch's usage evenly across its inputs, so a cached text input came back with half of an image's tokens. The Gemini batch response now carries each input's own usage, attributed by modality, and the cache stores that when it is present

A usage detail entry with no tokenCount no longer drops Google's whole prompt count. The gemini-embeddings-002 cost case now expects Google's 7 tokens over the local count

(cherry picked from commit 0d6e14bce5)
2026-11-13 23:12:10 -08:00
..
__init__.py test(integration): move the openai cost tracking cases from cost_tracking_cases.json to CostTrackingTestCase literals (#45879) 2026-10-10 23:29:23 +00:00
anthropic.py test(cost): cover custom deployment aliases, off-peak pricing, bridge usage shapes and duplicate spend rows (#46708) 2026-10-15 10:44:51 -07:00
azure.py fix(cost): price bridged /v1/messages reasoning tokens from the chat completion, not the served Anthropic body (#46726) 2026-10-15 19:10:33 +00:00
batch_realtime.py test(integration): move the openai cost tracking cases from cost_tracking_cases.json to CostTrackingTestCase literals (#45879) 2026-10-10 23:29:23 +00:00
bedrock_chat_completions.py test(cost): add xai grok-4.7, Bedrock runtime chat completions and Bedrock Mantle cost cases (#46154) 2026-10-13 09:06:19 -07:00
bedrock_converse.py test(cost): cover custom deployment aliases, off-peak pricing, bridge usage shapes and duplicate spend rows (#46708) 2026-10-15 10:44:51 -07:00
bedrock_mantle.py test(cost): add xai grok-4.7, Bedrock runtime chat completions and Bedrock Mantle cost cases (#46154) 2026-10-13 09:06:19 -07:00
decisions.py fix(model-prices): add OpenAI dated snapshots, fix Perplexity decider pricing, absorb Together Tev1 cache price removal (#45842) 2026-10-12 12:34:30 -07:00
fireworks_ai.py test(cost): pin litellm's own prompt count over a tool-call history when the stream carries no usage (#46710) 2026-10-15 17:47:43 +00:00
gemini.py fix(gemini): give each cached batch embedding its own modality tokens 2026-11-13 23:12:10 -08:00
misc.py fix!: backport the second batch of rc/1.107.0 CI triage fixes from main (#47090) 2026-10-17 00:20:23 -07:00
openai.py fix(transcription): treat libsndfile's unknown frame count as no duration 2026-11-10 06:43:07 +00:00
together_ai.py test(integration): move the openai cost tracking cases from cost_tracking_cases.json to CostTrackingTestCase literals (#45879) 2026-10-10 23:29:23 +00:00
vertex_ai.py fix(cost): bill Gemini audio/image/video prompt tokens at the resolved input rate when no modality rate exists (#47373) 2026-10-27 19:57:37 -07:00
xai.py fix(cost): split xai spend rows across input and output instead of booking the total as output (#46320) 2026-10-14 17:02:00 -07:00