Skip to content
Open
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
14 changes: 12 additions & 2 deletions coworker/providers/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,20 @@ class ModelEntry:
# Bedrock ids carry a family segment (claude/ → native Anthropic path, other/ →
# Converse) plus AWS's own `-v<n>:<m>` version suffix. Some regions require the
# `us.`/`eu.` cross-region inference-profile prefix — custom add-model accepts those.
"bedrock:claude/anthropic.claude-sonnet-4-6-v1:0": ModelEntry(
# Claude 5 generation (GA on Bedrock; ids from vendor catalog 2026-08-01):
"bedrock:claude/us.anthropic.claude-fable-5": ModelEntry(
"Claude Fable 5 · AWS Bedrock", _AGENTIC_VISION, 1_000_000
),
"bedrock:claude/us.anthropic.claude-opus-5": ModelEntry(
"Claude Opus 5 · AWS Bedrock", _AGENTIC_VISION, 1_000_000
),
"bedrock:claude/us.anthropic.claude-sonnet-5": ModelEntry(
"Claude Sonnet 5 · AWS Bedrock", _AGENTIC_VISION, 1_000_000
),
"bedrock:claude/us.anthropic.claude-sonnet-4-6": ModelEntry(
"Claude Sonnet 4.6 · AWS Bedrock", _AGENTIC_VISION, 200_000
),
"bedrock:claude/anthropic.claude-haiku-4-5-v1:0": ModelEntry(
"bedrock:claude/us.anthropic.claude-haiku-4-5-20251001-v1:0": ModelEntry(
"Claude Haiku 4.5 · AWS Bedrock", _AGENTIC_VISION, 200_000
),
"bedrock:other/amazon.nova-2-pro-v1:0": ModelEntry(
Expand Down
2 changes: 1 addition & 1 deletion coworker/providers/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def _compat(
),
],
build=_build_bedrock,
recommended_model="claude/anthropic.claude-sonnet-4-6-v1:0",
recommended_model="claude/us.anthropic.claude-sonnet-5",
blurb="Runs models inside your own AWS account. Claude uses Anthropic's native "
"Bedrock path; every other model goes through the Converse API.",
),
Expand Down
23 changes: 20 additions & 3 deletions tests/test_bedrock_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def client(self, service, **kwargs):


def test_bedrock_capabilities_from_matrix_and_fallback():
curated = capabilities_for("bedrock:claude/anthropic.claude-sonnet-4-6-v1:0")
curated = capabilities_for("bedrock:claude/us.anthropic.claude-sonnet-4-6")
assert curated.vision and curated.pdf and curated.parallel_tool_calls
assert capabilities_for("bedrock:other/amazon.nova-2-pro-v1:0").tools
# Custom ids fall back on the family segment: Claude keeps native caps,
Expand All @@ -375,13 +375,30 @@ def test_bedrock_capabilities_from_matrix_and_fallback():
assert custom_other.tools and not custom_other.parallel_tool_calls


def test_bedrock_claude_5_family_in_matrix():
"""Claude 5 generation models (Fable, Opus, Sonnet) are curated with 1M context."""
from coworker.providers.matrix import MATRIX

for mid, label, ctx in [
("bedrock:claude/us.anthropic.claude-fable-5", "Claude Fable 5 · AWS Bedrock", 1_000_000),
("bedrock:claude/us.anthropic.claude-opus-5", "Claude Opus 5 · AWS Bedrock", 1_000_000),
("bedrock:claude/us.anthropic.claude-sonnet-5", "Claude Sonnet 5 · AWS Bedrock", 1_000_000),
]:
assert mid in MATRIX, f"{mid} missing from matrix"
entry = MATRIX[mid]
assert entry.label == label
assert entry.context_window == ctx
caps = capabilities_for(mid)
assert caps.tools and caps.vision and caps.parallel_tool_calls


def test_router_prefix_survives_bedrock_version_colons():
from coworker.providers.router import ProviderRouter

router = ProviderRouter.__new__(ProviderRouter)
model = "bedrock:claude/anthropic.claude-sonnet-4-6-v1:0"
model = "bedrock:claude/us.anthropic.claude-sonnet-4-6"
assert router._provider_name(model) == "bedrock"
assert ProviderRouter._bare(model) == "claude/anthropic.claude-sonnet-4-6-v1:0"
assert ProviderRouter._bare(model) == "claude/us.anthropic.claude-sonnet-4-6"


# -- registry / manager glue -----------------------------------------------------------
Expand Down