fix: add 1h cache pricing for vertex claude sonnet 4.6 - #26408
fix: add 1h cache pricing for vertex claude sonnet 4.6#26408biubiubiuboomboomboom wants to merge 1 commit into
Conversation
|
|
Low: Pricing data addition for vertex AI modelThis PR adds a Status: 0 open Posted by Veria AI · 2026-04-24T10:14:52.867Z |
|
Closing and reopening against because fork PRs to are blocked by repository policy. |
Greptile SummaryThis PR adds the missing Confidence Score: 5/5Safe to merge — changes are limited to a data file addition and a clean, non-networked regression test. Both changes are minimal and targeted: a JSON field addition with a value consistent across all equivalent provider entries, and a test that uses the local cost map with no external calls. No logic, routing, or auth code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/model_prices_and_context_window_backup.json | Adds cache_creation_input_token_cost_above_1hr: 6e-06 to both vertex_ai/claude-sonnet-4-6 and vertex_ai/claude-sonnet-4-6@default; value is consistent with the model's azure_ai and anthropic pricing counterparts. |
| tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py | Adds test_vertex_ai_claude_sonnet_4_6_1h_cache_writes_are_priced which uses the local model cost map (no real network calls) and correctly validates the new pricing field end-to-end. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["generic_cost_per_token(model='claude-sonnet-4-6', provider='vertex_ai')"] --> B["Resolve pricing key\n'vertex_ai/claude-sonnet-4-6'"]
B --> C{"cache_creation_input_token_cost_above_1hr\npresent?"}
C -- "Before PR: No" --> D["ephemeral_1h tokens\nbilled at 5m rate (3.75e-06)"]
C -- "After PR: Yes (6e-06)" --> E["ephemeral_1h tokens\nbilled at 1h rate (6e-06)"]
E --> F["prompt_cost = 1_000_000 × 6e-06 = 6.0 ✓"]
Reviews (1): Last reviewed commit: "fix: add vertex claude sonnet 4.6 1h cac..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
cache_creation_input_token_cost_above_1hrforvertex_ai/claude-sonnet-4-6vertex_ai/claude-sonnet-4-6@defaultgeneric_cost_per_tokenValidation
LITELLM_LOCAL_MODEL_COST_MAP=Truethatgeneric_cost_per_token(..., custom_llm_provider="vertex_ai")returns(6.0, 0.0)forephemeral_1h_input_tokens=1_000_000