Skip to content

feat: add AWS Bedrock as a model provider - #12

Merged
cport1 merged 1 commit into
mainfrom
feat/aws-bedrock-provider
Jul 1, 2026
Merged

cport1 merged 1 commit into
mainfrom
feat/aws-bedrock-provider

Conversation

@cport1

@cport1 cport1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds AWS Bedrock as a model provider, alongside Anthropic, OpenAI, and Ollama.

It uses the model-agnostic Bedrock Converse API (@aws-sdk/client-bedrock-runtime), so any Converse-capable model works — Anthropic Claude, Meta Llama, Amazon Nova/Titan, Mistral, Cohere, etc.

Details

  • BedrockTranslator built on the existing BaseTranslator abstraction, reusing the shared prompt-building, JSON parsing, batching, rate limiting, and retry logic.
  • Auth: requires aws-region; explicit aws-access-key-id / aws-secret-access-key / aws-session-token are optional and fall back to the default AWS credential chain (so aws-actions/configure-aws-credentials / OIDC just works).
  • New action inputs: aws-region, aws-access-key-id, aws-secret-access-key, aws-session-token.
  • Default model anthropic.claude-3-haiku-20240307-v1:0; added bedrock rate limits.
  • AWS error names/status codes mapped to the repo's AuthenticationError / RateLimitError / retryable TranslatorError.

Usage

```yaml

  • uses: aws-actions/configure-aws-credentials@v4
    with:
    role-to-assume: arn:aws:iam::…:role/bedrock-translate
    aws-region: us-east-1
  • uses: i18n-actions/ai-i18n@v0.9
    with:
    provider: bedrock
    aws-region: us-east-1
    model: anthropic.claude-3-haiku-20240307-v1:0
    target-languages: de,fr,es
    files: 'src/locales/**/*.xliff'
    ```

Tests

  • New BedrockTranslator unit tests (mocked AWS SDK): default model, credential wiring, Converse response parsing, and error mapping.
  • New factory test covering all providers.
  • Bedrock cases added to config schema tests.
  • Full suite: 236 tests, 18 suites — type-check, lint, prettier all green. dist/ rebuilt.

Adds a `bedrock` provider backed by the model-agnostic Bedrock Converse
API (@aws-sdk/client-bedrock-runtime), so any Converse-capable model works
(Anthropic Claude, Meta Llama, Amazon Nova/Titan, Mistral, Cohere).

- New BedrockTranslator on the existing BaseTranslator abstraction,
  reusing shared prompt-building, JSON parsing, batching and retry
- Config/schema/loader wired for `provider: bedrock` with a required
  aws-region and optional explicit credentials (access key / secret /
  session token) that fall back to the default AWS credential chain
- New action inputs: aws-region, aws-access-key-id, aws-secret-access-key,
  aws-session-token
- Provider default model anthropic.claude-3-haiku-20240307-v1:0 and
  bedrock rate limits
- Tests: BedrockTranslator (mocked SDK), factory, and schema coverage
- Docs: README provider section + inputs; repo keywords
@cport1
cport1 force-pushed the feat/aws-bedrock-provider branch from 33b0e3f to 1572b77 Compare July 1, 2026 15:38
@cport1
cport1 merged commit 53a2367 into main Jul 1, 2026
1 check passed
@cport1
cport1 deleted the feat/aws-bedrock-provider branch July 1, 2026 15:38
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