Repository navigation
fix: resolve Bedrock and cross-region Anthropic model IDs in model info lookup - #7834
Closed
Lucas Kim (kimnamu) wants to merge 1 commit into
Closed
Lucas Kim (kimnamu) wants to merge 1 commit into
Lucas Kim (kimnamu) wants to merge 1 commit into
Conversation
…fo lookup The Anthropic model-info matcher in _model_info.py is prefix-anchored (model.startswith(...)), so AWS Bedrock model IDs and cross-region inference profiles (anthropic.*, us./eu./apac./global.anthropic.*, with a -vN:M suffix) never resolve. get_info() then raises KeyError and get_token_limit() silently returns the 100000 fallback instead of the table value. Add a small _normalize_model() helper, shared by get_info() and get_token_limit(), that strips the optional region/provider prefix and the Bedrock version suffix so these IDs resolve to the existing table entries the same way the native IDs do. Native IDs are unchanged. Table values are out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks done
This was referenced Sep 11, 2026
Author
|
Thank you to the AutoGen maintainers for the years of work on this project and its Anthropic and Bedrock model clients, and for stating the archived status clearly in #8366. With the README now saying Microsoft is not providing bug fixes for AutoGen, I'm closing this PR as I offered in #7833. The lookup gap is still on How this was run
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks to the maintainers. Small bug fix (no new features — consistent with maintenance-mode scope). This fills a gap so Bedrock-hosted Claude IDs resolve like the native ones — native Anthropic IDs already resolve; only the Bedrock/cross-region forms were missing.
Fixes #7833.
Problem / cause
The matcher in
_model_info.pyis prefix-anchored (model.startswith(model_id.split("-2")[0])), soanthropic./us./eu./apac./global.anthropic.prefixes and the-vN:Msuffix never match →get_inforaisesKeyError,get_token_limitsilently returns the 100000 fallback.Change
A small shared
_normalize_model()helper, called by bothget_infoandget_token_limit, strips the optional[region.]anthropic.prefix and-vN:Msuffix. Native IDs and table values unchanged.get_info("us.anthropic.claude-3-5-sonnet-20240620-v1:0")claude-3-5-sonnet-20240620entryget_token_limit("anthropic.claude-…-v1:0")global./eu./apac.prefixesclaude-3-5-sonnet-20240620,claude-opus-4-0)_MODEL_INFO/_MODEL_TOKEN_LIMITStable valuesTests
Added a parametrized no-network test; reverting the source (test kept) → 5 failures with the KeyError above; restored → 5 pass; full no-network anthropic suite 23 passed.
ruff format/checkclean,pyright0 errors.Out of scope / follow-up: correcting individual table values (context windows etc.) is a separate data concern, intentionally left out to keep this minimal.
This contribution was prepared with the help of an AI agent (Claude Code); a human reviewed the change, rationale, and test results before submission.