mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
fix(registry): drop gpt-image-2 text output price, add openrouter minimax-m3 and qwen3.7-plus
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
c707f2fe5d
commit
0c29f510bc
4 changed files with 76 additions and 25 deletions
|
|
@ -8296,7 +8296,6 @@
|
|||
"input_cost_per_image_token": 8e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
"/v1/images/generations",
|
||||
|
|
@ -8312,7 +8311,6 @@
|
|||
"input_cost_per_image_token": 8e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
"/v1/images/generations",
|
||||
|
|
@ -29225,7 +29223,6 @@
|
|||
"input_cost_per_token": 5e-06,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"input_cost_per_image_token": 8e-06,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
|
|
@ -29240,7 +29237,6 @@
|
|||
"input_cost_per_token": 5e-06,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"input_cost_per_image_token": 8e-06,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
|
|
@ -60797,5 +60793,40 @@
|
|||
"supports_prompt_caching": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"openrouter/minimax/minimax-m3": {
|
||||
"input_cost_per_token": 3e-07,
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"litellm_provider": "openrouter",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 512000,
|
||||
"max_tokens": 512000,
|
||||
"mode": "chat",
|
||||
"source": "https://openrouter.ai/minimax/minimax-m3",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_vision": true,
|
||||
"cache_read_input_token_cost": 6e-08,
|
||||
"supports_prompt_caching": true
|
||||
},
|
||||
"openrouter/qwen/qwen3.7-plus": {
|
||||
"input_cost_per_token": 3.2e-07,
|
||||
"output_cost_per_token": 1.28e-06,
|
||||
"litellm_provider": "openrouter",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 131072,
|
||||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"source": "https://openrouter.ai/qwen/qwen3.7-plus",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_vision": true,
|
||||
"cache_read_input_token_cost": 6.4e-08,
|
||||
"supports_prompt_caching": true,
|
||||
"cache_creation_input_token_cost": 4e-07
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8296,7 +8296,6 @@
|
|||
"input_cost_per_image_token": 8e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
"/v1/images/generations",
|
||||
|
|
@ -8312,7 +8311,6 @@
|
|||
"input_cost_per_image_token": 8e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
"/v1/images/generations",
|
||||
|
|
@ -29225,7 +29223,6 @@
|
|||
"input_cost_per_token": 5e-06,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"input_cost_per_image_token": 8e-06,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
|
|
@ -29240,7 +29237,6 @@
|
|||
"input_cost_per_token": 5e-06,
|
||||
"litellm_provider": "openai",
|
||||
"mode": "image_generation",
|
||||
"output_cost_per_token": 1e-05,
|
||||
"input_cost_per_image_token": 8e-06,
|
||||
"output_cost_per_image_token": 3e-05,
|
||||
"supported_endpoints": [
|
||||
|
|
@ -60797,5 +60793,40 @@
|
|||
"supports_prompt_caching": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"openrouter/minimax/minimax-m3": {
|
||||
"input_cost_per_token": 3e-07,
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"litellm_provider": "openrouter",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 512000,
|
||||
"max_tokens": 512000,
|
||||
"mode": "chat",
|
||||
"source": "https://openrouter.ai/minimax/minimax-m3",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_vision": true,
|
||||
"cache_read_input_token_cost": 6e-08,
|
||||
"supports_prompt_caching": true
|
||||
},
|
||||
"openrouter/qwen/qwen3.7-plus": {
|
||||
"input_cost_per_token": 3.2e-07,
|
||||
"output_cost_per_token": 1.28e-06,
|
||||
"litellm_provider": "openrouter",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 131072,
|
||||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"source": "https://openrouter.ai/qwen/qwen3.7-plus",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_vision": true,
|
||||
"cache_read_input_token_cost": 6.4e-08,
|
||||
"supports_prompt_caching": true,
|
||||
"cache_creation_input_token_cost": 4e-07
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,8 +172,7 @@ class TestGPTImageCostCalculator:
|
|||
image_tokens=500,
|
||||
),
|
||||
completion_tokens_details=CompletionTokensDetailsWrapper(
|
||||
text_tokens=1000,
|
||||
image_tokens=4000,
|
||||
image_tokens=5000,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
@ -189,12 +188,7 @@ class TestGPTImageCostCalculator:
|
|||
custom_llm_provider="openai",
|
||||
)
|
||||
|
||||
# GPT Image 2 pricing:
|
||||
# Text input: 100 * $5/1M = 0.0005
|
||||
# Image input: 500 * $8/1M = 0.004
|
||||
# Text output: 1000 * $10/1M = 0.01
|
||||
# Image output: 4000 * $30/1M = 0.12
|
||||
expected_cost = 0.0005 + 0.004 + 0.01 + 0.12
|
||||
expected_cost = 100 * 5e-6 + 500 * 8e-6 + 5000 * 3e-5
|
||||
assert abs(cost - expected_cost) < 1e-6, f"Expected {expected_cost}, got {cost}"
|
||||
|
||||
|
||||
|
|
@ -429,10 +423,7 @@ class TestGPTImage2OutputImageTokensNoBreakdown:
|
|||
f"are likely being priced at the text output_cost_per_token rate."
|
||||
)
|
||||
|
||||
def test_gpt_image_2_chat_usage_without_breakdown_is_costed_not_zero(self):
|
||||
"""A chat ``Usage`` with ``completion_tokens_details=None`` must still be
|
||||
costed via ``generic_cost_per_token`` (output at the text rate) rather than
|
||||
erroring or silently returning 0.0."""
|
||||
def test_gpt_image_2_chat_usage_without_breakdown_uses_image_rate(self):
|
||||
from litellm.llms.openai.image_generation.cost_calculator import (
|
||||
cost_calculator,
|
||||
)
|
||||
|
|
@ -460,9 +451,7 @@ class TestGPTImage2OutputImageTokensNoBreakdown:
|
|||
custom_llm_provider="openai",
|
||||
)
|
||||
|
||||
# No output breakdown -> output priced at the text rate (output_cost_per_token):
|
||||
# text in 100*$5/1M + image in 500*$8/1M + output 5000*$10/1M
|
||||
expected_cost = 100 * 5e-6 + 500 * 8e-6 + 5000 * 1e-5
|
||||
expected_cost = 100 * 5e-6 + 500 * 8e-6 + 5000 * 3e-5
|
||||
assert abs(cost - expected_cost) < 1e-6, f"Expected {expected_cost}, got {cost}"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ def test_gpt_image_2_provider_and_model_info(local_model_cost_map):
|
|||
assert model_info["mode"] == "image_generation"
|
||||
assert model_info["input_cost_per_token"] == 5e-06
|
||||
assert model_info["input_cost_per_image_token"] == 8e-06
|
||||
assert model_info["output_cost_per_token"] == 1e-05
|
||||
assert model_info["output_cost_per_token"] == 0
|
||||
assert model_info["output_cost_per_image_token"] == 3e-05
|
||||
assert (
|
||||
"/v1/images/generations"
|
||||
|
|
@ -472,7 +472,7 @@ def test_azure_gpt_image_2_model_info(local_model_cost_map):
|
|||
assert model_info["mode"] == "image_generation"
|
||||
assert model_info["input_cost_per_token"] == 5e-06
|
||||
assert model_info["input_cost_per_image_token"] == 8e-06
|
||||
assert model_info["output_cost_per_token"] == 1e-05
|
||||
assert model_info["output_cost_per_token"] == 0
|
||||
assert model_info["output_cost_per_image_token"] == 3e-05
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue