Skip to content

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
acn-ericlaw merged 1 commit into
mainfrom
feat/llm-helper-bedrock
Oct 14, 2026
Merged

acn-ericlaw merged 1 commit into
mainfrom
feat/llm-helper-bedrock

Conversation

@acn-ericlaw

@acn-ericlaw acn-ericlaw commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

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 in AWS_BEARER_TOKEN_BEDROCK; the region from llm.aws.region or AWS_REGION (without one, 503 AWS region missing instead of a call); the anthropic. 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 a 503 AWS credential missing by name; llm.health reporting region and resolving the chain the way a call would, without spending a token. The new bedrock extra 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-iam described 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 -q 196 green - no token spent, no credential needed

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

🤖 Generated with Claude Code

…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
acn-ericlaw merged commit c25ba35 into main Oct 14, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/llm-helper-bedrock branch October 14, 2026 00:09
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant