feat(cost-map): move -latest model aliases into the cost map (#50491)

* feat(cost-map): move -latest model aliases into the cost map

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: load the finalized local cost map in the moonshot alias test and assert alias pricing by behavior

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: compare alias cost map rows to their targets

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(cost-map): give each -latest alias its own alias_of row

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cost-map): keep alias_of rows out of alias lists and add them to the registry schema

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 91e6cf2c27)

* fix(cost-map): let alias lists win over alias_of rows in both loaders and never serve a malformed pointer

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit a54c42218a)

* feat(cost-map): add -latest alias rows for the tier 1 and 2 hosting providers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(cost-map): derive hosted alias targets from the cost map

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(databricks): skip alias rows when checking cache-write rates

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Kerry Lu 2026-11-07 11:56:47 -08:00 • committed by GitHub
parent d0c16008c8
commit 9ec3b5fd8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 760 additions and 66 deletions

View file

@ -194,11 +194,7 @@ def get_llm_provider(
resolved_model, provider, dynamic_api_key, resolved_api_base = _get_llm_provider(
model, custom_llm_provider, api_base, api_key, litellm_params
)
explicit_provider: Final = custom_llm_provider or (litellm_params.custom_llm_provider if litellm_params else None)
target: Final = (
resolve_model_latest_alias(resolved_model, provider) if explicit_provider or "/" in model else resolved_model
)
return target, provider, dynamic_api_key, resolved_api_base
return resolve_model_latest_alias(resolved_model, provider), provider, dynamic_api_key, resolved_api_base
def _get_llm_provider(

View file

@ -1,33 +1,75 @@
from collections.abc import Mapping
from functools import cache
from importlib.resources import files
from types import MappingProxyType
from typing import Final
from typing import Final, cast # noqa: TID251 # litellm.model_cost is an untyped module global
from pydantic import TypeAdapter
_ALIASES_ADAPTER: Final = TypeAdapter(dict[str, dict[str, str]])
import litellm
from litellm.litellm_core_utils.get_model_cost_map import AliasedCostEntry
def _cost_map() -> Mapping[str, object]:
return cast("Mapping[str, object]", litellm.model_cost) # cast-ok: per-lookup catalog validation is too slow
def _alias_entry(key: str) -> AliasedCostEntry | None:
entry: Final = _cost_map().get(key)
return entry if isinstance(entry, AliasedCostEntry) and entry.names[:1] not in ((), (key,)) else None
def _alias_provider(key: str, entry: AliasedCostEntry) -> str | None:
"""The provider an alias is requested through: its key prefix for a hosted alias such as
``bedrock/claude-haiku-latest`` (whose target row belongs to ``bedrock_converse``), else the target's provider"""
prefix, separator, _ = key.partition("/")
if separator and prefix in litellm.provider_list:
return prefix
provider: Final = entry.get("litellm_provider")
return provider if isinstance(provider, str) else None
def _alias_target(key: str, provider: str) -> str | None:
entry: Final = _alias_entry(key)
if entry is None or _alias_provider(key, entry) != provider:
return None
return entry.names[0].removeprefix(f"{provider}/")
@cache
def get_model_latest_aliases() -> Mapping[str, Mapping[str, str]]:
aliases: Final = _ALIASES_ADAPTER.validate_json(files("litellm").joinpath("model_latest_aliases.json").read_bytes())
return MappingProxyType({provider: MappingProxyType(models) for provider, models in aliases.items()})
"""``{provider: {alias: target}}`` for every alias row in the cost map, with provider prefixes stripped"""
rows: Final = tuple(
(provider, key, entry.names[0])
for key in _cost_map()
if (entry := _alias_entry(key)) is not None and (provider := _alias_provider(key, entry)) is not None
)
return MappingProxyType(
{
provider: MappingProxyType(
{
alias.removeprefix(f"{provider}/"): target.removeprefix(f"{provider}/")
for row_provider, alias, target in rows
if row_provider == provider
}
)
for provider in dict.fromkeys(provider for provider, _, _ in rows)
}
)
def resolve_model_latest_alias(model: str, provider: str) -> str:
aliases: Final = get_model_latest_aliases().get(provider)
return aliases.get(model, model) if aliases is not None else model
return _alias_target(f"{provider}/{model}", provider) or _alias_target(model, provider) or model
def expand_model_latest_alias(model: str) -> tuple[str, ...]:
provider, separator, name = model.partition("/")
target: Final = resolve_model_latest_alias(name, provider) if separator else name
return (model, f"{provider}/{target}") if separator and target != name else (model,)
if not separator:
entry: Final = _alias_entry(model)
return (model,) if entry is None else (model, entry.names[0])
target: Final = resolve_model_latest_alias(name, provider)
return (model, f"{provider}/{target}") if target != name else (model,)
def is_model_latest_alias(model: str, custom_llm_provider: str | None = None) -> bool:
prefix, separator, name = model.partition("/")
provider: Final = custom_llm_provider or prefix
provider: Final = custom_llm_provider or (prefix if separator else None)
if provider is None:
return _alias_entry(model) is not None
candidate: Final = name if separator and prefix == provider else model
return bool(custom_llm_provider or separator) and resolve_model_latest_alias(candidate, provider) != candidate
return resolve_model_latest_alias(candidate, provider) != candidate

View file

@ -1,21 +0,0 @@
{
"openai": {
"gpt-luna-latest": "gpt-6-luna",
"gpt-sol-latest": "gpt-6.1-sol",
"gpt-terra-latest": "gpt-6.1-terra",
"gpt-astra-latest": "gpt-6-astra",
"gpt-mini-latest": "gpt-5.4-mini"
},
"anthropic": {
"claude-opus-latest": "claude-opus-5-5",
"claude-sonnet-latest": "claude-sonnet-5-5",
"claude-haiku-latest": "claude-haiku-5-5",
"claude-fable-latest": "claude-fable-5-1"
},
"xai": {"grok-latest": "grok-4.7"},
"moonshot": {"kimi-latest": "kimi-k3"},
"zai": {"glm-latest": "glm-5.3", "glm-flash-latest": "glm-5.3-flash"},
"deepseek": {"deepseek-pro-latest": "deepseek-v4-pro", "deepseek-flash-latest": "deepseek-v4-flash"},
"dashscope": {"qwen-max-latest": "qwen3.8-max", "qwen-flash-latest": "qwen3.8-flash"},
"minimax": {"minimax-latest": "MiniMax-M3"}
}

View file

@ -1969,6 +1969,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
"bedrock/claude-fable-latest": {
"alias_of": "global.anthropic.claude-fable-5-1"
},
"us.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
"cache_creation_input_token_cost_above_1hr": 2.2e-05,
@ -2305,6 +2308,9 @@
"region": "us-east-1"
}
},
"bedrock/claude-opus-latest": {
"alias_of": "global.anthropic.claude-opus-5-5"
},
"us.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
"supports_adaptive_thinking": true,
@ -4063,6 +4069,9 @@
"deprecation_date": "2027-12-05",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement"
},
"azure_ai/claude-fable-latest": {
"alias_of": "azure_ai/claude-fable-5-1"
},
"azure_ai/claude-mythos-5-1": {
"input_cost_per_token": 1e-05,
"output_cost_per_token": 5e-05,
@ -4165,6 +4174,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://management.azure.com/subscriptions/c873328e-b572-4770-8dff-aaeb6f1f0e79/providers/Microsoft.CognitiveServices/locations/eastus2/models?api-version=2024-10-01"
},
"azure_ai/claude-opus-latest": {
"alias_of": "azure_ai/claude-opus-5-5"
},
"azure_ai/claude-opus-4-8": {
"deprecation_date": "2027-09-01",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -4382,6 +4394,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-astra-latest": {
"alias_of": "azure_ai/gpt-6-astra"
},
"azure_ai/gpt-6-luna": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -4430,6 +4445,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-luna-latest": {
"alias_of": "azure_ai/gpt-6-luna"
},
"azure_ai/gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -4526,6 +4544,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-sol-latest": {
"alias_of": "azure_ai/gpt-6.1-sol"
},
"azure_ai/gpt-6.1-terra": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,
@ -4574,6 +4595,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-terra-latest": {
"alias_of": "azure_ai/gpt-6.1-terra"
},
"azure_ai/gpt-5.5": {
"deprecation_date": "2027-10-26",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -5036,6 +5060,9 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"azure_ai/gpt-mini-latest": {
"alias_of": "azure_ai/gpt-5.4-mini"
},
"azure_ai/gpt-5.4-mini-2026-03-17": {
"deprecation_date": "2027-09-21",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -9080,6 +9107,9 @@
"cache_read_input_token_cost_flex": 5e-07,
"cache_creation_input_token_cost_flex": 6.25e-06
},
"azure/gpt-astra-latest": {
"alias_of": "azure/gpt-6-astra"
},
"azure/gpt-6-astra-2026-09-03": {
"cache_creation_input_token_cost": 1.25e-05,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-05,
@ -9184,6 +9214,9 @@
"output_cost_per_token_above_272k_tokens_flex": 3.75e-07,
"output_cost_per_token_flex": 2.5e-07
},
"azure/gpt-luna-latest": {
"alias_of": "azure/gpt-6-luna"
},
"azure/gpt-6-luna-2026-09-22": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -9403,6 +9436,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure/gpt-terra-latest": {
"alias_of": "azure/gpt-6.1-terra"
},
"azure/gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -9455,6 +9491,9 @@
"cache_read_input_token_cost_above_272k_tokens_flex": 1e-07,
"cache_creation_input_token_cost_above_272k_tokens_flex": 2.5e-06
},
"azure/gpt-sol-latest": {
"alias_of": "azure/gpt-6.1-sol"
},
"azure/gpt-6.1-sol-2026-09-29": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -11146,6 +11185,9 @@
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'",
"supports_xhigh_reasoning_effort": true
},
"azure/gpt-mini-latest": {
"alias_of": "azure/gpt-5.4-mini"
},
"azure/gpt-5.4-mini-2026-03-17": {
"cache_read_input_token_cost": 7.5e-08,
"cache_read_input_token_cost_flex": 3.75e-08,
@ -13212,6 +13254,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"azure_ai/kimi-latest": {
"alias_of": "azure_ai/FW-Kimi-K3"
},
"azure_ai/FW-MiniMax-M2.5": {
"deprecation_date": "2027-07-01",
"cache_read_input_token_cost": 3.3e-08,
@ -13251,6 +13296,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"azure_ai/minimax-latest": {
"alias_of": "azure_ai/FW-MiniMax-M3"
},
"azure_ai/FW-Nemotron-Lightning-3.5-30B-A3B": {
"cache_read_input_token_cost": 1e-08,
"input_cost_per_token": 6e-08,
@ -13656,6 +13704,9 @@
"cache_read_input_token_cost": 1.45e-07,
"supports_prompt_caching": true
},
"azure_ai/deepseek-pro-latest": {
"alias_of": "azure_ai/deepseek-v4-pro"
},
"azure_ai/deepseek-v4-flash": {
"deprecation_date": "2028-02-20",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -13674,6 +13725,9 @@
"cache_read_input_token_cost": 2.8e-08,
"supports_prompt_caching": true
},
"azure_ai/deepseek-flash-latest": {
"alias_of": "azure_ai/deepseek-v4-flash"
},
"azure_ai/DeepSeek-V4-Flash-0731": {
"cache_read_input_token_cost": 1.4e-08,
"deprecation_date": "2026-12-03",
@ -16623,6 +16677,9 @@
"source": "https://platform.claude.com/docs/en/about-claude/pricing",
"supports_web_search": true
},
"claude-sonnet-latest": {
"alias_of": "claude-sonnet-5-5"
},
"claude-sonnet-4-6": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -17024,6 +17081,9 @@
"supports_native_structured_output": true,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-fable-latest": {
"alias_of": "claude-fable-5-1"
},
"claude-opus-5-5": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -17069,6 +17129,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-latest": {
"alias_of": "claude-opus-5-5"
},
"claude-opus-5": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -18868,6 +18931,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"dashscope/qwen-max-latest": {
"alias_of": "dashscope/qwen3.8-max"
},
"dashscope/qwen3.8-flash": {
"cache_creation_input_token_cost": 2e-07,
"cache_read_input_token_cost": 1.6e-08,
@ -18887,6 +18953,9 @@
"supports_vision": true,
"supports_web_search": true
},
"dashscope/qwen-flash-latest": {
"alias_of": "dashscope/qwen3.8-flash"
},
"dashscope/qwen3.8-omni-flash": {
"cache_read_input_token_cost": 1.6e-08,
"input_cost_per_token": 1.5e-07,
@ -21767,6 +21836,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"databricks/claude-fable-latest": {
"alias_of": "databricks/databricks-claude-fable-5-1"
},
"databricks/databricks-claude-haiku-4-5": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_creation_input_token_cost_above_1hr": 1.99997e-06,
@ -22007,6 +22079,9 @@
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true
},
"databricks/claude-opus-latest": {
"alias_of": "databricks/databricks-claude-opus-5-5"
},
"databricks/databricks-claude-sonnet-4": {
"cache_creation_input_token_cost": 3.74997e-06,
"cache_read_input_token_cost": 3.0002e-07,
@ -22724,6 +22799,9 @@
"cache_read_input_token_cost_priority": 4.55e-07,
"cache_creation_input_token_cost_priority": 2.45e-06
},
"databricks/glm-latest": {
"alias_of": "databricks/databricks-glm-5-3"
},
"databricks/databricks-glm-5-3-flash": {
"cache_creation_input_token_cost": 1.5001e-07,
"cache_read_input_token_cost": 3.003e-08,
@ -22757,6 +22835,9 @@
"cache_read_input_token_cost_priority": 5.25e-08,
"cache_creation_input_token_cost_priority": 2.625e-07
},
"databricks/glm-flash-latest": {
"alias_of": "databricks/databricks-glm-5-3-flash"
},
"databricks/databricks-gpt-5": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_read_input_token_cost": 1.2502e-07,
@ -22919,6 +23000,9 @@
"cache_read_input_token_cost_priority": 1.5001e-07,
"cache_creation_input_token_cost_priority": 1.50003e-06
},
"databricks/gpt-mini-latest": {
"alias_of": "databricks/databricks-gpt-5-4-mini"
},
"databricks/databricks-gpt-5-4-nano": {
"cache_creation_input_token_cost": 1.9999e-07,
"cache_read_input_token_cost": 2.002e-08,
@ -23315,6 +23399,9 @@
"cache_read_input_token_cost_priority": 5.25e-07,
"cache_creation_input_token_cost_priority": 5.25e-06
},
"databricks/kimi-latest": {
"alias_of": "databricks/databricks-kimi-k3"
},
"databricks/system.ai.kimi-k3": {
"litellm_provider": "databricks",
"mode": "chat",
@ -28843,6 +28930,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"fireworks_ai/minimax-latest": {
"alias_of": "fireworks_ai/accounts/fireworks/models/minimax-m3"
},
"fireworks_ai/accounts/fireworks/models/mixtral-8x22b-instruct-hf": {
"input_cost_per_token": 1.2e-06,
"litellm_provider": "fireworks_ai",
@ -33789,6 +33879,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-fable-latest": {
"alias_of": "github_copilot/claude-fable-5.1"
},
"github_copilot/claude-haiku-4.5": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_read_input_token_cost": 1e-07,
@ -33832,6 +33925,9 @@
"supports_vision": true,
"thinking_always_on": false
},
"github_copilot/claude-haiku-latest": {
"alias_of": "github_copilot/claude-haiku-5.5"
},
"github_copilot/claude-opus-4.8": {
"cache_creation_input_token_cost": 6.25e-06,
"cache_read_input_token_cost": 5e-07,
@ -33920,6 +34016,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-opus-latest": {
"alias_of": "github_copilot/claude-opus-5.5"
},
"github_copilot/claude-sonnet-5": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_read_input_token_cost": 2e-07,
@ -33963,6 +34062,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-sonnet-latest": {
"alias_of": "github_copilot/claude-sonnet-5.5"
},
"github_copilot/gemini-3.7-flash": {
"cache_read_input_token_cost": 7.5e-08,
"deprecation_date": "2026-10-19",
@ -34308,6 +34410,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-astra-latest": {
"alias_of": "github_copilot/gpt-6-astra"
},
"github_copilot/gpt-6-luna": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -34331,6 +34436,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-luna-latest": {
"alias_of": "github_copilot/gpt-6-luna"
},
"github_copilot/gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -34377,6 +34485,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-sol-latest": {
"alias_of": "github_copilot/gpt-6.1-sol"
},
"github_copilot/kimi-k3": {
"cache_read_input_token_cost": 3e-07,
"input_cost_per_token": 3e-06,
@ -34394,6 +34505,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/kimi-latest": {
"alias_of": "github_copilot/kimi-k3"
},
"github_copilot/mai-code-1.1-flash": {
"cache_read_input_token_cost": 2e-08,
"input_cost_per_token": 2e-07,
@ -37687,6 +37801,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-astra-latest": {
"alias_of": "gpt-6-astra"
},
"gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_12hr": 5e-06,
@ -37884,6 +38001,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-luna-latest": {
"alias_of": "gpt-6-luna"
},
"gpt-5.6": {
"cache_creation_input_token_cost": 5e-06,
"cache_creation_input_token_cost_above_12hr": 1e-05,
@ -39067,6 +39187,9 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"gpt-mini-latest": {
"alias_of": "gpt-5.4-mini"
},
"gpt-5.4-mini-2026-03-17": {
"cache_read_input_token_cost": 7.5e-08,
"cache_read_input_token_cost_batches": 3.75e-08,
@ -43025,6 +43148,9 @@
"max_input_tokens": 1000000,
"max_output_tokens": 128000
},
"minimax/minimax-latest": {
"alias_of": "minimax/MiniMax-M3"
},
"minimax/MiniMax-H3": {
"litellm_provider": "minimax",
"mode": "video_generation",
@ -44535,6 +44661,9 @@
"supports_video_input": true,
"supports_vision": true
},
"moonshot/kimi-latest": {
"alias_of": "moonshot/kimi-k3"
},
"moonshot/moonshot-v1-128k": {
"deprecation_date": "2026-08-31",
"input_cost_per_token": 2e-06,
@ -50136,6 +50265,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"together_ai/deepseek-pro-latest": {
"alias_of": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"
},
"together_ai/meta-models/Muse-Glimmer-30B": {
"cache_read_input_token_cost": 4e-08,
"input_cost_per_token": 3.5e-07,
@ -50182,6 +50314,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"together_ai/kimi-latest": {
"alias_of": "together_ai/moonshotai/Kimi-K3"
},
"together_ai/thinkingmachines/Inkling": {
"cache_read_input_token_cost": 1.7e-07,
"deprecation_date": "2026-11-06",
@ -50232,6 +50367,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"together_ai/glm-latest": {
"alias_of": "together_ai/zai-org/GLM-5.3"
},
"together_ai/zai-org/GLM-5.3-Flash": {
"cache_read_input_token_cost": 3e-08,
"input_cost_per_token": 1.5e-07,
@ -50249,6 +50387,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"together_ai/glm-flash-latest": {
"alias_of": "together_ai/zai-org/GLM-5.3-Flash"
},
"tts-1": {
"deprecation_date": "2027-01-06",
"deprecation_source": "https://developers.openai.com/api/docs/deprecations",
@ -53019,6 +53160,9 @@
"output_cost_per_token_batches": 2.5e-05,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-fable-latest": {
"alias_of": "vertex_ai/claude-fable-5-1"
},
"vertex_ai/claude-fable-5@default": {
"deprecation_date": "2027-06-08",
"regional_endpoint_uplift_multiplier": 1.1,
@ -53217,6 +53361,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-opus-latest": {
"alias_of": "vertex_ai/claude-opus-5-5"
},
"vertex_ai/claude-opus-5-5@default": {
"regional_endpoint_uplift_multiplier": 1.1,
"supports_mid_conversation_system": true,
@ -55765,6 +55912,9 @@
"supports_vision": true,
"supports_web_search": true
},
"xai/grok-latest": {
"alias_of": "xai/grok-4.7"
},
"zai.glm-4.7": {
"deprecation_date": "2027-03-30",
"deprecation_source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle-legacy.html",
@ -55866,6 +56016,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"zai/glm-latest": {
"alias_of": "zai/glm-5.3"
},
"zai/glm-5.3-flash": {
"cache_creation_input_token_cost": 0,
"cache_read_input_token_cost": 3e-08,
@ -55883,6 +56036,9 @@
"source": "https://docs.z.ai/guides/overview/pricing",
"supports_vision": true
},
"zai/glm-flash-latest": {
"alias_of": "zai/glm-5.3-flash"
},
"zai/glm-5v-turbo": {
"cache_read_input_token_cost": 2.4e-07,
"input_cost_per_token": 1.2e-06,
@ -61519,6 +61675,9 @@
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-astra.html",
"supports_web_search": true
},
"bedrock_mantle/gpt-astra-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6-astra"
},
"bedrock_mantle/openai.gpt-6-sol": {
"input_cost_per_token": 2.2e-06,
"input_cost_per_token_above_272k_tokens": 4.4e-06,
@ -61599,6 +61758,9 @@
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards-openai.html",
"supports_web_search": true
},
"bedrock_mantle/gpt-luna-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6-luna"
},
"us.openai.gpt-6-astra": {
"supports_bedrock_runtime_chat_completions_response_format": true,
"input_cost_per_token": 1.1e-05,
@ -61767,6 +61929,9 @@
"/v1/responses"
]
},
"bedrock/gpt-astra-latest": {
"alias_of": "global.openai.gpt-6-astra"
},
"openai.gpt-6-sol": {
"input_cost_per_token": 2e-06,
"input_cost_per_token_above_272k_tokens": 4e-06,
@ -61909,6 +62074,9 @@
"/v1/responses"
]
},
"bedrock/gpt-luna-latest": {
"alias_of": "global.openai.gpt-6-luna"
},
"bedrock_mantle/openai.gpt-5.5": {
"input_cost_per_token": 5.5e-06,
"input_cost_per_token_above_272k_tokens": 1.1e-05,
@ -62186,6 +62354,9 @@
"supports_forced_tool_use": false,
"token_count_model": {"model":"anthropic.claude-opus-5-5","litellm_provider":"bedrock_mantle","region":"us-east-1"}
},
"bedrock_mantle/claude-opus-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-opus-5-5"
},
"bedrock_mantle/anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"cache_creation_input_token_cost": 2.75e-06,
@ -62226,6 +62397,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock_mantle/claude-sonnet-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-sonnet-5-5"
},
"us.xai.grok-4.6": {
"supports_regex_lookaround": false,
"input_cost_per_token": 2.2e-06,
@ -63796,6 +63970,9 @@
"token_count_framing": 23,
"token_count_tool_framing": 12
},
"deepseek/deepseek-flash-latest": {
"alias_of": "deepseek/deepseek-v4-flash"
},
"deepseek/deepseek-v4-flash-vision-exp": {
"cache_creation_input_token_cost": 0.0,
"cache_read_input_token_cost": 6e-09,
@ -63904,6 +64081,9 @@
"token_count_framing": 76,
"token_count_tool_framing": 75
},
"deepseek/deepseek-pro-latest": {
"alias_of": "deepseek/deepseek-v4-pro"
},
"tencent/deepseek-v4-pro": {
"cache_creation_input_token_cost": 0.0,
"cache_read_input_token_cost": 1.45e-07,
@ -65327,6 +65507,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"fireworks_ai/kimi-latest": {
"alias_of": "fireworks_ai/accounts/fireworks/models/kimi-k3"
},
"fireworks_ai/deepseek-v4-flash-0731": {
"cache_read_input_token_cost": 7e-09,
"cache_read_input_token_cost_priority": 8.75e-09,
@ -69000,6 +69183,9 @@
"output_cost_per_token": 4.7e-07,
"source": "https://api.together.ai/v1/models"
},
"together_ai/qwen-flash-latest": {
"alias_of": "together_ai/Qwen/Qwen3.8-Flash"
},
"together_ai/moonshotai/Kimi-K2.5-fp4": {
"input_cost_per_token": 5e-07,
"output_cost_per_token": 2.8e-06,
@ -69216,6 +69402,9 @@
"supports_reasoning": true,
"supports_tool_choice": true
},
"azure_ai/glm-latest": {
"alias_of": "azure_ai/FW-GLM-5.3"
},
"azure_ai/FW-GLM-5.3-Flash": {
"cache_read_input_token_cost": 3.8e-08,
"input_cost_per_token": 1.88e-07,
@ -69231,6 +69420,9 @@
"supports_reasoning": true,
"supports_tool_choice": true
},
"azure_ai/glm-flash-latest": {
"alias_of": "azure_ai/FW-GLM-5.3-Flash"
},
"azure_ai/FW-GPT-OSS-120B": {
"deprecation_date": "2027-07-01",
"cache_read_input_token_cost": 8.2e-08,
@ -71236,6 +71428,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/glm-latest": {
"alias_of": "baseten/zai-org/GLM-5.3"
},
"baseten/zai-org/GLM-5.3-Fast": {
"cache_read_input_token_cost": 2.1e-07,
"input_cost_per_token": 2.1e-06,
@ -74425,6 +74620,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"bedrock/kimi-latest": {
"alias_of": "global.moonshotai.kimi-k3"
},
"us.moonshotai.kimi-k3": {
"supports_regex_lookaround": false,
"cache_creation_input_token_cost": 4.125e-06,
@ -74975,6 +75173,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/kimi-latest": {
"alias_of": "baseten/moonshotai/Kimi-K3"
},
"baseten/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": {
"cache_read_input_token_cost": 1.2e-07,
"input_cost_per_token": 6e-07,
@ -75057,6 +75258,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/glm-flash-latest": {
"alias_of": "baseten/zai-org/GLM-5.3-Flash"
},
"baseten/deepseek-ai/DeepSeek-V4-Flash-0731": {
"cache_read_input_token_cost": 2.8e-08,
"input_cost_per_token": 1.3e-07,
@ -75073,6 +75277,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"baseten/deepseek-flash-latest": {
"alias_of": "baseten/deepseek-ai/DeepSeek-V4-Flash-0731"
},
"baseten/deepseek-ai/DeepSeek-V4-Pro": {
"deprecation_date": "2026-10-16",
"cache_read_input_token_cost": 1.45e-07,
@ -75106,6 +75313,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"baseten/deepseek-pro-latest": {
"alias_of": "baseten/deepseek-ai/DeepSeek-V4-Pro-0813"
},
"baseten/zai-org/GLM-5.2-Fast": {
"cache_read_input_token_cost": 2.1e-07,
"input_cost_per_token": 2.1e-06,
@ -76097,6 +76307,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://management.azure.com/subscriptions/c873328e-b572-4770-8dff-aaeb6f1f0e79/providers/Microsoft.CognitiveServices/locations/eastus2/models?api-version=2024-10-01"
},
"azure_ai/claude-sonnet-latest": {
"alias_of": "azure_ai/claude-sonnet-5-5"
},
"bedrock/us-gov-east-1/anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"bedrock_output_config_effort_ceiling": "xhigh",
@ -76261,6 +76474,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock/claude-sonnet-latest": {
"alias_of": "global.anthropic.claude-sonnet-5-5"
},
"jp.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"cache_creation_input_token_cost": 2.75e-06,
@ -76520,6 +76736,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-sonnet-latest": {
"alias_of": "vertex_ai/claude-sonnet-5-5"
},
"vertex_ai/claude-sonnet-5-5@default": {
"regional_endpoint_uplift_multiplier": 1.1,
"supports_mid_conversation_system": true,
@ -76632,6 +76851,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"bedrock/grok-latest": {
"alias_of": "global.xai.grok-4.7"
},
"us.xai.grok-4.7": {
"supports_regex_lookaround": false,
"supported_endpoints": ["/v1/chat/completions"],
@ -76804,6 +77026,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-sol-latest": {
"alias_of": "gpt-6.1-sol"
},
"global.openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -76850,6 +77075,9 @@
"supports_sampling_params": false,
"supports_xhigh_reasoning_effort": true
},
"bedrock/gpt-sol-latest": {
"alias_of": "global.openai.gpt-6.1-sol"
},
"bedrock_mantle/openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.75e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,
@ -76898,6 +77126,9 @@
"supports_xhigh_reasoning_effort": true,
"use_openai_responses_path": true
},
"bedrock_mantle/gpt-sol-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6.1-sol"
},
"us.openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.75e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,
@ -76989,6 +77220,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"vertex_ai/grok-latest": {
"alias_of": "vertex_ai/xai/grok-4.7"
},
"azure_ai/kimi-k2-thinking": {
"deprecation_date": "2026-03-29",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/retired-models",
@ -77046,6 +77280,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"bedrock/glm-latest": {
"alias_of": "global.zai.glm-5.3"
},
"us.zai.glm-5.3": {
"cache_creation_input_token_cost": 2.31e-06,
"cache_creation_input_token_cost_batches": 1.155e-06,
@ -77269,6 +77506,9 @@
"supports_vision": true,
"supports_web_search": true
},
"azure_ai/grok-latest": {
"alias_of": "azure_ai/grok-4.7"
},
"in.moonshotai.kimi-k3": {
"cache_creation_input_token_cost": 4.125e-06,
"cache_creation_input_token_cost_flex": 2.0625e-06,
@ -77355,6 +77595,9 @@
"cache_creation_input_token_cost_above_1hr_above_100k_tokens": 1e-06,
"cache_read_input_token_cost_above_100k_tokens": 5e-08
},
"claude-haiku-latest": {
"alias_of": "claude-haiku-5-5"
},
"bedrock_mantle/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
"output_cost_per_token_above_100k_tokens": 2.75e-06,
@ -77401,6 +77644,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-haiku-5-5.html"
},
"bedrock_mantle/claude-haiku-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-haiku-5-5"
},
"bedrock_mantle/us-gov-west-1/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 6e-07,
"output_cost_per_token_above_100k_tokens": 3e-06,
@ -77632,6 +77878,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide"
},
"azure_ai/claude-haiku-latest": {
"alias_of": "azure_ai/claude-haiku-5-5"
},
"bedrock/us-gov-east-1/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 6e-07,
"output_cost_per_token_above_100k_tokens": 3e-06,
@ -77822,6 +78071,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock/claude-haiku-latest": {
"alias_of": "global.anthropic.claude-haiku-5-5"
},
"jp.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
"output_cost_per_token_above_100k_tokens": 2.75e-06,
@ -78029,6 +78281,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
},
"vertex_ai/claude-haiku-latest": {
"alias_of": "vertex_ai/claude-haiku-5-5"
},
"vertex_ai/claude-haiku-5-5@default": {
"input_cost_per_token_above_100k_tokens": 5e-07,
"output_cost_per_token_above_100k_tokens": 2.5e-06,
@ -78933,6 +79188,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/grok-latest": {
"alias_of": "github_copilot/grok-4.7"
},
"together_ai/deepseek-ai/DeepSeek-V4.1-Flash-1017": {
"cache_read_input_token_cost": 6e-09,
"input_cost_per_token": 3e-07,
@ -80356,6 +80614,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-terra-latest": {
"alias_of": "gpt-6.1-terra"
},
"chatgpt/gpt-6.1-terra": {
"litellm_provider": "chatgpt",
"max_input_tokens": 922000,
@ -80414,6 +80675,9 @@
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
},
"bedrock/gpt-terra-latest": {
"alias_of": "global.openai.gpt-6.1-terra"
},
"us.openai.gpt-6.1-terra": {
"cache_creation_input_token_cost": 1.375e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.75e-06,
@ -80493,6 +80757,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-terra-latest": {
"alias_of": "github_copilot/gpt-6.1-terra"
},
"refuseless/glm-5.3-abliterated": {
"cache_read_input_token_cost": 1.5e-07,
"input_cost_per_token": 1e-06,
@ -80647,6 +80914,9 @@
"supports_xhigh_reasoning_effort": true,
"use_openai_responses_path": true
},
"bedrock_mantle/gpt-terra-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6.1-terra"
},
"clf_ai_gateway/glm-5.3": {
"metadata": {
"comment": "Billed price checked 2026-10-29, which the gateway shows as 60% off a list price 2.5x higher. Update the rows when the discount ends."
@ -82196,6 +82466,9 @@
"supports_vision": true,
"thinking_always_on": false
},
"databricks/claude-haiku-latest": {
"alias_of": "databricks/databricks-claude-haiku-5-5"
},
"databricks/databricks-claude-sonnet-5-5": {
"cache_creation_input_token_cost": 2.49998e-06,
"cache_creation_input_token_cost_above_1hr": 4.00001e-06,
@ -82225,6 +82498,9 @@
"supports_vision": false,
"thinking_always_on": true
},
"databricks/claude-sonnet-latest": {
"alias_of": "databricks/databricks-claude-sonnet-5-5"
},
"databricks/databricks-deepseek-v4-1-flash": {
"cache_creation_input_token_cost": 3.0002e-07,
"cache_read_input_token_cost": 3.003e-08,
@ -82457,6 +82733,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 3.9998e-07,
"cache_creation_input_token_cost_above_272k_tokens_priority": 9.99999e-06
},
"databricks/gpt-sol-latest": {
"alias_of": "databricks/databricks-gpt-6-1-sol"
},
"databricks/databricks-gpt-6-1-terra": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.49998e-06,
@ -82497,6 +82776,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 1.9999e-07,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.00003e-06
},
"databricks/gpt-terra-latest": {
"alias_of": "databricks/databricks-gpt-6-1-terra"
},
"databricks/databricks-gpt-6-astra": {
"cache_creation_input_token_cost": 1.249997e-05,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-05,
@ -82537,6 +82819,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 4.00001e-06,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.000002e-05
},
"databricks/gpt-astra-latest": {
"alias_of": "databricks/databricks-gpt-6-astra"
},
"databricks/databricks-gpt-6-luna": {
"cache_creation_input_token_cost": 1.2502e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.4997e-07,
@ -82577,6 +82862,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 3.997e-08,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.0001e-07
},
"databricks/gpt-luna-latest": {
"alias_of": "databricks/databricks-gpt-6-luna"
},
"databricks/databricks-gpt-6-sol": {
"cache_creation_input_token_cost": 2.49998e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.00003e-06,
@ -82707,6 +82995,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"databricks/grok-latest": {
"alias_of": "databricks/databricks-grok-4-7"
},
"databricks/databricks-kimi-k2-7": {
"cache_creation_input_token_cost": 9.4997e-07,
"cache_read_input_token_cost": 1.8998e-07,
@ -86639,6 +86930,9 @@
"supports_vision": true,
"use_openai_responses_path": true
},
"bedrock_mantle/grok-latest": {
"alias_of": "bedrock_mantle/xai.grok-4.7"
},
"together_ai/ricursive-ai/Ripple-65B-Preview": {
"cache_read_input_token_cost": 2e-08,
"input_cost_per_token": 2e-07,

View file

@ -1969,6 +1969,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://aws.amazon.com/bedrock/pricing/"
},
"bedrock/claude-fable-latest": {
"alias_of": "global.anthropic.claude-fable-5-1"
},
"us.anthropic.claude-fable-5": {
"cache_creation_input_token_cost": 1.375e-05,
"cache_creation_input_token_cost_above_1hr": 2.2e-05,
@ -2305,6 +2308,9 @@
"region": "us-east-1"
}
},
"bedrock/claude-opus-latest": {
"alias_of": "global.anthropic.claude-opus-5-5"
},
"us.anthropic.claude-opus-5": {
"bedrock_converse_supports_strict_tools": false,
"supports_adaptive_thinking": true,
@ -4063,6 +4069,9 @@
"deprecation_date": "2027-12-05",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement"
},
"azure_ai/claude-fable-latest": {
"alias_of": "azure_ai/claude-fable-5-1"
},
"azure_ai/claude-mythos-5-1": {
"input_cost_per_token": 1e-05,
"output_cost_per_token": 5e-05,
@ -4165,6 +4174,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://management.azure.com/subscriptions/c873328e-b572-4770-8dff-aaeb6f1f0e79/providers/Microsoft.CognitiveServices/locations/eastus2/models?api-version=2024-10-01"
},
"azure_ai/claude-opus-latest": {
"alias_of": "azure_ai/claude-opus-5-5"
},
"azure_ai/claude-opus-4-8": {
"deprecation_date": "2027-09-01",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -4382,6 +4394,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-astra-latest": {
"alias_of": "azure_ai/gpt-6-astra"
},
"azure_ai/gpt-6-luna": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -4430,6 +4445,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-luna-latest": {
"alias_of": "azure_ai/gpt-6-luna"
},
"azure_ai/gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -4526,6 +4544,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-sol-latest": {
"alias_of": "azure_ai/gpt-6.1-sol"
},
"azure_ai/gpt-6.1-terra": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-06,
@ -4574,6 +4595,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure_ai/gpt-terra-latest": {
"alias_of": "azure_ai/gpt-6.1-terra"
},
"azure_ai/gpt-5.5": {
"deprecation_date": "2027-10-26",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -5036,6 +5060,9 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"azure_ai/gpt-mini-latest": {
"alias_of": "azure_ai/gpt-5.4-mini"
},
"azure_ai/gpt-5.4-mini-2026-03-17": {
"deprecation_date": "2027-09-21",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -9080,6 +9107,9 @@
"cache_read_input_token_cost_flex": 5e-07,
"cache_creation_input_token_cost_flex": 6.25e-06
},
"azure/gpt-astra-latest": {
"alias_of": "azure/gpt-6-astra"
},
"azure/gpt-6-astra-2026-09-03": {
"cache_creation_input_token_cost": 1.25e-05,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-05,
@ -9184,6 +9214,9 @@
"output_cost_per_token_above_272k_tokens_flex": 3.75e-07,
"output_cost_per_token_flex": 2.5e-07
},
"azure/gpt-luna-latest": {
"alias_of": "azure/gpt-6-luna"
},
"azure/gpt-6-luna-2026-09-22": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -9403,6 +9436,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"azure/gpt-terra-latest": {
"alias_of": "azure/gpt-6.1-terra"
},
"azure/gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -9455,6 +9491,9 @@
"cache_read_input_token_cost_above_272k_tokens_flex": 1e-07,
"cache_creation_input_token_cost_above_272k_tokens_flex": 2.5e-06
},
"azure/gpt-sol-latest": {
"alias_of": "azure/gpt-6.1-sol"
},
"azure/gpt-6.1-sol-2026-09-29": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -11146,6 +11185,9 @@
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'",
"supports_xhigh_reasoning_effort": true
},
"azure/gpt-mini-latest": {
"alias_of": "azure/gpt-5.4-mini"
},
"azure/gpt-5.4-mini-2026-03-17": {
"cache_read_input_token_cost": 7.5e-08,
"cache_read_input_token_cost_flex": 3.75e-08,
@ -13212,6 +13254,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"azure_ai/kimi-latest": {
"alias_of": "azure_ai/FW-Kimi-K3"
},
"azure_ai/FW-MiniMax-M2.5": {
"deprecation_date": "2027-07-01",
"cache_read_input_token_cost": 3.3e-08,
@ -13251,6 +13296,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"azure_ai/minimax-latest": {
"alias_of": "azure_ai/FW-MiniMax-M3"
},
"azure_ai/FW-Nemotron-Lightning-3.5-30B-A3B": {
"cache_read_input_token_cost": 1e-08,
"input_cost_per_token": 6e-08,
@ -13656,6 +13704,9 @@
"cache_read_input_token_cost": 1.45e-07,
"supports_prompt_caching": true
},
"azure_ai/deepseek-pro-latest": {
"alias_of": "azure_ai/deepseek-v4-pro"
},
"azure_ai/deepseek-v4-flash": {
"deprecation_date": "2028-02-20",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/concepts/model-lifecycle-retirement",
@ -13674,6 +13725,9 @@
"cache_read_input_token_cost": 2.8e-08,
"supports_prompt_caching": true
},
"azure_ai/deepseek-flash-latest": {
"alias_of": "azure_ai/deepseek-v4-flash"
},
"azure_ai/DeepSeek-V4-Flash-0731": {
"cache_read_input_token_cost": 1.4e-08,
"deprecation_date": "2026-12-03",
@ -16623,6 +16677,9 @@
"source": "https://platform.claude.com/docs/en/about-claude/pricing",
"supports_web_search": true
},
"claude-sonnet-latest": {
"alias_of": "claude-sonnet-5-5"
},
"claude-sonnet-4-6": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -17024,6 +17081,9 @@
"supports_native_structured_output": true,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-fable-latest": {
"alias_of": "claude-fable-5-1"
},
"claude-opus-5-5": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -17069,6 +17129,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
},
"claude-opus-latest": {
"alias_of": "claude-opus-5-5"
},
"claude-opus-5": {
"supports_web_search": true,
"supports_anthropic_compaction": true,
@ -18868,6 +18931,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"dashscope/qwen-max-latest": {
"alias_of": "dashscope/qwen3.8-max"
},
"dashscope/qwen3.8-flash": {
"cache_creation_input_token_cost": 2e-07,
"cache_read_input_token_cost": 1.6e-08,
@ -18887,6 +18953,9 @@
"supports_vision": true,
"supports_web_search": true
},
"dashscope/qwen-flash-latest": {
"alias_of": "dashscope/qwen3.8-flash"
},
"dashscope/qwen3.8-omni-flash": {
"cache_read_input_token_cost": 1.6e-08,
"input_cost_per_token": 1.5e-07,
@ -21767,6 +21836,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"databricks/claude-fable-latest": {
"alias_of": "databricks/databricks-claude-fable-5-1"
},
"databricks/databricks-claude-haiku-4-5": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_creation_input_token_cost_above_1hr": 1.99997e-06,
@ -22007,6 +22079,9 @@
"supports_xhigh_reasoning_effort": true,
"thinking_always_on": true
},
"databricks/claude-opus-latest": {
"alias_of": "databricks/databricks-claude-opus-5-5"
},
"databricks/databricks-claude-sonnet-4": {
"cache_creation_input_token_cost": 3.74997e-06,
"cache_read_input_token_cost": 3.0002e-07,
@ -22724,6 +22799,9 @@
"cache_read_input_token_cost_priority": 4.55e-07,
"cache_creation_input_token_cost_priority": 2.45e-06
},
"databricks/glm-latest": {
"alias_of": "databricks/databricks-glm-5-3"
},
"databricks/databricks-glm-5-3-flash": {
"cache_creation_input_token_cost": 1.5001e-07,
"cache_read_input_token_cost": 3.003e-08,
@ -22757,6 +22835,9 @@
"cache_read_input_token_cost_priority": 5.25e-08,
"cache_creation_input_token_cost_priority": 2.625e-07
},
"databricks/glm-flash-latest": {
"alias_of": "databricks/databricks-glm-5-3-flash"
},
"databricks/databricks-gpt-5": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_read_input_token_cost": 1.2502e-07,
@ -22919,6 +23000,9 @@
"cache_read_input_token_cost_priority": 1.5001e-07,
"cache_creation_input_token_cost_priority": 1.50003e-06
},
"databricks/gpt-mini-latest": {
"alias_of": "databricks/databricks-gpt-5-4-mini"
},
"databricks/databricks-gpt-5-4-nano": {
"cache_creation_input_token_cost": 1.9999e-07,
"cache_read_input_token_cost": 2.002e-08,
@ -23315,6 +23399,9 @@
"cache_read_input_token_cost_priority": 5.25e-07,
"cache_creation_input_token_cost_priority": 5.25e-06
},
"databricks/kimi-latest": {
"alias_of": "databricks/databricks-kimi-k3"
},
"databricks/system.ai.kimi-k3": {
"litellm_provider": "databricks",
"mode": "chat",
@ -28843,6 +28930,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"fireworks_ai/minimax-latest": {
"alias_of": "fireworks_ai/accounts/fireworks/models/minimax-m3"
},
"fireworks_ai/accounts/fireworks/models/mixtral-8x22b-instruct-hf": {
"input_cost_per_token": 1.2e-06,
"litellm_provider": "fireworks_ai",
@ -33789,6 +33879,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-fable-latest": {
"alias_of": "github_copilot/claude-fable-5.1"
},
"github_copilot/claude-haiku-4.5": {
"cache_creation_input_token_cost": 1.25e-06,
"cache_read_input_token_cost": 1e-07,
@ -33832,6 +33925,9 @@
"supports_vision": true,
"thinking_always_on": false
},
"github_copilot/claude-haiku-latest": {
"alias_of": "github_copilot/claude-haiku-5.5"
},
"github_copilot/claude-opus-4.8": {
"cache_creation_input_token_cost": 6.25e-06,
"cache_read_input_token_cost": 5e-07,
@ -33920,6 +34016,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-opus-latest": {
"alias_of": "github_copilot/claude-opus-5.5"
},
"github_copilot/claude-sonnet-5": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_read_input_token_cost": 2e-07,
@ -33963,6 +34062,9 @@
"supports_vision": true,
"thinking_always_on": true
},
"github_copilot/claude-sonnet-latest": {
"alias_of": "github_copilot/claude-sonnet-5.5"
},
"github_copilot/gemini-3.7-flash": {
"cache_read_input_token_cost": 7.5e-08,
"deprecation_date": "2026-10-19",
@ -34308,6 +34410,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-astra-latest": {
"alias_of": "github_copilot/gpt-6-astra"
},
"github_copilot/gpt-6-luna": {
"cache_creation_input_token_cost": 1.25e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-07,
@ -34331,6 +34436,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-luna-latest": {
"alias_of": "github_copilot/gpt-6-luna"
},
"github_copilot/gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -34377,6 +34485,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-sol-latest": {
"alias_of": "github_copilot/gpt-6.1-sol"
},
"github_copilot/kimi-k3": {
"cache_read_input_token_cost": 3e-07,
"input_cost_per_token": 3e-06,
@ -34394,6 +34505,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/kimi-latest": {
"alias_of": "github_copilot/kimi-k3"
},
"github_copilot/mai-code-1.1-flash": {
"cache_read_input_token_cost": 2e-08,
"input_cost_per_token": 2e-07,
@ -37687,6 +37801,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-astra-latest": {
"alias_of": "gpt-6-astra"
},
"gpt-6-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_12hr": 5e-06,
@ -37884,6 +38001,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-luna-latest": {
"alias_of": "gpt-6-luna"
},
"gpt-5.6": {
"cache_creation_input_token_cost": 5e-06,
"cache_creation_input_token_cost_above_12hr": 1e-05,
@ -39067,6 +39187,9 @@
"supports_xhigh_reasoning_effort": true,
"supports_minimal_reasoning_effort": false
},
"gpt-mini-latest": {
"alias_of": "gpt-5.4-mini"
},
"gpt-5.4-mini-2026-03-17": {
"cache_read_input_token_cost": 7.5e-08,
"cache_read_input_token_cost_batches": 3.75e-08,
@ -43025,6 +43148,9 @@
"max_input_tokens": 1000000,
"max_output_tokens": 128000
},
"minimax/minimax-latest": {
"alias_of": "minimax/MiniMax-M3"
},
"minimax/MiniMax-H3": {
"litellm_provider": "minimax",
"mode": "video_generation",
@ -44535,6 +44661,9 @@
"supports_video_input": true,
"supports_vision": true
},
"moonshot/kimi-latest": {
"alias_of": "moonshot/kimi-k3"
},
"moonshot/moonshot-v1-128k": {
"deprecation_date": "2026-08-31",
"input_cost_per_token": 2e-06,
@ -50136,6 +50265,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"together_ai/deepseek-pro-latest": {
"alias_of": "together_ai/deepseek-ai/DeepSeek-V4-Pro-0813"
},
"together_ai/meta-models/Muse-Glimmer-30B": {
"cache_read_input_token_cost": 4e-08,
"input_cost_per_token": 3.5e-07,
@ -50182,6 +50314,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"together_ai/kimi-latest": {
"alias_of": "together_ai/moonshotai/Kimi-K3"
},
"together_ai/thinkingmachines/Inkling": {
"cache_read_input_token_cost": 1.7e-07,
"deprecation_date": "2026-11-06",
@ -50232,6 +50367,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"together_ai/glm-latest": {
"alias_of": "together_ai/zai-org/GLM-5.3"
},
"together_ai/zai-org/GLM-5.3-Flash": {
"cache_read_input_token_cost": 3e-08,
"input_cost_per_token": 1.5e-07,
@ -50249,6 +50387,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"together_ai/glm-flash-latest": {
"alias_of": "together_ai/zai-org/GLM-5.3-Flash"
},
"tts-1": {
"deprecation_date": "2027-01-06",
"deprecation_source": "https://developers.openai.com/api/docs/deprecations",
@ -53019,6 +53160,9 @@
"output_cost_per_token_batches": 2.5e-05,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-fable-latest": {
"alias_of": "vertex_ai/claude-fable-5-1"
},
"vertex_ai/claude-fable-5@default": {
"deprecation_date": "2027-06-08",
"regional_endpoint_uplift_multiplier": 1.1,
@ -53217,6 +53361,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-opus-latest": {
"alias_of": "vertex_ai/claude-opus-5-5"
},
"vertex_ai/claude-opus-5-5@default": {
"regional_endpoint_uplift_multiplier": 1.1,
"supports_mid_conversation_system": true,
@ -55765,6 +55912,9 @@
"supports_vision": true,
"supports_web_search": true
},
"xai/grok-latest": {
"alias_of": "xai/grok-4.7"
},
"zai.glm-4.7": {
"deprecation_date": "2027-03-30",
"deprecation_source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle-legacy.html",
@ -55866,6 +56016,9 @@
"supports_response_schema": true,
"supports_tool_choice": true
},
"zai/glm-latest": {
"alias_of": "zai/glm-5.3"
},
"zai/glm-5.3-flash": {
"cache_creation_input_token_cost": 0,
"cache_read_input_token_cost": 3e-08,
@ -55883,6 +56036,9 @@
"source": "https://docs.z.ai/guides/overview/pricing",
"supports_vision": true
},
"zai/glm-flash-latest": {
"alias_of": "zai/glm-5.3-flash"
},
"zai/glm-5v-turbo": {
"cache_read_input_token_cost": 2.4e-07,
"input_cost_per_token": 1.2e-06,
@ -61519,6 +61675,9 @@
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-astra.html",
"supports_web_search": true
},
"bedrock_mantle/gpt-astra-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6-astra"
},
"bedrock_mantle/openai.gpt-6-sol": {
"input_cost_per_token": 2.2e-06,
"input_cost_per_token_above_272k_tokens": 4.4e-06,
@ -61599,6 +61758,9 @@
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards-openai.html",
"supports_web_search": true
},
"bedrock_mantle/gpt-luna-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6-luna"
},
"us.openai.gpt-6-astra": {
"supports_bedrock_runtime_chat_completions_response_format": true,
"input_cost_per_token": 1.1e-05,
@ -61767,6 +61929,9 @@
"/v1/responses"
]
},
"bedrock/gpt-astra-latest": {
"alias_of": "global.openai.gpt-6-astra"
},
"openai.gpt-6-sol": {
"input_cost_per_token": 2e-06,
"input_cost_per_token_above_272k_tokens": 4e-06,
@ -61909,6 +62074,9 @@
"/v1/responses"
]
},
"bedrock/gpt-luna-latest": {
"alias_of": "global.openai.gpt-6-luna"
},
"bedrock_mantle/openai.gpt-5.5": {
"input_cost_per_token": 5.5e-06,
"input_cost_per_token_above_272k_tokens": 1.1e-05,
@ -62186,6 +62354,9 @@
"supports_forced_tool_use": false,
"token_count_model": {"model":"anthropic.claude-opus-5-5","litellm_provider":"bedrock_mantle","region":"us-east-1"}
},
"bedrock_mantle/claude-opus-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-opus-5-5"
},
"bedrock_mantle/anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"cache_creation_input_token_cost": 2.75e-06,
@ -62226,6 +62397,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock_mantle/claude-sonnet-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-sonnet-5-5"
},
"us.xai.grok-4.6": {
"supports_regex_lookaround": false,
"input_cost_per_token": 2.2e-06,
@ -63796,6 +63970,9 @@
"token_count_framing": 23,
"token_count_tool_framing": 12
},
"deepseek/deepseek-flash-latest": {
"alias_of": "deepseek/deepseek-v4-flash"
},
"deepseek/deepseek-v4-flash-vision-exp": {
"cache_creation_input_token_cost": 0.0,
"cache_read_input_token_cost": 6e-09,
@ -63904,6 +64081,9 @@
"token_count_framing": 76,
"token_count_tool_framing": 75
},
"deepseek/deepseek-pro-latest": {
"alias_of": "deepseek/deepseek-v4-pro"
},
"tencent/deepseek-v4-pro": {
"cache_creation_input_token_cost": 0.0,
"cache_read_input_token_cost": 1.45e-07,
@ -65327,6 +65507,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"fireworks_ai/kimi-latest": {
"alias_of": "fireworks_ai/accounts/fireworks/models/kimi-k3"
},
"fireworks_ai/deepseek-v4-flash-0731": {
"cache_read_input_token_cost": 7e-09,
"cache_read_input_token_cost_priority": 8.75e-09,
@ -69000,6 +69183,9 @@
"output_cost_per_token": 4.7e-07,
"source": "https://api.together.ai/v1/models"
},
"together_ai/qwen-flash-latest": {
"alias_of": "together_ai/Qwen/Qwen3.8-Flash"
},
"together_ai/moonshotai/Kimi-K2.5-fp4": {
"input_cost_per_token": 5e-07,
"output_cost_per_token": 2.8e-06,
@ -69216,6 +69402,9 @@
"supports_reasoning": true,
"supports_tool_choice": true
},
"azure_ai/glm-latest": {
"alias_of": "azure_ai/FW-GLM-5.3"
},
"azure_ai/FW-GLM-5.3-Flash": {
"cache_read_input_token_cost": 3.8e-08,
"input_cost_per_token": 1.88e-07,
@ -69231,6 +69420,9 @@
"supports_reasoning": true,
"supports_tool_choice": true
},
"azure_ai/glm-flash-latest": {
"alias_of": "azure_ai/FW-GLM-5.3-Flash"
},
"azure_ai/FW-GPT-OSS-120B": {
"deprecation_date": "2027-07-01",
"cache_read_input_token_cost": 8.2e-08,
@ -71236,6 +71428,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/glm-latest": {
"alias_of": "baseten/zai-org/GLM-5.3"
},
"baseten/zai-org/GLM-5.3-Fast": {
"cache_read_input_token_cost": 2.1e-07,
"input_cost_per_token": 2.1e-06,
@ -74425,6 +74620,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"bedrock/kimi-latest": {
"alias_of": "global.moonshotai.kimi-k3"
},
"us.moonshotai.kimi-k3": {
"supports_regex_lookaround": false,
"cache_creation_input_token_cost": 4.125e-06,
@ -74975,6 +75173,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/kimi-latest": {
"alias_of": "baseten/moonshotai/Kimi-K3"
},
"baseten/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B": {
"cache_read_input_token_cost": 1.2e-07,
"input_cost_per_token": 6e-07,
@ -75057,6 +75258,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"baseten/glm-flash-latest": {
"alias_of": "baseten/zai-org/GLM-5.3-Flash"
},
"baseten/deepseek-ai/DeepSeek-V4-Flash-0731": {
"cache_read_input_token_cost": 2.8e-08,
"input_cost_per_token": 1.3e-07,
@ -75073,6 +75277,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"baseten/deepseek-flash-latest": {
"alias_of": "baseten/deepseek-ai/DeepSeek-V4-Flash-0731"
},
"baseten/deepseek-ai/DeepSeek-V4-Pro": {
"deprecation_date": "2026-10-16",
"cache_read_input_token_cost": 1.45e-07,
@ -75106,6 +75313,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"baseten/deepseek-pro-latest": {
"alias_of": "baseten/deepseek-ai/DeepSeek-V4-Pro-0813"
},
"baseten/zai-org/GLM-5.2-Fast": {
"cache_read_input_token_cost": 2.1e-07,
"input_cost_per_token": 2.1e-06,
@ -76097,6 +76307,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://management.azure.com/subscriptions/c873328e-b572-4770-8dff-aaeb6f1f0e79/providers/Microsoft.CognitiveServices/locations/eastus2/models?api-version=2024-10-01"
},
"azure_ai/claude-sonnet-latest": {
"alias_of": "azure_ai/claude-sonnet-5-5"
},
"bedrock/us-gov-east-1/anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"bedrock_output_config_effort_ceiling": "xhigh",
@ -76261,6 +76474,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock/claude-sonnet-latest": {
"alias_of": "global.anthropic.claude-sonnet-5-5"
},
"jp.anthropic.claude-sonnet-5-5": {
"bedrock_converse_supports_strict_tools": false,
"cache_creation_input_token_cost": 2.75e-06,
@ -76520,6 +76736,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
},
"vertex_ai/claude-sonnet-latest": {
"alias_of": "vertex_ai/claude-sonnet-5-5"
},
"vertex_ai/claude-sonnet-5-5@default": {
"regional_endpoint_uplift_multiplier": 1.1,
"supports_mid_conversation_system": true,
@ -76632,6 +76851,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"bedrock/grok-latest": {
"alias_of": "global.xai.grok-4.7"
},
"us.xai.grok-4.7": {
"supports_regex_lookaround": false,
"supported_endpoints": ["/v1/chat/completions"],
@ -76804,6 +77026,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-sol-latest": {
"alias_of": "gpt-6.1-sol"
},
"global.openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.5e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5e-06,
@ -76850,6 +77075,9 @@
"supports_sampling_params": false,
"supports_xhigh_reasoning_effort": true
},
"bedrock/gpt-sol-latest": {
"alias_of": "global.openai.gpt-6.1-sol"
},
"bedrock_mantle/openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.75e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,
@ -76898,6 +77126,9 @@
"supports_xhigh_reasoning_effort": true,
"use_openai_responses_path": true
},
"bedrock_mantle/gpt-sol-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6.1-sol"
},
"us.openai.gpt-6.1-sol": {
"cache_creation_input_token_cost": 2.75e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.5e-06,
@ -76989,6 +77220,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"vertex_ai/grok-latest": {
"alias_of": "vertex_ai/xai/grok-4.7"
},
"azure_ai/kimi-k2-thinking": {
"deprecation_date": "2026-03-29",
"deprecation_source": "https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/retired-models",
@ -77046,6 +77280,9 @@
"supports_tool_choice": true,
"supports_vision": false
},
"bedrock/glm-latest": {
"alias_of": "global.zai.glm-5.3"
},
"us.zai.glm-5.3": {
"cache_creation_input_token_cost": 2.31e-06,
"cache_creation_input_token_cost_batches": 1.155e-06,
@ -77269,6 +77506,9 @@
"supports_vision": true,
"supports_web_search": true
},
"azure_ai/grok-latest": {
"alias_of": "azure_ai/grok-4.7"
},
"in.moonshotai.kimi-k3": {
"cache_creation_input_token_cost": 4.125e-06,
"cache_creation_input_token_cost_flex": 2.0625e-06,
@ -77355,6 +77595,9 @@
"cache_creation_input_token_cost_above_1hr_above_100k_tokens": 1e-06,
"cache_read_input_token_cost_above_100k_tokens": 5e-08
},
"claude-haiku-latest": {
"alias_of": "claude-haiku-5-5"
},
"bedrock_mantle/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
"output_cost_per_token_above_100k_tokens": 2.75e-06,
@ -77401,6 +77644,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-haiku-5-5.html"
},
"bedrock_mantle/claude-haiku-latest": {
"alias_of": "bedrock_mantle/anthropic.claude-haiku-5-5"
},
"bedrock_mantle/us-gov-west-1/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 6e-07,
"output_cost_per_token_above_100k_tokens": 3e-06,
@ -77632,6 +77878,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide"
},
"azure_ai/claude-haiku-latest": {
"alias_of": "azure_ai/claude-haiku-5-5"
},
"bedrock/us-gov-east-1/anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 6e-07,
"output_cost_per_token_above_100k_tokens": 3e-06,
@ -77822,6 +78071,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonBedrockFoundationModels/current/index.json"
},
"bedrock/claude-haiku-latest": {
"alias_of": "global.anthropic.claude-haiku-5-5"
},
"jp.anthropic.claude-haiku-5-5": {
"input_cost_per_token_above_100k_tokens": 5.5e-07,
"output_cost_per_token_above_100k_tokens": 2.75e-06,
@ -78029,6 +78281,9 @@
"prompt_cache_min_tokens": 512,
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
},
"vertex_ai/claude-haiku-latest": {
"alias_of": "vertex_ai/claude-haiku-5-5"
},
"vertex_ai/claude-haiku-5-5@default": {
"input_cost_per_token_above_100k_tokens": 5e-07,
"output_cost_per_token_above_100k_tokens": 2.5e-06,
@ -78933,6 +79188,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/grok-latest": {
"alias_of": "github_copilot/grok-4.7"
},
"together_ai/deepseek-ai/DeepSeek-V4.1-Flash-1017": {
"cache_read_input_token_cost": 6e-09,
"input_cost_per_token": 3e-07,
@ -80356,6 +80614,9 @@
"supports_web_search": true,
"supports_xhigh_reasoning_effort": true
},
"gpt-terra-latest": {
"alias_of": "gpt-6.1-terra"
},
"chatgpt/gpt-6.1-terra": {
"litellm_provider": "chatgpt",
"max_input_tokens": 922000,
@ -80414,6 +80675,9 @@
"supports_vision": true,
"supports_xhigh_reasoning_effort": true
},
"bedrock/gpt-terra-latest": {
"alias_of": "global.openai.gpt-6.1-terra"
},
"us.openai.gpt-6.1-terra": {
"cache_creation_input_token_cost": 1.375e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.75e-06,
@ -80493,6 +80757,9 @@
"supports_response_schema": true,
"supports_vision": true
},
"github_copilot/gpt-terra-latest": {
"alias_of": "github_copilot/gpt-6.1-terra"
},
"refuseless/glm-5.3-abliterated": {
"cache_read_input_token_cost": 1.5e-07,
"input_cost_per_token": 1e-06,
@ -80647,6 +80914,9 @@
"supports_xhigh_reasoning_effort": true,
"use_openai_responses_path": true
},
"bedrock_mantle/gpt-terra-latest": {
"alias_of": "bedrock_mantle/openai.gpt-6.1-terra"
},
"clf_ai_gateway/glm-5.3": {
"metadata": {
"comment": "Billed price checked 2026-10-29, which the gateway shows as 60% off a list price 2.5x higher. Update the rows when the discount ends."
@ -82196,6 +82466,9 @@
"supports_vision": true,
"thinking_always_on": false
},
"databricks/claude-haiku-latest": {
"alias_of": "databricks/databricks-claude-haiku-5-5"
},
"databricks/databricks-claude-sonnet-5-5": {
"cache_creation_input_token_cost": 2.49998e-06,
"cache_creation_input_token_cost_above_1hr": 4.00001e-06,
@ -82225,6 +82498,9 @@
"supports_vision": false,
"thinking_always_on": true
},
"databricks/claude-sonnet-latest": {
"alias_of": "databricks/databricks-claude-sonnet-5-5"
},
"databricks/databricks-deepseek-v4-1-flash": {
"cache_creation_input_token_cost": 3.0002e-07,
"cache_read_input_token_cost": 3.003e-08,
@ -82457,6 +82733,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 3.9998e-07,
"cache_creation_input_token_cost_above_272k_tokens_priority": 9.99999e-06
},
"databricks/gpt-sol-latest": {
"alias_of": "databricks/databricks-gpt-6-1-sol"
},
"databricks/databricks-gpt-6-1-terra": {
"cache_creation_input_token_cost": 1.24999e-06,
"cache_creation_input_token_cost_above_272k_tokens": 2.49998e-06,
@ -82497,6 +82776,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 1.9999e-07,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.00003e-06
},
"databricks/gpt-terra-latest": {
"alias_of": "databricks/databricks-gpt-6-1-terra"
},
"databricks/databricks-gpt-6-astra": {
"cache_creation_input_token_cost": 1.249997e-05,
"cache_creation_input_token_cost_above_272k_tokens": 2.5e-05,
@ -82537,6 +82819,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 4.00001e-06,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.000002e-05
},
"databricks/gpt-astra-latest": {
"alias_of": "databricks/databricks-gpt-6-astra"
},
"databricks/databricks-gpt-6-luna": {
"cache_creation_input_token_cost": 1.2502e-07,
"cache_creation_input_token_cost_above_272k_tokens": 2.4997e-07,
@ -82577,6 +82862,9 @@
"cache_read_input_token_cost_above_272k_tokens_priority": 3.997e-08,
"cache_creation_input_token_cost_above_272k_tokens_priority": 5.0001e-07
},
"databricks/gpt-luna-latest": {
"alias_of": "databricks/databricks-gpt-6-luna"
},
"databricks/databricks-gpt-6-sol": {
"cache_creation_input_token_cost": 2.49998e-06,
"cache_creation_input_token_cost_above_272k_tokens": 5.00003e-06,
@ -82707,6 +82995,9 @@
"supports_tool_choice": true,
"supports_vision": true
},
"databricks/grok-latest": {
"alias_of": "databricks/databricks-grok-4-7"
},
"databricks/databricks-kimi-k2-7": {
"cache_creation_input_token_cost": 9.4997e-07,
"cache_read_input_token_cost": 1.8998e-07,
@ -86639,6 +86930,9 @@
"supports_vision": true,
"use_openai_responses_path": true
},
"bedrock_mantle/grok-latest": {
"alias_of": "bedrock_mantle/xai.grok-4.7"
},
"together_ai/ricursive-ai/Ripple-65B-Preview": {
"cache_read_input_token_cost": 2e-08,
"input_cost_per_token": 2e-07,

View file

@ -30,9 +30,9 @@ CUSTOM_PROVIDER: Final = "test-onprem-llm"
@pytest.mark.parametrize(
("model", "provider"),
(("openai/gpt-luna-latest", None), ("gpt-luna-latest", "openai")),
(("openai/gpt-luna-latest", None), ("gpt-luna-latest", "openai"), ("gpt-luna-latest", None)),
)
def test_latest_alias_resolves_to_the_bundled_target(model: str, provider: str | None) -> None:
def test_latest_alias_resolves_to_the_cost_map_target(model: str, provider: str | None) -> None:
target: Final = get_model_latest_aliases()["openai"]["gpt-luna-latest"]
resolved, resolved_provider, _, api_base = get_llm_provider(
model, custom_llm_provider=provider, api_base="https://api.openai.com/v1"
@ -42,7 +42,12 @@ def test_latest_alias_resolves_to_the_bundled_target(model: str, provider: str |
@pytest.mark.parametrize(
"model",
("gemini/gemini-pro-latest", "gemini/gemini-flash-latest", "dashscope/qwen-plus-latest", "mistral/mistral-large-latest"),
(
"gemini/gemini-pro-latest",
"gemini/gemini-flash-latest",
"dashscope/qwen-plus-latest",
"mistral/mistral-large-latest",
),
)
def test_provider_native_latest_alias_passes_through(model: str) -> None:
provider, name = model.split("/", 1)
@ -153,6 +158,7 @@ def _vcr_outcome_gate(request, vcr):
yield
record_vcr_outcome(request, vcr)
@pytest.fixture(scope="function")
def isolate_litellm_state():
"""
@ -205,6 +211,7 @@ def isolate_litellm_state():
setattr(litellm, attr, original_value)
_invalidate_model_cost_lowercase_map()
_SCALAR_DEFAULTS = {
"num_retries": getattr(litellm, "num_retries", None),
"num_retries_per_request": getattr(litellm, "num_retries_per_request", None),
@ -225,6 +232,7 @@ _SCALAR_DEFAULTS = {
"api_key": getattr(litellm, "api_key", None),
}
@pytest.fixture(scope="module")
def setup_and_teardown():
"""
@ -247,12 +255,14 @@ def setup_and_teardown():
litellm.in_memory_llm_clients_cache.flush_cache()
yield
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider():
_, response, _, _ = litellm.get_llm_provider(model="anthropic.claude-v2:1")
assert response == "bedrock"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_fireworks(): # tests finetuned fireworks models - https://github.com/BerriAI/litellm/issues/4923
model, custom_llm_provider, _, _ = litellm.get_llm_provider(model="fireworks_ai/accounts/my-test-1234")
@ -260,17 +270,20 @@ def test_get_llm_provider_fireworks(): # tests finetuned fireworks models - htt
assert custom_llm_provider == "fireworks_ai"
assert model == "accounts/my-test-1234"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_catch_all():
_, response, _, _ = litellm.get_llm_provider(model="*")
assert response == "openai"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_gpt_instruct():
_, response, _, _ = litellm.get_llm_provider(model="gpt-3.5-turbo-instruct-0914")
assert response == "text-completion-openai"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_mistral_custom_api_base():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -281,6 +294,7 @@ def test_get_llm_provider_mistral_custom_api_base():
assert model == "mistral-large-fr"
assert api_base == "https://mistral-large-fr-ishaan.francecentral.inference.ai.azure.com/v1"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_deepseek_custom_api_base():
os.environ["DEEPSEEK_API_BASE"] = "MY-FAKE-BASE"
@ -293,6 +307,7 @@ def test_get_llm_provider_deepseek_custom_api_base():
os.environ.pop("DEEPSEEK_API_BASE")
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_vertex_ai_image_models(monkeypatch):
monkeypatch.setattr(litellm, "vertex_ai_image_models", set())
@ -310,6 +325,7 @@ def test_get_llm_provider_vertex_ai_image_models(monkeypatch):
)
assert custom_llm_provider == "vertex_ai"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_ai21_chat():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -319,6 +335,7 @@ def test_get_llm_provider_ai21_chat():
assert model == "jamba-1.5-large"
assert api_base == "https://api.ai21.com/studio/v1"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_ai21_chat_test2():
"""
@ -335,6 +352,7 @@ def test_get_llm_provider_ai21_chat_test2():
assert model == "jamba-1.5-large"
assert api_base == "https://api.ai21.com/studio/v1"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_cohere_chat_test2():
"""
@ -350,6 +368,7 @@ def test_get_llm_provider_cohere_chat_test2():
assert custom_llm_provider == "cohere_chat"
assert model == "command-r-plus-08-2024"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_azure_o1():
@ -359,6 +378,7 @@ def test_get_llm_provider_azure_o1():
assert custom_llm_provider == "azure"
assert model == "o1-mini"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_hosted_vllm_default_api_key():
from litellm.litellm_core_utils.get_llm_provider_logic import (
@ -373,6 +393,7 @@ def test_hosted_vllm_default_api_key():
)
assert dynamic_api_key == "fake-api-key"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_jina_ai():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -382,6 +403,7 @@ def test_get_llm_provider_jina_ai():
assert api_base == "https://api.jina.ai/v1"
assert model == "jina-embeddings-v3"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_hosted_vllm():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -391,6 +413,7 @@ def test_get_llm_provider_hosted_vllm():
assert model == "llama-3.1-70b-instruct"
assert dynamic_api_key == "fake-api-key"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_llamafile():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -401,6 +424,7 @@ def test_get_llm_provider_llamafile():
assert dynamic_api_key == "fake-api-key"
assert api_base == "http://127.0.0.1:8080/v1"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_watson_text():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -409,6 +433,7 @@ def test_get_llm_provider_watson_text():
assert custom_llm_provider == "watsonx_text"
assert model == "watson-text-to-speech"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_azure_global_standard_get_llm_provider():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -418,6 +443,7 @@ def test_azure_global_standard_get_llm_provider():
)
assert custom_llm_provider == "azure_ai"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_nova_bedrock_converse():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -426,6 +452,7 @@ def test_nova_bedrock_converse():
assert custom_llm_provider == "bedrock"
assert model == "amazon.nova-micro-v1:0"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_bedrock_invoke_anthropic():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
@ -434,6 +461,7 @@ def test_bedrock_invoke_anthropic():
assert custom_llm_provider == "bedrock"
assert model == "invoke/anthropic.claude-haiku-4-5-20251001-v1:0"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
@pytest.mark.parametrize("model", ["xai/grok-2-vision-latest", "grok-2-vision-latest"])
def test_xai_api_base(model):
@ -450,6 +478,7 @@ def test_xai_api_base(model):
assert api_base == "https://api.x.ai/v1"
assert dynamic_api_key == "xai-my-specialkey"
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_litellm_proxy_custom_llm_provider():
"""
@ -479,6 +508,7 @@ def test_get_litellm_proxy_custom_llm_provider():
assert key == expected_api_key
assert base == expected_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_litellm_proxy_with_args_override_env_vars():
"""
@ -510,6 +540,7 @@ def test_get_litellm_proxy_with_args_override_env_vars():
assert key == arg_api_key
assert base == arg_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_litellm_proxy_model_prefix_stripping():
"""
@ -540,6 +571,7 @@ def test_get_litellm_proxy_model_prefix_stripping():
assert key == expected_api_key
assert base == expected_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_LITELLM_PROXY_ALWAYS_true():
"""
@ -568,6 +600,7 @@ def test_get_llm_provider_LITELLM_PROXY_ALWAYS_true():
assert key == proxy_api_key
assert base == proxy_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_LITELLM_PROXY_ALWAYS_true_model_prefix():
"""
@ -594,6 +627,7 @@ def test_get_llm_provider_LITELLM_PROXY_ALWAYS_true_model_prefix():
assert key == proxy_api_key
assert base == proxy_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_use_proxy_arg_true():
"""
@ -623,6 +657,7 @@ def test_get_llm_provider_use_proxy_arg_true():
assert key == proxy_api_key
assert base == proxy_api_base
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
def test_get_llm_provider_use_proxy_arg_true_with_direct_args():
"""
@ -659,6 +694,7 @@ def test_get_llm_provider_use_proxy_arg_true_with_direct_args():
assert key == arg_api_key # Should use the argument key
assert base == arg_api_base # Should use the argument base
@pytest.fixture
def shipped_generalizations():
"""Install the rules shipped in the bundled backup, then restore.
@ -682,6 +718,7 @@ def shipped_generalizations():
finally:
set_fallback_generalizations(previous)
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
class TestClaudeModelPatternMatching:
"""
@ -749,9 +786,7 @@ class TestClaudeModelPatternMatching:
@pytest.mark.usefixtures("_vcr_outcome_gate", "isolate_litellm_state", "setup_and_teardown")
class TestTypesafeJevPatternMatching:
def test_every_priced_jev_id_routes_to_typesafe(
self, shipped_generalizations: None
) -> None:
def test_every_priced_jev_id_routes_to_typesafe(self, shipped_generalizations: None) -> None:
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap
priced_ids: Final = tuple(
@ -760,9 +795,9 @@ class TestTypesafeJevPatternMatching:
if key.startswith("typesafe/")
)
assert "jev-latest" in priced_ids
assert {
model: litellm.get_llm_provider(model=model)[1] for model in priced_ids
} == dict.fromkeys(priced_ids, "typesafe")
assert {model: litellm.get_llm_provider(model=model)[1] for model in priced_ids} == dict.fromkeys(
priced_ids, "typesafe"
)
@pytest.mark.parametrize(
"model",
@ -837,7 +872,9 @@ def test_metadata_callers_never_log_in_for_a_declared_chatgpt_deployment(
assert get_api_base("chatgpt/gpt-5.4", {"model": "chatgpt/gpt-5.4"}) == "https://chatgpt.com/backend-api/codex"
identity = _resolve_model("chatgpt/gpt-5.4", None)
assert identity is not None and identity.provider == "chatgpt"
group = Router(model_list=[{"model_name": "codex", "litellm_params": {"model": "chatgpt/gpt-5.4"}}]).registry().group(
"codex"
group = (
Router(model_list=[{"model_name": "codex", "litellm_params": {"model": "chatgpt/gpt-5.4"}}])
.registry()
.group("codex")
)
assert group is not None and group.providers == ["chatgpt"]

View file

@ -3,14 +3,17 @@ from typing import Final
import pytest
import litellm
from litellm.litellm_core_utils.get_llm_provider_logic import PROVIDERS_THAT_AUTHENTICATE_ON_PROVIDER_INFO
from litellm.litellm_core_utils.get_model_cost_map import AliasedCostEntry
from litellm.litellm_core_utils.model_latest_aliases import (
expand_model_latest_alias,
get_model_latest_aliases,
is_model_latest_alias,
resolve_model_latest_alias,
)
@pytest.mark.parametrize("model", ("", "gpt-luna-latest", "openai/unknown", "gemini/gemini-pro-latest"))
@pytest.mark.parametrize("model", ("", "kimi-latest", "openai/unknown", "gemini/gemini-pro-latest"))
def test_non_alias_expansion_keeps_the_requested_name(model: str) -> None:
assert expand_model_latest_alias(model) == (model,)
@ -21,15 +24,56 @@ def test_alias_expansion_keeps_requested_and_target_names() -> None:
assert expand_model_latest_alias(f"{provider}/{alias}") == (f"{provider}/{alias}", f"{provider}/{target}")
def test_latest_alias_targets_have_chat_pricing_without_shadowing_native_models() -> None:
for provider, aliases in get_model_latest_aliases().items():
for alias, target in aliases.items():
def test_bare_alias_expands_to_its_cost_map_owner() -> None:
alias, target = next(iter(get_model_latest_aliases()["openai"].items()))
assert expand_model_latest_alias(alias) == (alias, target)
def test_latest_aliases_price_and_route_like_their_targets() -> None:
aliases: Final = get_model_latest_aliases()
assert aliases
for provider, provider_aliases in aliases.items():
for alias, target in provider_aliases.items():
prefixed: Final = f"{provider}/{alias}"
alias_key: Final = prefixed if prefixed in litellm.model_cost else alias
target_key: Final = f"{provider}/{target}" if f"{provider}/{target}" in litellm.model_cost else target
entry: Final = litellm.model_cost[target_key]
assert (entry["litellm_provider"], entry["mode"]) == (provider, "chat")
assert f"{provider}/{alias}" not in litellm.model_cost
assert litellm.model_cost.get(alias, {}).get("litellm_provider") != provider
assert litellm.get_llm_provider(f"{provider}/{alias}")[:2] == (target, provider)
entry: Final = litellm.model_cost[alias_key]
assert entry["mode"] in ("chat", "responses")
assert entry == litellm.model_cost[target_key]
assert resolve_model_latest_alias(alias, provider) == target
if provider in PROVIDERS_THAT_AUTHENTICATE_ON_PROVIDER_INFO:
continue
assert litellm.get_llm_provider(prefixed)[:2] == (target, provider)
assert litellm.get_llm_provider(alias, custom_llm_provider=provider)[:2] == (target, provider)
@pytest.mark.parametrize(
("model", "provider", "target_provider"),
(
("bedrock/claude-haiku-latest", "bedrock", "bedrock_converse"),
("vertex_ai/claude-haiku-latest", "vertex_ai", "vertex_ai-anthropic_models"),
("azure/gpt-mini-latest", "azure", "azure"),
("fireworks_ai/kimi-latest", "fireworks_ai", "fireworks_ai"),
),
)
def test_hosted_alias_is_sent_as_the_hosts_model_id(model: str, provider: str, target_provider: str) -> None:
entry: Final = litellm.model_cost[model]
assert isinstance(entry, AliasedCostEntry)
name: Final = model.partition("/")[2]
target: Final = entry.names[0].removeprefix(f"{provider}/")
assert target != name
assert entry["litellm_provider"] == target_provider
assert litellm.get_llm_provider(model)[:2] == (target, provider)
assert is_model_latest_alias(model)
assert resolve_model_latest_alias(name, provider) == target
assert get_model_latest_aliases()[provider][name] == target
def test_alias_resolution_is_scoped_to_the_owning_provider() -> None:
alias, target = next(iter(get_model_latest_aliases()["openai"].items()))
assert resolve_model_latest_alias(alias, "openai") == target
assert resolve_model_latest_alias(alias, "anthropic") == alias
assert resolve_model_latest_alias(target, "openai") == target
@pytest.mark.parametrize(
@ -37,11 +81,14 @@ def test_latest_alias_targets_have_chat_pricing_without_shadowing_native_models(
(
("openai/gpt-luna-latest", None, True),
("gpt-luna-latest", "openai", True),
("gpt-luna-latest", None, False),
("gpt-luna-latest", None, True),
("gpt-luna-latest", "anthropic", False),
("moonshot/kimi-latest", None, True),
("kimi-latest", None, False),
("gemini/gemini-pro-latest", None, False),
("", None, False),
("openai/unknown-model", None, False),
),
)
def test_latest_alias_detection_requires_an_explicit_provider(model: str, provider: str | None, expected: bool) -> None:
def test_latest_alias_detection_follows_the_cost_map_owner(model: str, provider: str | None, expected: bool) -> None:
assert is_model_latest_alias(model, provider) is expected

View file

@ -6,6 +6,7 @@ from typing import Final
import pytest
import litellm
from litellm.litellm_core_utils.get_model_cost_map import AliasedCostEntry
from litellm.llms.databricks.cost_calculator import cost_per_token
from litellm.types.utils import ModelInfo, Usage
@ -213,6 +214,7 @@ def test_every_model_without_published_cache_dbu_bills_cache_writes_at_its_own_i
if model.startswith("databricks/")
and info.get("input_cost_per_token")
and model not in PUBLISHED_DBU_PER_MILLION
and not (isinstance(info, AliasedCostEntry) and info.names[0] != model)
]
for model in without_published_rates:

View file

@ -13,7 +13,7 @@ import pytest
import litellm
import litellm.utils
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap, get_model_cost_map
from litellm.litellm_core_utils.model_latest_aliases import get_model_latest_aliases
from litellm.llms.moonshot.chat.transformation import MoonshotChatConfig
@ -715,7 +715,8 @@ class TestMoonshotReasoningEffort:
@pytest.fixture(autouse=True)
def force_local_model_cost(self, monkeypatch):
monkeypatch.setattr(litellm, "model_cost", GetModelCostMap.load_local_model_cost_map())
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
monkeypatch.setattr(litellm, "model_cost", get_model_cost_map(url=litellm.model_cost_map_url))
@pytest.mark.parametrize("model", ["kimi-k3", "kimi-k2.5", "kimi-k2.6"])
def test_reasoning_model_supports_reasoning_effort(self, model):

View file

@ -51,8 +51,10 @@ def call(**kwargs: object) -> NativeCall:
("openai/gpt-luna-latest", None, True),
("gpt-luna-latest", "openai", True),
("gemini/gemini-pro-latest", None, False),
("gpt-luna-latest", None, False),
("gpt-luna-latest", None, True),
("anthropic/claude-opus-latest", None, True),
("moonshot/kimi-latest", None, True),
("kimi-latest", None, False),
("claude-opus-latest", "anthropic", True),
("", None, False),
),