Skip to content

Conversation

@chunterb
Copy link

@chunterb chunterb commented Dec 7, 2025

🎯 Changes

βœ… Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@chunterb chunterb marked this pull request as draft December 7, 2025 17:12
interface ModelMeta<TProviderOptions = unknown> {
name: string
id: string
supports: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlemTuzlak I've added this, but curious if this adapter should diverge from how we determine the modalities that a model has, when compared to other adapters (type map)?

I've left the type map for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, we didn't understand each other, yes what you added is what I wanted to see, but I meant in addition to input/output. For example in some model-meta i've done supports.capabilities.[all of the capabilities] and then you can do supports.input as well


const US_LLAMA_4_SCOUT = {
name: 'Llama 4 Scout 17B Instruct (US)',
id: 'us.meta.llama4-scout-17b-instruct-v1:0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the id here seems tied to the region?

Copy link
Author

@chunterb chunterb Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes some of the newer models have inference profiles, including Anthropic ones. https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html

Maybe should have something typed for regions since it's consistent across all models that require it. I have not added any of the EU models, etc yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To simplify, I've left only the ones where the inference profile is required for now.

@chunterb
Copy link
Author

chunterb commented Dec 8, 2025

The Bedrock SDK has been implemented for types only. Problem using it for runtime is that it will not work on Cloudflare due to a FileReader dependency.

For this reason, it is using aws4fetch directly.

* 2. `AWS_DEFAULT_REGION` environment variable
* 3. `'us-east-1'` as final fallback
*/
region?: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we extract the model region from here? so for example if it's eu/us/jp/sa and the model supports eu we can tell the user the model and the region don't match at runtime by throwing or default to a regionless model if it's supported?
eg:
model is anthropic, supported regions are eu and us, user specifies ca, it throws
model is anthropic, supported regions are eu and us, user specifices us, we append it to the model id before sending the request
model is anthropic, regionless, we send the request whatever region user specifies

Copy link
Author

@chunterb chunterb Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d6d66fb

How's this? Added to the model config and check against that at runtime.

inferenceProfile: { regions: ['us', 'eu', 'apac'], required: true },

Where required is optional because some models require the inference profile and others do not.

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.

2 participants