Skip to content

fix(provider): split Bedrock 1M context models into explicit 200K and 1M variants#13324

Open
karlkurzer wants to merge 6 commits intoanomalyco:devfrom
karlkurzer:fix/bedrock-1m-context-split
Open

fix(provider): split Bedrock 1M context models into explicit 200K and 1M variants#13324
karlkurzer wants to merge 6 commits intoanomalyco:devfrom
karlkurzer:fix/bedrock-1m-context-split

Conversation

@karlkurzer
Copy link

@karlkurzer karlkurzer commented Feb 12, 2026

Summary

  • Split Bedrock Claude Opus 4.6, Sonnet 4.5, and Sonnet 4.6 into explicit 200K (default) and
    1M Experimental variants at models.dev ingestion time
  • The 1M variant sends the required anthropicBeta: ["context-1m-2025-08-07"] flag
    via the AI SDK provider options, which Bedrock requires to unlock the 1M context window
  • The 200K default is the safe path, without the beta flag, Bedrock hard-rejects
    requests above 200K tokens
  • Custom user-configured models are not affected by the split

Why

Bedrock enforces a 200K token hard limit on Claude Opus 4.6, Sonnet 4.5, and Sonnet 4.6 unless the
anthropic_beta: ["context-1m-2025-08-07"] flag is included in the request body (AWS docs).

Testing

  • bun test test/provider/provider.test.ts — 74 tests pass (6 new)
  • bun run typecheck — clean

Closes #13199

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found

PR #13200: "fix(provider): split Bedrock Opus 4.6 into 200K and 1M variants"
#13200

Why it's related: This PR appears to be addressing the same issue as PR #13324 — splitting Bedrock Claude models (Opus 4.6 and potentially Sonnet 4.5) into separate 200K and 1M context variants. PR #13200 seems to be the earlier/related work that may have been expanded or revised in PR #13324.

Both PRs reference the same underlying issue (#13199) of Bedrock's 200K hard limit requiring the anthropic_beta flag for 1M context access.

@xeaser
Copy link

xeaser commented Feb 14, 2026

@karlkurzer When can we expect a release with this fix? Thanks!

@karlkurzer
Copy link
Author

@xeaser I am just contributing, not maintaining, so not sure, when/if it will be merged, but given the speed of development on OC, I guess it should not be too long. In the meantime, feel free to checkout my branch :-)

@xeaser
Copy link

xeaser commented Feb 14, 2026

@karlkurzer Oh I thought you're a maintainer.
Yes I'm using a local build of your branch for now, works great!
Thanks!

… 1M variants

Bedrock Claude Opus 4.6 and Sonnet 4.5 support 1M token context, but
only when the anthropic_beta flag context-1m-2025-08-07 is sent in the
request body. Without it, Bedrock enforces a 200K hard limit.

Split these models at models.dev ingestion time into a safe 200K default
and an opt-in 1M Experimental variant that sends the required beta flag
via the AI SDK anthropicBeta provider option. Custom user-configured
models are not affected.

Closes anomalyco#13199
@mharris717
Copy link
Contributor

+1 on experiencing this issue and thinking this PR is likely a good fix

@karlkurzer karlkurzer force-pushed the fix/bedrock-1m-context-split branch from 6c1adbd to 7dce8e7 Compare February 17, 2026 08:32
Sonnet 4.6 (anthropic.claude-sonnet-4-6) also supports 1M context on
Bedrock with the same anthropic_beta flag. Add it to the allowlist so it
gets split into 200K default and 1M Experimental variants.
@karlkurzer karlkurzer changed the title fix(provider): split Bedrock 1M context models into explicit 200K and… fix(provider): split Bedrock 1M context models into explicit 200K and 1M variants Feb 18, 2026
@karlkurzer
Copy link
Author

Added support for Sonnet 4.6, FYI

@myxoh
Copy link

myxoh commented Feb 20, 2026

@adamdotdevin could we perhaps get this reviewed 🙏? Thank you so much for your work on the project!

@inventumamet
Copy link

did you add opus?

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.

Split Bedrock Claude Opus 4.6 into 200K + 1M models and set 1M beta flag

5 participants