Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions agent/anthropic_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def _is_claude_model(model: str | None) -> bool:
_ANTHROPIC_OUTPUT_LIMITS = {
# Mythos-class named models (claude-fable-5, …) — 1M context, reasoning
"claude-fable": 128_000,
# Claude Sonnet 5
"claude-sonnet-5": 128_000,
# Claude 4.8
"claude-opus-4-8": 128_000,
# Claude 4.7
Expand Down
1 change: 1 addition & 0 deletions agent/bedrock_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ def classify_bedrock_error(error_message: str) -> str:

BEDROCK_CONTEXT_LENGTHS: Dict[str, int] = {
# Anthropic Claude models on Bedrock
"anthropic.claude-sonnet-5": 1_000_000,
"anthropic.claude-opus-4-6": 200_000,
"anthropic.claude-sonnet-4-6": 200_000,
"anthropic.claude-sonnet-4-5": 200_000,
Expand Down
1 change: 1 addition & 0 deletions agent/model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def _save_model_metadata_disk_cache(data: Dict[str, Dict[str, Any]]) -> None:
# OpenRouter-prefixed models resolve via OpenRouter live API or models.dev.
"claude-fable-5": 1000000,
"claude-fable": 1000000,
"claude-sonnet-5": 1000000,
"claude-opus-4-8": 1000000,
"claude-opus-4.8": 1000000,
"claude-opus-4-7": 1000000,
Expand Down
1 change: 1 addition & 0 deletions agent/reasoning_timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
# ``claude-opus-4`` so non-thinking Claude 3.x or future
# non-reasoning Claude variants don't match.
("claude-opus-4", 240),
("claude-sonnet-5", 180),
("claude-sonnet-4.5", 180),
("claude-sonnet-4.6", 180),
# xAI Grok reasoning variants. Explicit reasoning-only keys
Expand Down
24 changes: 24 additions & 0 deletions agent/usage_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ class CostResult:
source_url="https://platform.claude.com/docs/en/about-claude/pricing",
pricing_version="anthropic-pricing-2026-05",
),
(
"anthropic",
"claude-sonnet-5",
): PricingEntry(
input_cost_per_million=Decimal("3.00"),
output_cost_per_million=Decimal("15.00"),
cache_read_cost_per_million=Decimal("0.30"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anthropic currently lists Sonnet 5 introductory pricing through 2026-08-31 as $2 input / $10 output / $0.20 cache read / $2.50 5-minute cache write per MTok. Please use those effective rates here and in the matching Bedrock entry; $3/$15 is the rate starting 2026-09-01.

cache_write_cost_per_million=Decimal("3.75"),
source="official_docs_snapshot",
source_url="https://platform.claude.com/docs/en/about-claude/pricing",
pricing_version="anthropic-pricing-2026-06",
),
(
"anthropic",
"claude-sonnet-4-6",
Expand Down Expand Up @@ -457,6 +469,18 @@ class CostResult:
source_url="https://aws.amazon.com/bedrock/pricing/",
pricing_version="bedrock-pricing-2026-04",
),
(
"bedrock",
"anthropic.claude-sonnet-5",
): PricingEntry(
input_cost_per_million=Decimal("3.00"),
output_cost_per_million=Decimal("15.00"),
cache_read_cost_per_million=Decimal("0.30"),
cache_write_cost_per_million=Decimal("3.75"),
source="official_docs_snapshot",
source_url="https://aws.amazon.com/bedrock/pricing/",
pricing_version="bedrock-pricing-2026-06",
),
(
"bedrock",
"anthropic.claude-sonnet-4-6",
Expand Down
9 changes: 9 additions & 0 deletions hermes_cli/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# Anthropic
("anthropic/claude-opus-4.8", ""),
("anthropic/claude-opus-4.8-fast", "2x price, higher output speed"),
("anthropic/claude-sonnet-5", ""),
("anthropic/claude-sonnet-4.6", ""),
("anthropic/claude-haiku-4.5", ""),
# OpenAI
Expand Down Expand Up @@ -177,6 +178,7 @@ def _xai_curated_models() -> list[str]:
"nous": [
# Anthropic
"anthropic/claude-opus-4.8",
"anthropic/claude-sonnet-5",
"anthropic/claude-sonnet-4.6",
"anthropic/claude-haiku-4.5",
# OpenAI
Expand Down Expand Up @@ -340,6 +342,7 @@ def _xai_curated_models() -> list[str]:
],
"anthropic": [
"claude-fable-5",
"claude-sonnet-5",
"claude-opus-4-8",
"claude-opus-4-7",
"claude-opus-4-6",
Expand Down Expand Up @@ -376,6 +379,7 @@ def _xai_curated_models() -> list[str]:
"deepseek-ai/DeepSeek-V3.2",
"moonshotai/Kimi-K2.5",
"google/gemini-3.1-flash-lite-preview",
"anthropic/claude-sonnet-5",
"anthropic/claude-sonnet-4.6",
"openai/gpt-5.4",
],
Expand All @@ -400,6 +404,7 @@ def _xai_curated_models() -> list[str]:
"gpt-5-codex",
"gpt-5-nano",
"claude-fable-5",
"claude-sonnet-5",
"claude-opus-4-8",
"claude-opus-4-7",
"claude-opus-4-6",
Expand Down Expand Up @@ -498,6 +503,7 @@ def _xai_curated_models() -> list[str]:
# prefers live discovery via ListFoundationModels + ListInferenceProfiles.
# Use inference profile IDs (us.*) since most models require them.
"bedrock": [
"us.anthropic.claude-sonnet-5",
"us.anthropic.claude-sonnet-4-6",
"us.anthropic.claude-opus-4-6-v1",
"us.anthropic.claude-haiku-4-5-20251001-v1:0",
Expand Down Expand Up @@ -3153,6 +3159,7 @@ def _fetch_github_models(api_key: Optional[str] = None, timeout: float = 5.0) ->
"openai/o3-mini": "gpt-5-mini",
"openai/o4-mini": "gpt-5-mini",
"anthropic/claude-opus-4.6": "claude-opus-4.6",
"anthropic/claude-sonnet-5": "claude-sonnet-5",
"anthropic/claude-sonnet-4.6": "claude-sonnet-4.6",
"anthropic/claude-sonnet-4": "claude-sonnet-4",
"anthropic/claude-sonnet-4.5": "claude-sonnet-4.5",
Expand All @@ -3162,12 +3169,14 @@ def _fetch_github_models(api_key: Optional[str] = None, timeout: float = 5.0) ->
# dot-notation. Accept both so users who configure copilot + a
# default hyphenated Claude model don't hit HTTP 400
# "model_not_supported". See issue #6879.
"claude-sonnet-5": "claude-sonnet-5",
"claude-opus-4-6": "claude-opus-4.6",
"claude-sonnet-4-6": "claude-sonnet-4.6",
"claude-sonnet-4-0": "claude-sonnet-4",
"claude-sonnet-4-5": "claude-sonnet-4.5",
"claude-haiku-4-5": "claude-haiku-4.5",
"anthropic/claude-opus-4-6": "claude-opus-4.6",
"anthropic/claude-sonnet-5": "claude-sonnet-5",
"anthropic/claude-sonnet-4-6": "claude-sonnet-4.6",
"anthropic/claude-sonnet-4-0": "claude-sonnet-4",
"anthropic/claude-sonnet-4-5": "claude-sonnet-4.5",
Expand Down
5 changes: 3 additions & 2 deletions hermes_cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def _supports_same_provider_pool_setup(provider: str) -> bool:
"gpt-4o",
"gpt-4o-mini",
"claude-opus-4.6",
"claude-sonnet-5",
"claude-sonnet-4.6",
"claude-sonnet-4.5",
"claude-haiku-4.5",
Expand All @@ -100,8 +101,8 @@ def _supports_same_provider_pool_setup(provider: str) -> bool:
"arcee": ["trinity-large-thinking", "trinity-large-preview", "trinity-mini"],
"minimax": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
"minimax-cn": ["MiniMax-M2.7", "MiniMax-M2.5", "MiniMax-M2.1", "MiniMax-M2"],
"kilocode": ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4", "google/gemini-3-pro-preview", "google/gemini-3-flash-preview"],
"opencode-zen": ["gpt-5.4", "gpt-5.3-codex", "claude-sonnet-4-6", "gemini-3-flash", "glm-5", "kimi-k2.5", "minimax-m2.7"],
"kilocode": ["anthropic/claude-sonnet-5", "anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "openai/gpt-5.4", "google/gemini-3-pro-preview", "google/gemini-3-flash-preview"],
"opencode-zen": ["gpt-5.4", "gpt-5.3-codex", "claude-sonnet-5", "claude-sonnet-4-6", "gemini-3-flash", "glm-5", "kimi-k2.5", "minimax-m2.7"],
"opencode-go": ["kimi-k2.6", "kimi-k2.5", "glm-5.1", "glm-5", "mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro", "mimo-v2-omni", "minimax-m2.7", "minimax-m2.5", "qwen3.7-max", "qwen3.6-plus", "qwen3.5-plus"],
"huggingface": [
"Qwen/Qwen3.5-397B-A17B", "Qwen/Qwen3-235B-A22B-Thinking-2507",
Expand Down
1 change: 1 addition & 0 deletions tests/agent/test_minimax_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def test_claude_output_unaffected(self):
from agent.anthropic_adapter import _get_anthropic_max_output
# Sanity: Claude limits are not broken by the MiniMax entry
assert _get_anthropic_max_output("claude-sonnet-4-6") == 64_000
assert _get_anthropic_max_output("claude-sonnet-5") == 128_000


class TestMinimaxPreserveDots:
Expand Down
2 changes: 2 additions & 0 deletions tests/hermes_cli/test_anthropic_picker_curated.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ def test_anthropic_curated_alias_survives_when_live_omits_it():
"""A curated alias missing from /v1/models still surfaces (first)."""
curated = M._PROVIDER_MODELS["anthropic"]
assert "claude-fable-5" in curated # sanity: the alias is curated
assert "claude-sonnet-5" in curated # newest Sonnet alias is curated

# Live catalog the API would actually return — no fable-5.
live = ["claude-opus-4-8", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"]
with patch.object(M, "_fetch_anthropic_models", return_value=live):
result = M.provider_model_ids("anthropic")

assert "claude-fable-5" in result
assert "claude-sonnet-5" in result
# Curated order is preserved at the front.
assert result[:len(curated)] == list(curated)

Expand Down