Repository navigation
feat(llm-helper): AWS Bedrock as the second backend - the SDK's Bedrock client, IAM credentials, the anthropic. model prefix, no server-side fallbacks - #43
Merged
Conversation
…ck client, IAM credentials, the anthropic. model prefix, no server-side fallbacks llm.backend: 'bedrock' builds the SDK's AsyncAnthropicBedrockMantle over the AWS credential chain (or a Bedrock API key in AWS_BEARER_TOKEN_BEDROCK), with the region from llm.aws.region or AWS_REGION - without one the helper answers 503 AWS region missing instead of starting a call. A bare model id is sent with the anthropic. prefix, an id already spelled for Bedrock as written; server-side refusal fallbacks are never sent there; a call whose credential chain is empty is a 503 AWS credential missing by name; llm.health reports the region and resolves the chain the way a call would, without spending a token. The new bedrock extra adds boto3. The Backend seam carries it (backend_for), so the routes and the contract are unchanged; the shared vector file gains three Bedrock cases (66, byte-identical with the Node pack) and the client, region and credential checks are pinned by unit tests that run with no AWS environment at all.
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
…(the Node twin #111); the live drive pending Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Oct 14, 2026
… drive is the thread's remaining step Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AWS Bedrock as the LLM helper's second backend, selected with
llm.backend: 'bedrock': the SDK's Bedrock client (AsyncAnthropicBedrockMantle) over the AWS credential chain through IAM, or a Bedrock API key inAWS_BEARER_TOKEN_BEDROCK; the region fromllm.aws.regionorAWS_REGION(without one,503 AWS region missinginstead of a call); theanthropic.prefix for a bare model id, an id already spelled for Bedrock sent as written; no server-side refusal fallbacks (Bedrock offers none); a call whose credential chain is empty a503 AWS credential missingby name;llm.healthreportingregionand resolving the chain the way a call would, without spending a token. The newbedrockextra adds boto3 (pip install 'mercury-composable[llm,bedrock]'); the Claude API install stays lean without it.The seam the helper was built with carries it:
backend_for(name, client)gives a route its model spelling, its fallback support and its credential check, and nothing else in the module knows which route answered. The routes and the contract are unchanged. The shared vector file gains three Bedrock cases (66, byte-identical with the Node twin mercury-nodejs #111, whose harness installs its fake under the named backend's shape the same way); the Bedrock client, its region and credential checks are pinned by unit tests that run in a process with no AWS environment at all.Why
The AI SDLC epic resumes with AWS Bedrock as its first sprint: enterprise security policies forbid a vendor API key, so the AI node's access to the models rides the cloud platform's own credential chain - the concept doc's Q2, absorbed at client construction only, the engines untouched. The open thread
llm-helper-bedrock-iamdescribed exactly this shape; this PR builds it. The live drive - a wrong credential first, then real calls through an engine - needs an account with Bedrock model access and follows separately.Gates
ruff check .,basedpyright(0 errors),pytest -q196 green - no token spent, no credential neededCo-Authored-By: Claude Fable 5.1 noreply@anthropic.com
🤖 Generated with Claude Code