feat: update to latest Anthropic model lineup (Fable 5, Opus 4.8, Sonnet 5)
Adds claude-fable-5 as a new tier and swaps the default Opus/Sonnet entries from 4.6 to Opus 4.8 / Sonnet 5, with refreshed pricing and context-window metadata.
This commit is contained in:
+1
-1
@@ -10,7 +10,7 @@ DB_MASTER_PASSWORD=change-me-to-a-strong-passphrase
|
|||||||
PORT=8080
|
PORT=8080
|
||||||
|
|
||||||
# Default model pre-selected in chat UI (leave empty to use the first available model)
|
# Default model pre-selected in chat UI (leave empty to use the first available model)
|
||||||
# DEFAULT_CHAT_MODEL=claude-sonnet-4-6
|
# DEFAULT_CHAT_MODEL=claude-sonnet-5
|
||||||
|
|
||||||
# Main app database — PostgreSQL (shared postgres service)
|
# Main app database — PostgreSQL (shared postgres service)
|
||||||
AIDE_DB_URL=postgresql://aide:change-me@postgres:5432/aide
|
AIDE_DB_URL=postgresql://aide:change-me@postgres:5432/aide
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ TEMPLATES: list[dict] = [
|
|||||||
"suggested_schedule": "",
|
"suggested_schedule": "",
|
||||||
"suggested_tools": ["web"],
|
"suggested_tools": ["web"],
|
||||||
"prompt_mode": "combined",
|
"prompt_mode": "combined",
|
||||||
"model": "claude-sonnet-4-6",
|
"model": "claude-sonnet-5",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "download-stats",
|
"id": "download-stats",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ from .base import AIProvider, ProviderResponse, ToolCallResult, UsageStats
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_MODEL = "claude-sonnet-4-6"
|
DEFAULT_MODEL = "claude-sonnet-5"
|
||||||
|
|
||||||
|
|
||||||
class AnthropicProvider(AIProvider):
|
class AnthropicProvider(AIProvider):
|
||||||
|
|||||||
+28
-16
@@ -17,30 +17,42 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
# Current Anthropic models (update when new ones ship)
|
# Current Anthropic models (update when new ones ship)
|
||||||
_ANTHROPIC_MODELS = [
|
_ANTHROPIC_MODELS = [
|
||||||
"anthropic:claude-opus-4-6",
|
"anthropic:claude-fable-5",
|
||||||
"anthropic:claude-sonnet-4-6",
|
"anthropic:claude-opus-4-8",
|
||||||
|
"anthropic:claude-sonnet-5",
|
||||||
"anthropic:claude-haiku-4-5-20251001",
|
"anthropic:claude-haiku-4-5-20251001",
|
||||||
]
|
]
|
||||||
|
|
||||||
_ANTHROPIC_MODEL_INFO = [
|
_ANTHROPIC_MODEL_INFO = [
|
||||||
{
|
{
|
||||||
"id": "anthropic:claude-opus-4-6",
|
"id": "anthropic:claude-fable-5",
|
||||||
"provider": "anthropic",
|
"provider": "anthropic",
|
||||||
"bare_id": "claude-opus-4-6",
|
"bare_id": "claude-fable-5",
|
||||||
"name": "Claude Opus 4.6",
|
"name": "Claude Fable 5",
|
||||||
"context_length": 200000,
|
"context_length": 1000000,
|
||||||
"description": "Anthropic's most powerful model. Best for complex reasoning, nuanced writing, and sophisticated analysis.",
|
"description": "Anthropic's most capable widely-released model. Best for the most demanding reasoning and long-horizon agentic work.",
|
||||||
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
||||||
"pricing": {"prompt_per_1m": 15.00, "completion_per_1m": 75.00},
|
"pricing": {"prompt_per_1m": 10.00, "completion_per_1m": 50.00},
|
||||||
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "anthropic:claude-sonnet-4-6",
|
"id": "anthropic:claude-opus-4-8",
|
||||||
"provider": "anthropic",
|
"provider": "anthropic",
|
||||||
"bare_id": "claude-sonnet-4-6",
|
"bare_id": "claude-opus-4-8",
|
||||||
"name": "Claude Sonnet 4.6",
|
"name": "Claude Opus 4.8",
|
||||||
"context_length": 200000,
|
"context_length": 1000000,
|
||||||
"description": "Best balance of speed and intelligence. Ideal for most tasks requiring strong reasoning with faster response times.",
|
"description": "Anthropic's most capable Opus-tier model. Best for complex reasoning, nuanced writing, and sophisticated analysis.",
|
||||||
|
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
||||||
|
"pricing": {"prompt_per_1m": 5.00, "completion_per_1m": 25.00},
|
||||||
|
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "anthropic:claude-sonnet-5",
|
||||||
|
"provider": "anthropic",
|
||||||
|
"bare_id": "claude-sonnet-5",
|
||||||
|
"name": "Claude Sonnet 5",
|
||||||
|
"context_length": 1000000,
|
||||||
|
"description": "Best balance of speed and intelligence. Near-Opus quality on coding and agentic work at Sonnet cost.",
|
||||||
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
||||||
"pricing": {"prompt_per_1m": 3.00, "completion_per_1m": 15.00},
|
"pricing": {"prompt_per_1m": 3.00, "completion_per_1m": 15.00},
|
||||||
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
||||||
@@ -53,7 +65,7 @@ _ANTHROPIC_MODEL_INFO = [
|
|||||||
"context_length": 200000,
|
"context_length": 200000,
|
||||||
"description": "Fastest and most compact Claude model. Great for quick tasks, simple Q&A, and high-throughput workloads.",
|
"description": "Fastest and most compact Claude model. Great for quick tasks, simple Q&A, and high-throughput workloads.",
|
||||||
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
"capabilities": {"vision": True, "tools": True, "online": False, "image_gen": False},
|
||||||
"pricing": {"prompt_per_1m": 0.80, "completion_per_1m": 4.00},
|
"pricing": {"prompt_per_1m": 1.00, "completion_per_1m": 5.00},
|
||||||
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
"architecture": {"tokenizer": "claude", "modality": "text+image->text"},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -380,8 +392,8 @@ def get_model_pricing(model_id: str) -> tuple[float | None, float | None]:
|
|||||||
Returns (None, None) if pricing is unknown for this model.
|
Returns (None, None) if pricing is unknown for this model.
|
||||||
|
|
||||||
Handles multiple formats:
|
Handles multiple formats:
|
||||||
"anthropic:claude-sonnet-4-6" — prefixed (canonical)
|
"anthropic:claude-sonnet-5" — prefixed (canonical)
|
||||||
"claude-sonnet-4-6" — bare Anthropic ID (stored by Anthropic provider)
|
"claude-sonnet-5" — bare Anthropic ID (stored by Anthropic provider)
|
||||||
"openrouter:openai/gpt-4o" — prefixed OpenRouter ID
|
"openrouter:openai/gpt-4o" — prefixed OpenRouter ID
|
||||||
"openai/gpt-4o" — bare OpenRouter ID (stored by some agents)
|
"openai/gpt-4o" — bare OpenRouter ID (stored by some agents)
|
||||||
"openai:gpt-4o" — prefixed OpenAI ID
|
"openai:gpt-4o" — prefixed OpenAI ID
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ async def get_provider_for_model(model_str: str, user_id: str | None = None) ->
|
|||||||
|
|
||||||
If the model string has no provider prefix, the default provider is used.
|
If the model string has no provider prefix, the default provider is used.
|
||||||
Examples:
|
Examples:
|
||||||
"anthropic:claude-sonnet-4-6" → (AnthropicProvider, "claude-sonnet-4-6")
|
"anthropic:claude-sonnet-5" → (AnthropicProvider, "claude-sonnet-5")
|
||||||
"openrouter:openai/gpt-4o" → (OpenRouterProvider, "openai/gpt-4o")
|
"openrouter:openai/gpt-4o" → (OpenRouterProvider, "openai/gpt-4o")
|
||||||
"claude-sonnet-4-6" → (default_provider, "claude-sonnet-4-6")
|
"claude-sonnet-5" → (default_provider, "claude-sonnet-5")
|
||||||
"""
|
"""
|
||||||
_known = {"anthropic", "openrouter", "openai"}
|
_known = {"anthropic", "openrouter", "openai"}
|
||||||
if ":" in model_str:
|
if ":" in model_str:
|
||||||
|
|||||||
Reference in New Issue
Block a user