From 0a7e0f2333814bf7d69ed87840ddc77767fce43a Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Mon, 12 Oct 2026 21:14:22 +0200 Subject: [PATCH 1/2] fix: Resolve Bedrock endpoint from resolved api_base bedrock_endpoint() hardcoded the endpoint/host iso building it via the result from the configured/resolved pipeline. This change builds the bedrock URL from the resolved api_base instead. This allows a user to override the Bedrock endpoint through the BEDROCK_API_BASE env variable. This matches the behaviour of the other domains/llms. --- cecli/helpers/llms/domains/bedrock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cecli/helpers/llms/domains/bedrock.py b/cecli/helpers/llms/domains/bedrock.py index 68681504bab..ba6f7f3d809 100644 --- a/cecli/helpers/llms/domains/bedrock.py +++ b/cecli/helpers/llms/domains/bedrock.py @@ -194,7 +194,7 @@ def bedrock_endpoint(resolved: Dict[str, Any]) -> str: ) route = resolved["route"] - return f"https://bedrock-runtime.{region}.amazonaws.com/model/{route}/converse" + return f"{resolved['api_base']}/model/{route}/converse" def _signed_headers( From ec4f38c907873113573d3bef1de6a3e0277fe7ff Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Mon, 12 Oct 2026 21:33:46 +0200 Subject: [PATCH 2/2] feat: add test to ensure api_base can override bedrock base url --- tests/helpers/test_llms_hyperscalers.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/helpers/test_llms_hyperscalers.py b/tests/helpers/test_llms_hyperscalers.py index 036f16ead6d..33f5c5396d0 100644 --- a/tests/helpers/test_llms_hyperscalers.py +++ b/tests/helpers/test_llms_hyperscalers.py @@ -153,6 +153,21 @@ def test_bedrock_endpoint_requires_region(): raise AssertionError("expected ValueError without a region") +def test_bedrock_endpoint_built_from_resolved_api_base(monkeypatch): + # The Converse URL is assembled from resolved["api_base"] verbatim rather + # than a hardcoded public host, so a custom endpoint (VPC endpoint, proxy, + # LocalStack, ...) resolved onto api_base is honored. + monkeypatch.setenv("AWS_REGION_NAME", "us-east-1") + resolved = { + "route": "anthropic.claude-sonnet", + "api_base": "https://bedrock.internal.example.com", + } + url = bedrock_endpoint(resolved) + assert url == ( + "https://bedrock.internal.example.com/model/anthropic.claude-sonnet/converse" + ) + + # --------------------------------------------------------------------------- # Chat-family wiring: signer hook + extra_query # ---------------------------------------------------------------------------