npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cat-factory/provider-bedrock

v0.7.543

Published

Opt-in AWS Bedrock model registry for the Agent Architecture Board's AI provisioning facade. Mix into a CompositeModelProvider to add the `bedrock` provider.

Downloads

14,757

Readme

@cat-factory/provider-bedrock

Opt-in AWS Bedrock model resolver for cat-factory's AI provisioning facade: lets a deployment serve LLMs through Amazon Bedrock alongside (or instead of) the built-in direct vendors.

Why this is its own package

Bedrock support pulls in the AWS Bedrock SDK (@ai-sdk/amazon-bedrock + ai), which is heavy and irrelevant to any deployment that doesn't use Bedrock. Keeping it in a separate opt-in package means the core packages and the Cloudflare Worker base registry stay free of the SDK: only a facade that actually wires Bedrock pays for it. It contributes a single provider (bedrock) to a CompositeModelProvider through the neutral ModelResolver / ProviderRegistry seam from @cat-factory/agents; no model-resolution logic is duplicated.

Enabling it

The package exports two helpers:

  • bedrockResolver(opts) → a ModelResolver for the bedrock provider.
  • bedrockRegistry(opts) → a ProviderRegistry ({ bedrock: resolver }) ready to mix in.

Node / local facade: via env

The Node facade wires Bedrock automatically when BEDROCK_REGION is set (see createNodeModelProviderResolver in backend/runtimes/node/src/modelProvider.ts); it appends bedrockRegistry(...) to the composite's extra registries:

// ONE pair of readers, shared with the model catalog's `bedrock` capability: see below.
const bedrockRegion = bedrockRegionFromEnv(env)
if (bedrockRegion) {
  const supportedModels = bedrockAllowListFromEnv(env)
  extraRegistries.push(
    bedrockRegistry({
      region: bedrockRegion,
      accessKeyId: env.AWS_ACCESS_KEY_ID,
      secretAccessKey: env.AWS_SECRET_ACCESS_KEY,
      sessionToken: env.AWS_SESSION_TOKEN,
      ...(supportedModels ? { supportedModels: [...supportedModels] } : {}),
    }),
  )
}

So a Node/local deployment opts in purely with env: BEDROCK_REGION (required to enable), optional AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN (omit to use the ambient AWS credential chain; instance role, ~/.aws, etc.), and optional BEDROCK_MODELS (comma-separated allow-list).

BEDROCK_MODELS does double duty, which is why it is parsed by bedrockAllowListFromEnv (@cat-factory/server) rather than inline: the same value becomes this resolver's allow-list AND ProviderCapabilities.bedrockModels, which decides whether a catalog model's bedrock flavour is selectable in the picker. Parsed separately, the picker could offer an id this resolver throws on. Details: model-support.md §8.

Cloudflare Worker facade: via registerModelRegistry

The Worker's base registry ships without the SDK; a deployment mixes Bedrock in at startup through the installation-level model-provider extension point (see backend/runtimes/cloudflare/src/infrastructure/ai/registries.ts):

import { registerModelRegistry } from '@cat-factory/worker'
import { bedrockRegistry } from '@cat-factory/provider-bedrock'

registerModelRegistry((env) => bedrockRegistry({ region: env.BEDROCK_REGION }))

Registration is process-wide and read by every buildContainer(env) call, so the provider reaches all paths (HTTP requests, the durable Workflow driver, and the cron sweeper) not just one entry point. The factory receives the runtime env, so credentials/region come from the deployment's configuration.

The registration is also what unlocks the picker flavour on this facade. The Worker reads BEDROCK_REGION / BEDROCK_MODELS for the per-model enablement, but grants the capability only when a registered registry can actually serve bedrock (bedrockModelsCapability in ai/registries.ts): the env vars alone don't prove this package was mixed in, and offering the flavour on them would put rows in the picker whose dispatch fails. Set-but-unregistered logs a warning naming the missing registerModelRegistry call.

How it resolves a model

The resolver forwards ref.model to the Bedrock provider (createAmazonBedrock(...)). A model is addressed by its Bedrock model id (e.g. anthropic.claude-3-5-sonnet-20240620-v1:0). When supportedModels is set, resolving anything outside the allow-list throws Unsupported Bedrock model: <id> up front, so a misconfigured model fails fast with a clear message instead of a deep AWS SDK error. Omit supportedModels to forward any model id.

Config (BedrockResolverOptions)

| Option | Purpose | | ----------------- | ----------------------------------------------------------------------------------------- | | region | AWS region, e.g. us-east-1. | | accessKeyId | Explicit AWS access key; omit to use the default AWS credential chain. | | secretAccessKey | Explicit AWS secret key. | | sessionToken | Explicit AWS session token (temporary credentials). | | baseURL | Override the Bedrock base URL (e.g. a VPC endpoint). | | supportedModels | Allow-list of Bedrock model ids; resolving anything outside it throws. Omit to allow any. |

Related

Part of cat-factory's opt-in AWS stack alongside @cat-factory/provider-s3 (blob storage) and @cat-factory/eks (runner + environment backends). Each is independent and registers into its own seam: mix in only what you use.