Repository navigation
fix(cost_map): vertex gemini-3.5-flash-lite priority cache read is $0.054/M - #41137
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
….054/M Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThis PR corrects Gemini 3.5 Flash-Lite priority cached-input pricing for Vertex-backed model entries from $0.05/M to $0.054/M
Confidence Score: 5/5The PR appears safe to merge because the pricing correction is consistently applied and covered by the existing behavioral cost test Both runtime pricing-map copies update the relevant Vertex-backed entries, and the regression test verifies cached-token billing through the service-tier cost path without changing Gemini API behavior
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Corrects the priority cache-read rate for both Vertex-backed Gemini 3.5 Flash-Lite model keys |
| litellm/model_prices_and_context_window_backup.json | Keeps bundled fallback pricing synchronized with the root pricing map |
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Updates the Vertex priority-tier behavioral expectation while retaining distinct Gemini API pricing coverage |
Reviews (1): Last reviewed commit: "fix(cost_map): vertex gemini-3.5-flash-l..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Closing: main already carries this Vertex value and test expectation, and the direct Gemini row fix lives in rolling PR #41597 |
TLDR
Problem this solves:
test_gemini_35_flash_lite_service_tier_pricinghardcodes the stale $0.05/M and fails on the pricing sync PR chore(prices): sync Vertex AI prices: 14 models #40955How it solves it:
cache_read_input_token_cost_priorityto 5.4e-08 ongemini-3.5-flash-liteandvertex_ai/gemini-3.5-flash-litein both map copiesGEMINI_35_FLASH_LITE_TIER_RATES_BY_SURFACEto 5.4e-08gemini/gemini-3.5-flash-lite(Gemini API surface) is untouched at 5e-08User Flow
Before: a Vertex user on the priority tier with cached prompt tokens is underbilled
"model": "vertex_ai/gemini-3.5-flash-lite","service_tier": "priority"and a prompt that hits the context cachex-litellm-response-costbills cached input at $0.05/MAfter: the same request bills cached input at Google's published priority rate
x-litellm-response-costbills cached input at $0.054/MRelevant issues
Unblocks CI on #40955 (core-utils shard). The provider sync produced the correct 5.4e-08 there; the hardcoded test was stale
Affected release
Linear ticket
Pre-Submission checklist
uv run pytest tests/test_litellm/<your_test_file>.py -vScreenshots / Proof of Fix
Raw page evidence, fetched with curl and a cache-buster from https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing, Gemini 3 section, Priority tab, columns "Price (/1M tokens) <= 200K input tokens with Priority | > 200K input with Priority | <= 200K cached input tokens with Priority | > 200K cached input tokens with Priority":
$0.054 per 1M tokens = 5.4e-08 per token, matching the new map value. Input $0.54/M (5.4e-07) and output $4.50/M (4.5e-06) already matched
Before (7fd541e)
LITELLM_LOCAL_MODEL_COST_MAP=True uv run pytest tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py -k gemini_35_flash_litewith the chore(prices): sync Vertex AI prices: 14 models #40955 map:FAILED ...[vertex_ai-priority-5.4e-07-4.5e-06-5e-08] - assert 0.0004428 == 0.000442 ± 1.0e-12After (18d85c7)
8 passed, 290 deselectedType
🐛 Bug Fix
✅ Test
Caveats (if any)
Low
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/7553267d0ea54bf4925a6df40e7ca640
Open in Devin Desktop: https://app.devin.ai/desktop/session/7553267d0ea54bf4925a6df40e7ca640?variant=devin