mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
feat(cost-map): add Claude Fable 5.2 on Vertex AI and repoint claude-fable-latest (#50713)
* feat(cost-map): add Claude Fable 5.2 on the Anthropic API, Vertex AI and Claude Platform on AWS Adds claude-fable-5-2, vertex_ai/claude-fable-5-2 (plus @default) and bedrock/claude_platform/claude-fable-5-2 at $8/$40 per MTok, $10 and $16 cache writes, $0.20 cache reads, 50% batch discount and a 2x fast mode multiplier, and points claude-fable-latest and vertex_ai/claude-fable-latest at the new rows. Bedrock converse rows ship separately in #50707. * fix(cost-map): drop fast mode from the Vertex Fable 5.2 rows, the Vertex cost path does not bill it * Merge main, drop the Anthropic API and Claude Platform rows that #50715 already landed Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
32a27427ba
commit
07f5baba73
3 changed files with 233 additions and 5 deletions
|
|
@ -17091,7 +17091,7 @@
|
|||
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
|
||||
},
|
||||
"claude-fable-latest": {
|
||||
"alias_of": "claude-fable-5-1"
|
||||
"alias_of": "claude-fable-5-2"
|
||||
},
|
||||
"claude-opus-5-5": {
|
||||
"supports_web_search": true,
|
||||
|
|
@ -53119,8 +53119,49 @@
|
|||
"output_cost_per_token_batches": 2.5e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-fable-5-2": {
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"supports_mid_conversation_system": true,
|
||||
"cache_creation_input_token_cost": 1e-05,
|
||||
"cache_creation_input_token_cost_above_1hr": 1.6e-05,
|
||||
"cache_creation_input_token_cost_batches": 5e-06,
|
||||
"cache_read_input_token_cost": 2e-07,
|
||||
"cache_read_input_token_cost_batches": 1e-07,
|
||||
"input_cost_per_token": 8e-06,
|
||||
"litellm_provider": "vertex_ai-anthropic_models",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 128000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4e-05,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.01,
|
||||
"search_context_size_low": 0.01,
|
||||
"search_context_size_medium": 0.01
|
||||
},
|
||||
"supports_adaptive_thinking": true,
|
||||
"thinking_always_on": true,
|
||||
"supports_assistant_prefill": false,
|
||||
"supports_computer_use": true,
|
||||
"supports_forced_tool_use": false,
|
||||
"supports_function_calling": true,
|
||||
"supports_native_structured_output": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_sampling_params": false,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_xhigh_reasoning_effort": true,
|
||||
"supports_max_reasoning_effort": true,
|
||||
"prompt_cache_min_tokens": 512,
|
||||
"deprecation_date": "2027-11-09",
|
||||
"input_cost_per_token_batches": 4e-06,
|
||||
"output_cost_per_token_batches": 2e-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"
|
||||
"alias_of": "vertex_ai/claude-fable-5-2"
|
||||
},
|
||||
"vertex_ai/claude-fable-5@default": {
|
||||
"deprecation_date": "2027-06-08",
|
||||
|
|
@ -53202,6 +53243,47 @@
|
|||
"output_cost_per_token_batches": 2.5e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-fable-5-2@default": {
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"supports_mid_conversation_system": true,
|
||||
"cache_creation_input_token_cost": 1e-05,
|
||||
"cache_creation_input_token_cost_above_1hr": 1.6e-05,
|
||||
"cache_creation_input_token_cost_batches": 5e-06,
|
||||
"cache_read_input_token_cost": 2e-07,
|
||||
"cache_read_input_token_cost_batches": 1e-07,
|
||||
"input_cost_per_token": 8e-06,
|
||||
"litellm_provider": "vertex_ai-anthropic_models",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 128000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4e-05,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.01,
|
||||
"search_context_size_low": 0.01,
|
||||
"search_context_size_medium": 0.01
|
||||
},
|
||||
"supports_adaptive_thinking": true,
|
||||
"thinking_always_on": true,
|
||||
"supports_assistant_prefill": false,
|
||||
"supports_computer_use": true,
|
||||
"supports_forced_tool_use": false,
|
||||
"supports_function_calling": true,
|
||||
"supports_native_structured_output": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_sampling_params": false,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_xhigh_reasoning_effort": true,
|
||||
"supports_max_reasoning_effort": true,
|
||||
"prompt_cache_min_tokens": 512,
|
||||
"deprecation_date": "2027-11-09",
|
||||
"input_cost_per_token_batches": 4e-06,
|
||||
"output_cost_per_token_batches": 2e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-opus-5": {
|
||||
"deprecation_date": "2027-01-24",
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
|
|
|
|||
|
|
@ -17091,7 +17091,7 @@
|
|||
"source": "https://platform.claude.com/docs/en/about-claude/pricing"
|
||||
},
|
||||
"claude-fable-latest": {
|
||||
"alias_of": "claude-fable-5-1"
|
||||
"alias_of": "claude-fable-5-2"
|
||||
},
|
||||
"claude-opus-5-5": {
|
||||
"supports_web_search": true,
|
||||
|
|
@ -53119,8 +53119,49 @@
|
|||
"output_cost_per_token_batches": 2.5e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-fable-5-2": {
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"supports_mid_conversation_system": true,
|
||||
"cache_creation_input_token_cost": 1e-05,
|
||||
"cache_creation_input_token_cost_above_1hr": 1.6e-05,
|
||||
"cache_creation_input_token_cost_batches": 5e-06,
|
||||
"cache_read_input_token_cost": 2e-07,
|
||||
"cache_read_input_token_cost_batches": 1e-07,
|
||||
"input_cost_per_token": 8e-06,
|
||||
"litellm_provider": "vertex_ai-anthropic_models",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 128000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4e-05,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.01,
|
||||
"search_context_size_low": 0.01,
|
||||
"search_context_size_medium": 0.01
|
||||
},
|
||||
"supports_adaptive_thinking": true,
|
||||
"thinking_always_on": true,
|
||||
"supports_assistant_prefill": false,
|
||||
"supports_computer_use": true,
|
||||
"supports_forced_tool_use": false,
|
||||
"supports_function_calling": true,
|
||||
"supports_native_structured_output": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_sampling_params": false,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_xhigh_reasoning_effort": true,
|
||||
"supports_max_reasoning_effort": true,
|
||||
"prompt_cache_min_tokens": 512,
|
||||
"deprecation_date": "2027-11-09",
|
||||
"input_cost_per_token_batches": 4e-06,
|
||||
"output_cost_per_token_batches": 2e-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"
|
||||
"alias_of": "vertex_ai/claude-fable-5-2"
|
||||
},
|
||||
"vertex_ai/claude-fable-5@default": {
|
||||
"deprecation_date": "2027-06-08",
|
||||
|
|
@ -53202,6 +53243,47 @@
|
|||
"output_cost_per_token_batches": 2.5e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-fable-5-2@default": {
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
"supports_mid_conversation_system": true,
|
||||
"cache_creation_input_token_cost": 1e-05,
|
||||
"cache_creation_input_token_cost_above_1hr": 1.6e-05,
|
||||
"cache_creation_input_token_cost_batches": 5e-06,
|
||||
"cache_read_input_token_cost": 2e-07,
|
||||
"cache_read_input_token_cost_batches": 1e-07,
|
||||
"input_cost_per_token": 8e-06,
|
||||
"litellm_provider": "vertex_ai-anthropic_models",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 128000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4e-05,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.01,
|
||||
"search_context_size_low": 0.01,
|
||||
"search_context_size_medium": 0.01
|
||||
},
|
||||
"supports_adaptive_thinking": true,
|
||||
"thinking_always_on": true,
|
||||
"supports_assistant_prefill": false,
|
||||
"supports_computer_use": true,
|
||||
"supports_forced_tool_use": false,
|
||||
"supports_function_calling": true,
|
||||
"supports_native_structured_output": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_sampling_params": false,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true,
|
||||
"supports_xhigh_reasoning_effort": true,
|
||||
"supports_max_reasoning_effort": true,
|
||||
"prompt_cache_min_tokens": 512,
|
||||
"deprecation_date": "2027-11-09",
|
||||
"input_cost_per_token_batches": 4e-06,
|
||||
"output_cost_per_token_batches": 2e-05,
|
||||
"source": "https://cloud.google.com/gemini-enterprise-agent-platform/generative-ai/pricing"
|
||||
},
|
||||
"vertex_ai/claude-opus-5": {
|
||||
"deprecation_date": "2027-01-24",
|
||||
"regional_endpoint_uplift_multiplier": 1.1,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
Validate Claude Fable 5 and Claude Fable 5.1 model configuration entries.
|
||||
Validate Claude Fable 5, Claude Fable 5.1 and Claude Fable 5.2 model configuration entries.
|
||||
|
||||
Fable 5 is a new tier above Opus ($10/$50 per MTok) with the same adaptive-only
|
||||
API surface as Opus 4.7/4.8. The cost-map entries below are what make the model
|
||||
|
|
@ -11,9 +11,11 @@ shape, which Fable 5 rejects with a 400.
|
|||
|
||||
import json
|
||||
import os
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
|
||||
import litellm
|
||||
from litellm.constants import BEDROCK_CONVERSE_MODELS
|
||||
from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap
|
||||
|
||||
|
|
@ -92,3 +94,65 @@ def test_adaptive_thinking_detected_for_fable_5_1(local_model_cost_map, model):
|
|||
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
|
||||
|
||||
assert AnthropicModelInfo.is_adaptive_thinking_model(model, "anthropic") is True
|
||||
|
||||
|
||||
FABLE_5_2_VARIANTS = (
|
||||
"claude-fable-5-2",
|
||||
"vertex_ai/claude-fable-5-2",
|
||||
"vertex_ai/claude-fable-5-2@default",
|
||||
"bedrock/claude_platform/claude-fable-5-2",
|
||||
)
|
||||
|
||||
|
||||
def test_fable_5_2_present_in_bundled_backup() -> None:
|
||||
backup = GetModelCostMap.load_local_model_cost_map()
|
||||
root = _load_root_cost_map()
|
||||
for model_name in FABLE_5_2_VARIANTS:
|
||||
assert model_name in backup, f"Missing from backup cost map: {model_name}"
|
||||
assert backup[model_name] == root[model_name], model_name
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model",
|
||||
[
|
||||
"claude-fable-5-2",
|
||||
"anthropic/claude-fable-5-2",
|
||||
"claude-fable-latest",
|
||||
"vertex_ai/claude-fable-5-2",
|
||||
"vertex_ai/claude-fable-5-2@default",
|
||||
"bedrock/claude_platform/claude-fable-5-2",
|
||||
],
|
||||
)
|
||||
def test_adaptive_thinking_detected_for_fable_5_2(local_model_cost_map, model: str) -> None:
|
||||
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
|
||||
|
||||
assert AnthropicModelInfo.is_adaptive_thinking_model(model, "anthropic") is True
|
||||
|
||||
|
||||
def test_fable_5_2_fast_mode_doubles_every_token_price_on_the_anthropic_api(local_model_cost_map) -> None:
|
||||
"""Anthropic bills fast mode at 2x the standard rate on every token type
|
||||
(platform.claude.com/docs/en/about-claude/pricing, read 2026-11-09), and the
|
||||
Anthropic cost path is the one that reads the row's `fast` multiplier."""
|
||||
from litellm.litellm_core_utils.llm_cost_calc.utils import get_provider_specific_speed_multiplier
|
||||
from litellm.types.utils import Usage
|
||||
|
||||
info: Final = litellm.get_model_info("claude-fable-5-2")
|
||||
assert get_provider_specific_speed_multiplier(info, Usage(speed="fast")) == 2.0
|
||||
assert get_provider_specific_speed_multiplier(info, Usage()) == 1.0
|
||||
|
||||
|
||||
def test_fable_5_2_vertex_rows_do_not_advertise_fast_mode(local_model_cost_map) -> None:
|
||||
"""Vertex cost calculation ignores the `fast` multiplier, so a Vertex row that
|
||||
advertised fast mode would bill fast calls at the standard rate."""
|
||||
for model in ("vertex_ai/claude-fable-5-2", "vertex_ai/claude-fable-5-2@default"):
|
||||
info: Final = litellm.get_model_info(model)
|
||||
assert info.get("supports_fast_mode") is not True, model
|
||||
assert "fast" not in (info.get("provider_specific_entry") or {}), model
|
||||
|
||||
|
||||
def test_fable_5_2_accepts_the_speed_param_on_the_anthropic_api(local_model_cost_map) -> None:
|
||||
from litellm.llms.anthropic.chat.transformation import AnthropicConfig
|
||||
from litellm.llms.anthropic.common_utils import AnthropicModelInfo
|
||||
|
||||
assert AnthropicModelInfo.supports_fast_mode("claude-fable-5-2", "anthropic") is True
|
||||
assert AnthropicConfig._model_supports_speed_param("claude-fable-5-2", "anthropic") is True
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue