mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix(cost-map): give the Gemini 4 Carbon rows the shared Gemini 3 search free tier (#50951)
Gemini API and Vertex both include 5,000 grounding requests a month shared across Gemini 3 and newer, so gemini/gemini-4-carbon, vertex_ai/gemini-4-carbon and vertex_ai/gemini-4-carbon-cyber-permissive now carry the same search_free_requests allowance as the Gemini 3.x grounding rows in both catalog copies. Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
d70855ca82
commit
20be20bf45
3 changed files with 27 additions and 0 deletions
|
|
@ -88269,6 +88269,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"rpm": 2000.0,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://aistudio.google.com/docs/pricing#gemini-4-carbon",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -88326,6 +88327,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -88382,6 +88384,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
|
|||
|
|
@ -88269,6 +88269,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"rpm": 2000.0,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://aistudio.google.com/docs/pricing#gemini-4-carbon",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -88326,6 +88327,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -88382,6 +88384,7 @@
|
|||
"prompt_cache_min_tokens": 4096.0,
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"search_context_cost_per_query": {"search_context_size_low":0.014,"search_context_size_medium":0.014,"search_context_size_high":0.014},
|
||||
"search_free_requests": {"count": 5000, "period": "month", "shared_group": "gemini-3"},
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
|
|||
|
|
@ -958,6 +958,27 @@ def test_gemini_4_argon_google_rows_carry_supports_continuation_in_both_cost_map
|
|||
assert _supports_continuation_rows(BACKUP_PRICES_PATH) == main_rows
|
||||
|
||||
|
||||
def test_gemini_4_carbon_rows_share_the_gemini_3_search_allowance_in_both_cost_map_copies() -> None:
|
||||
main_rows: Final = _search_free_requests_rows(PRICES_PATH)
|
||||
# 5,000 free grounding requests per month shared across Gemini 3 and newer:
|
||||
# https://ai.google.dev/gemini-api/docs/pricing#gemini-4-carbon and
|
||||
# https://cloud.google.com/vertex-ai/generative-ai/pricing (2026-11-10)
|
||||
carbon_rows: Final = {
|
||||
"gemini/gemini-4-carbon",
|
||||
"vertex_ai/gemini-4-carbon",
|
||||
"vertex_ai/gemini-4-carbon-cyber-permissive",
|
||||
}
|
||||
assert carbon_rows <= main_rows.keys(), sorted(main_rows)
|
||||
gemini_3_allowances: Final = {
|
||||
json.dumps(main_rows[key]["search_free_requests"], sort_keys=True)
|
||||
for key in ("gemini/gemini-3.8-flash", "vertex_ai/gemini-3.8-flash")
|
||||
}
|
||||
assert {
|
||||
json.dumps(main_rows[key]["search_free_requests"], sort_keys=True) for key in carbon_rows
|
||||
} == gemini_3_allowances
|
||||
assert _search_free_requests_rows(BACKUP_PRICES_PATH) == main_rows
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", (PRICES_PATH, BACKUP_PRICES_PATH), ids=("main", "backup"))
|
||||
def test_search_free_requests_rows_are_grounding_rows_with_one_allowance_per_group(path: Path) -> None:
|
||||
rows = _search_free_requests_rows(path)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue