mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(registry): add vertex veo 3.1 resolution tier pricing per vertex pricing page
This commit is contained in:
parent
9a1aebc146
commit
06d4521fc0
3 changed files with 51 additions and 4 deletions
|
|
@ -43509,7 +43509,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.4,
|
||||
"source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",
|
||||
"output_cost_per_second_4k": 0.6,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
],
|
||||
|
|
@ -43523,6 +43524,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.1,
|
||||
"output_cost_per_second_1080p": 0.12,
|
||||
"output_cost_per_second_4k": 0.3,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
|
|
@ -43538,7 +43541,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.4,
|
||||
"source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",
|
||||
"output_cost_per_second_4k": 0.6,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
],
|
||||
|
|
@ -43553,6 +43557,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.1,
|
||||
"output_cost_per_second_1080p": 0.12,
|
||||
"output_cost_per_second_4k": 0.3,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
|
|
|
|||
|
|
@ -43509,7 +43509,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.4,
|
||||
"source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",
|
||||
"output_cost_per_second_4k": 0.6,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
],
|
||||
|
|
@ -43523,6 +43524,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.1,
|
||||
"output_cost_per_second_1080p": 0.12,
|
||||
"output_cost_per_second_4k": 0.3,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
|
|
@ -43538,7 +43541,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.4,
|
||||
"source": "https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/veo/3-1-generate",
|
||||
"output_cost_per_second_4k": 0.6,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
],
|
||||
|
|
@ -43553,6 +43557,8 @@
|
|||
"max_tokens": 1024,
|
||||
"mode": "video_generation",
|
||||
"output_cost_per_second": 0.1,
|
||||
"output_cost_per_second_1080p": 0.12,
|
||||
"output_cost_per_second_4k": 0.3,
|
||||
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing",
|
||||
"supported_modalities": [
|
||||
"text"
|
||||
|
|
|
|||
|
|
@ -532,6 +532,41 @@ class TestVideoGeneration:
|
|||
assert abs(cost_for("runwayml/seedance2_5", "480p", 8.0) - 1.6) < 0.001
|
||||
assert abs(cost_for("runwayml/gen4.5", None, 8.0) - 0.96) < 0.001
|
||||
|
||||
def test_completion_cost_veo_31_tiers_pin_published_rates(self, monkeypatch):
|
||||
"""The gemini and vertex_ai veo 3.1 entries bill Google's published per-second tier rates."""
|
||||
from litellm.cost_calculator import completion_cost
|
||||
|
||||
local_map_path = os.path.join(
|
||||
os.path.dirname(__file__), "..", "..", "model_prices_and_context_window.json"
|
||||
)
|
||||
with open(local_map_path, "r") as f:
|
||||
monkeypatch.setattr(litellm, "model_cost", json.load(f))
|
||||
|
||||
def cost_for(model: str, provider: str, resolution: str | None, duration: float) -> float:
|
||||
mock_response = MagicMock()
|
||||
mock_response.usage = {
|
||||
"duration_seconds": duration,
|
||||
**({"video_resolution": resolution} if resolution else {}),
|
||||
}
|
||||
type(mock_response)._hidden_params = {}
|
||||
return completion_cost(
|
||||
completion_response=mock_response,
|
||||
model=model,
|
||||
call_type="create_video",
|
||||
custom_llm_provider=provider,
|
||||
)
|
||||
|
||||
for provider in ("gemini", "vertex_ai"):
|
||||
for suffix in ("generate-preview", "generate-001"):
|
||||
standard = f"{provider}/veo-3.1-{suffix}"
|
||||
fast = f"{provider}/veo-3.1-fast-{suffix}"
|
||||
assert abs(cost_for(standard, provider, None, 8.0) - 3.2) < 1e-6
|
||||
assert abs(cost_for(standard, provider, "1080p", 8.0) - 3.2) < 1e-6
|
||||
assert abs(cost_for(standard, provider, "4k", 8.0) - 4.8) < 1e-6
|
||||
assert abs(cost_for(fast, provider, "720p", 8.0) - 0.8) < 1e-6
|
||||
assert abs(cost_for(fast, provider, "1080p", 8.0) - 0.96) < 1e-6
|
||||
assert abs(cost_for(fast, provider, "4k", 8.0) - 2.4) < 1e-6
|
||||
|
||||
def test_video_generation_with_files(self):
|
||||
"""Test video generation with file uploads."""
|
||||
config = OpenAIVideoConfig()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue