mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix(model_prices): azure gpt-4.1-nano retirement date, together deprecations, novita gpt-oss-120b vision flag, fireworks deepseek-v4-pro-0813
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
9300018414
commit
d266326a42
3 changed files with 128 additions and 6 deletions
|
|
@ -4681,7 +4681,7 @@
|
|||
"supports_web_search": false
|
||||
},
|
||||
"azure/gpt-4.1-nano": {
|
||||
"deprecation_date": "2026-10-14",
|
||||
"deprecation_date": "2027-04-14",
|
||||
"cache_read_input_token_cost": 2.5e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"input_cost_per_token_batches": 5e-08,
|
||||
|
|
@ -4714,7 +4714,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"azure/gpt-4.1-nano-2025-04-14": {
|
||||
"deprecation_date": "2026-10-14",
|
||||
"deprecation_date": "2027-04-14",
|
||||
"cache_read_input_token_cost": 2.5e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"input_cost_per_token_batches": 5e-08,
|
||||
|
|
@ -18577,6 +18577,22 @@
|
|||
"supports_tool_choice": true,
|
||||
"supports_vision": false
|
||||
},
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813": {
|
||||
"cache_read_input_token_cost": 4.4e-08,
|
||||
"input_cost_per_token": 1.32e-06,
|
||||
"litellm_provider": "fireworks_ai",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 131072,
|
||||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 3.96e-06,
|
||||
"source": "https://docs.fireworks.ai/serverless/pricing",
|
||||
"supports_function_calling": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": false
|
||||
},
|
||||
"fireworks_ai/accounts/fireworks/models/firefunction-v2": {
|
||||
"input_cost_per_token": 9e-07,
|
||||
"litellm_provider": "fireworks_ai",
|
||||
|
|
@ -38475,6 +38491,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"together_ai/google/gemma-3n-E4B-it": {
|
||||
"deprecation_date": "2026-08-25",
|
||||
"input_cost_per_token": 6e-08,
|
||||
"litellm_provider": "together_ai",
|
||||
"max_input_tokens": 32768,
|
||||
|
|
@ -38510,6 +38527,7 @@
|
|||
"source": "https://docs.together.ai/docs/serverless-models"
|
||||
},
|
||||
"together_ai/meta-llama/Llama-Guard-4-12B": {
|
||||
"deprecation_date": "2026-08-25",
|
||||
"input_cost_per_token": 2e-07,
|
||||
"litellm_provider": "together_ai",
|
||||
"max_input_tokens": 1048576,
|
||||
|
|
@ -47311,7 +47329,7 @@
|
|||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_vision": false,
|
||||
"supports_system_messages": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_reasoning": true
|
||||
|
|
|
|||
|
|
@ -4681,7 +4681,7 @@
|
|||
"supports_web_search": false
|
||||
},
|
||||
"azure/gpt-4.1-nano": {
|
||||
"deprecation_date": "2026-10-14",
|
||||
"deprecation_date": "2027-04-14",
|
||||
"cache_read_input_token_cost": 2.5e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"input_cost_per_token_batches": 5e-08,
|
||||
|
|
@ -4714,7 +4714,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"azure/gpt-4.1-nano-2025-04-14": {
|
||||
"deprecation_date": "2026-10-14",
|
||||
"deprecation_date": "2027-04-14",
|
||||
"cache_read_input_token_cost": 2.5e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"input_cost_per_token_batches": 5e-08,
|
||||
|
|
@ -18577,6 +18577,22 @@
|
|||
"supports_tool_choice": true,
|
||||
"supports_vision": false
|
||||
},
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813": {
|
||||
"cache_read_input_token_cost": 4.4e-08,
|
||||
"input_cost_per_token": 1.32e-06,
|
||||
"litellm_provider": "fireworks_ai",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 131072,
|
||||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 3.96e-06,
|
||||
"source": "https://docs.fireworks.ai/serverless/pricing",
|
||||
"supports_function_calling": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": false
|
||||
},
|
||||
"fireworks_ai/accounts/fireworks/models/firefunction-v2": {
|
||||
"input_cost_per_token": 9e-07,
|
||||
"litellm_provider": "fireworks_ai",
|
||||
|
|
@ -38475,6 +38491,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"together_ai/google/gemma-3n-E4B-it": {
|
||||
"deprecation_date": "2026-08-25",
|
||||
"input_cost_per_token": 6e-08,
|
||||
"litellm_provider": "together_ai",
|
||||
"max_input_tokens": 32768,
|
||||
|
|
@ -38510,6 +38527,7 @@
|
|||
"source": "https://docs.together.ai/docs/serverless-models"
|
||||
},
|
||||
"together_ai/meta-llama/Llama-Guard-4-12B": {
|
||||
"deprecation_date": "2026-08-25",
|
||||
"input_cost_per_token": 2e-07,
|
||||
"litellm_provider": "together_ai",
|
||||
"max_input_tokens": 1048576,
|
||||
|
|
@ -47311,7 +47329,7 @@
|
|||
"supports_function_calling": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_vision": false,
|
||||
"supports_system_messages": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_reasoning": true
|
||||
|
|
|
|||
86
tests/test_litellm/test_fireworks_serverless_model_costs.py
Normal file
86
tests/test_litellm/test_fireworks_serverless_model_costs.py
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
"""
|
||||
Validate the Fireworks AI Serverless entry added for #37274 exists in
|
||||
`model_prices_and_context_window.json` and that the bare Fireworks model ID
|
||||
resolves through `get_model_info`.
|
||||
|
||||
Pricing as published at https://docs.fireworks.ai/serverless/pricing
|
||||
(USD per 1M tokens, uncached input / cached input / output):
|
||||
|
||||
accounts/fireworks/models/deepseek-v4-pro-0813 -> $1.32 / $0.044 / $3.96
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
import litellm
|
||||
from litellm.utils import get_model_info
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", autouse=True)
|
||||
def _local_model_cost_map():
|
||||
"""
|
||||
Point litellm at the bundled cost map for the duration of this module
|
||||
only. ``mp.undo()`` restores both the environment variable and
|
||||
``litellm.model_cost`` so nothing leaks into later tests.
|
||||
"""
|
||||
mp = pytest.MonkeyPatch()
|
||||
mp.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
|
||||
mp.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
|
||||
get_model_info.cache_clear()
|
||||
yield
|
||||
mp.undo()
|
||||
get_model_info.cache_clear()
|
||||
|
||||
|
||||
NEW_ENTRIES = {
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813": {
|
||||
"input_cost_per_token": 1.32e-06,
|
||||
"cache_read_input_token_cost": 4.4e-08,
|
||||
"output_cost_per_token": 3.96e-06,
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 131072,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def model_data():
|
||||
json_path = os.path.join(
|
||||
os.path.dirname(__file__), "../../model_prices_and_context_window.json"
|
||||
)
|
||||
with open(json_path) as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def test_fireworks_serverless_entries_exist(model_data):
|
||||
"""The new prefixed entry carries the pricing and metadata from #37274."""
|
||||
for key, expected in NEW_ENTRIES.items():
|
||||
assert key in model_data, f"{key} is missing from model_prices_and_context_window.json"
|
||||
entry = model_data[key]
|
||||
for field, value in expected.items():
|
||||
assert entry[field] == pytest.approx(value), f"{key}.{field}"
|
||||
assert entry["litellm_provider"] == "fireworks_ai"
|
||||
assert entry["mode"] == "chat"
|
||||
assert entry["supports_function_calling"] is True
|
||||
assert entry["supports_vision"] is False
|
||||
|
||||
|
||||
def test_bare_fireworks_ids_resolve_through_prefixed_entries():
|
||||
"""Bare IDs from #37274 resolve via the provider-prefix lookup path."""
|
||||
for bare_id, prefixed_key in [
|
||||
(
|
||||
"accounts/fireworks/models/deepseek-v4-pro-0813",
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813",
|
||||
),
|
||||
]:
|
||||
info = get_model_info(model=bare_id, custom_llm_provider="fireworks_ai")
|
||||
expected = NEW_ENTRIES[prefixed_key]
|
||||
assert info.get("key") == prefixed_key
|
||||
assert info["litellm_provider"] == "fireworks_ai"
|
||||
assert info["input_cost_per_token"] == pytest.approx(expected["input_cost_per_token"])
|
||||
assert info["cache_read_input_token_cost"] == pytest.approx(expected["cache_read_input_token_cost"])
|
||||
assert info["output_cost_per_token"] == pytest.approx(expected["output_cost_per_token"])
|
||||
assert info["max_input_tokens"] == expected["max_input_tokens"]
|
||||
assert info["max_output_tokens"] == expected["max_output_tokens"]
|
||||
Loading…
Add table
Reference in a new issue