:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(llm-gateway): add claude sonnet 5 (#67138)
Richard Solomouc40700a824d7
diff --git a/services/llm-gateway/src/llm_gateway/bedrock.py b/services/llm-gateway/src/llm_gateway/bedrock.pyindex abf571527362..abf7a596577e 100644--- a/services/llm-gateway/src/llm_gateway/bedrock.py+++ b/services/llm-gateway/src/llm_gateway/bedrock.py@@ -78,6 +78,10 @@ ANTHROPIC_TO_BEDROCK_MODEL_MAP: Final[dict[str, dict[str, str]]] = {"us": "us.anthropic.claude-sonnet-4-6","eu": "eu.anthropic.claude-sonnet-4-6",},+ "claude-sonnet-5": {+ "us": "us.anthropic.claude-sonnet-5",+ "eu": "eu.anthropic.claude-sonnet-5",+ },"claude-haiku-4-5": {"us": "us.anthropic.claude-haiku-4-5-20251001-v1:0","eu": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",diff --git a/services/llm-gateway/src/llm_gateway/products/config.py b/services/llm-gateway/src/llm_gateway/products/config.pyindex 990fd04cb3d7..ca7541ae6d2b 100644--- a/services/llm-gateway/src/llm_gateway/products/config.py+++ b/services/llm-gateway/src/llm_gateway/products/config.py@@ -47,6 +47,7 @@ _POSTHOG_CODE_AGENT_MODELS: Final[frozenset[str]] = frozenset("claude-opus-4-8","claude-sonnet-4-5","claude-sonnet-4-6",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.5","gpt-5.4",@@ -77,6 +78,7 @@ PRODUCTS: Final[dict[str, ProductConfig]] = {"claude-opus-4-7","claude-opus-4-8","claude-sonnet-4-5",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.4","gpt-5.3-codex",diff --git a/services/llm-gateway/tests/test_bedrock.py b/services/llm-gateway/tests/test_bedrock.pyindex 66135ebbe5ed..ec1299e2864d 100644--- a/services/llm-gateway/tests/test_bedrock.py+++ b/services/llm-gateway/tests/test_bedrock.py@@ -121,6 +121,7 @@ class TestBedrockSpecific:pytest.param("claude-sonnet-4-6", "bedrock/us.anthropic.claude-sonnet-4-6", id="anthropic_name_mapped"),pytest.param("claude-opus-4-7", "bedrock/us.anthropic.claude-opus-4-7", id="opus_4_7_inference_profile"),pytest.param("claude-opus-4-8", "bedrock/us.anthropic.claude-opus-4-8", id="opus_4_8_inference_profile"),+ pytest.param("claude-sonnet-5", "bedrock/us.anthropic.claude-sonnet-5", id="sonnet_5_inference_profile"),pytest.param("us.anthropic.claude-sonnet-4-6", "bedrock/us.anthropic.claude-sonnet-4-6", id="already_bedrock_id"),@@ -786,6 +787,7 @@ class TestModelMapping:pytest.param("claude-opus-4-6", "us.anthropic.claude-opus-4-6-v1", id="opus_4_6"),pytest.param("claude-sonnet-4-5", "us.anthropic.claude-sonnet-4-5-20250929-v1:0", id="sonnet_4_5"),pytest.param("claude-sonnet-4-6", "us.anthropic.claude-sonnet-4-6", id="sonnet_4_6"),+ pytest.param("claude-sonnet-5", "us.anthropic.claude-sonnet-5", id="sonnet_5"),pytest.param("claude-haiku-4-5", "us.anthropic.claude-haiku-4-5-20251001-v1:0", id="haiku_4_5"),],)diff --git a/services/llm-gateway/tests/test_product_config.py b/services/llm-gateway/tests/test_product_config.pyindex 863b8c47370f..0fdb82f1033d 100644--- a/services/llm-gateway/tests/test_product_config.py+++ b/services/llm-gateway/tests/test_product_config.py@@ -104,6 +104,7 @@ class TestCheckProductAccess:"claude-opus-4-8","claude-sonnet-4-5","claude-sonnet-4-6",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.5","gpt-5.3-codex",@@ -142,6 +143,7 @@ class TestCheckProductAccess:"claude-opus-4-8","claude-sonnet-4-5","claude-sonnet-4-6",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.5","gpt-5.3-codex",@@ -232,6 +234,7 @@ class TestCheckProductAccess:"claude-opus-4-7","claude-opus-4-8","claude-sonnet-4-5",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.3-codex","gpt-5.2",@@ -311,6 +314,7 @@ class TestCheckProductAccess:"claude-opus-4-7","claude-opus-4-8","claude-sonnet-4-6",+ "claude-sonnet-5","claude-haiku-4-5","gpt-5.3-codex",],