You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when using the cross inference profileid, I receive this error: An error occurred while initializing the BedrockChatCompletionService: Unsupported model provider: us
When using a non cross inference profileid, just the modelid, I get this message from AWS: Invocation of model ID anthropic.claude-3-5-sonnet-20241022-v2:0 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.
To Reproduce
Steps to reproduce the behavior:
kernelBuilder.AddBedrockChatCompletionService("us.anthropic.claude-3-5-sonnet-20241022-v2:0");
Expected behavior
I would expect either the cross region profile id to work with the semanic kernal when ondemand does not work.
Screenshots
If applicable, add screenshots to help explain your problem.
changed the title [-]Bug: AWS Bedrock Connector - Cross-region inference Not Supported[/-][+].Net: Bug: AWS Bedrock Connector - Cross-region inference Not Supported[/+]on Feb 28, 2025
File "/Users/leonardopinheiro/git/autogen/python/packages/autogen-ext/src/autogen_ext/models/semantic_kernel/_sk_chat_completion_adapter.py", line 565, in create_stream
async forstreaming_messagesin self._sk_client.get_streaming_chat_message_contents(
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/semantic_kernel/connectors/ai/chat_completion_client_base.py", line 261, in get_streaming_chat_message_contents
async forstreaming_chat_message_contentsin self._inner_get_streaming_chat_message_contents(
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/semantic_kernel/utils/telemetry/model_diagnostics/decorators.py", line 164, in wrapper_decorator
async forstreaming_chat_message_contentsin completion_func(*args, **kwargs):
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/semantic_kernel/connectors/ai/bedrock/services/bedrock_chat_completion.py", line 134, in _inner_get_streaming_chat_message_contents
model_info = await self.get_foundation_model_info(self.ai_model_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/semantic_kernel/connectors/ai/bedrock/services/bedrock_base.py", line 24, in get_foundation_model_info
response = await run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/semantic_kernel/connectors/ai/bedrock/services/model_provider/utils.py", line 26, in run_in_executor
return await asyncio.get_event_loop().run_in_executor(executor, partial(func, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/leonardopinheiro/.pyenv/versions/3.11.8/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/botocore/client.py", line 569, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/leonardopinheiro/git/autogen/python/.venv/lib/python3.11/site-packages/botocore/client.py", line 1023, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the GetFoundationModel operation: The provided model identifier is invalid.
This by design from AWS Cross Region Inference profile.
When you have a model that is Cross Region, you need to specify the top-level region and the API will get your request to the closest sub-region from your originating request.
Activity
[-]Bug: AWS Bedrock Connector - Cross-region inference Not Supported[/-][+].Net: Bug: AWS Bedrock Connector - Cross-region inference Not Supported[/+]lspinheiro commentedon Mar 5, 2025
I'm currently facing the same issue for python. Here is my configuration and the error.
fix: fixes microsoft#10738 by adding function for scrubbing cross-reg…
Merge pull request #4 from glorious-beard/glorious-beard/367-fix-bedr…
.Net: scrub preceding cross region identifier in Amazon Bedrock model…
fix: fixes microsoft#10738 by adding function for scrubbing cross-reg…
github-actions commentedon Jun 4, 2025
This issue is stale because it has been open for 90 days with no activity.
henriqueholtz commentedon Jun 11, 2025
Similar here if using any model
{...}-v2:0:{...} Reason: The provided model identifier is invalid {...}The work around is use the "same" model but using
{...}-v1:0. E.g.:us.anthropic.claude-3-5-haiku-20241022-v1:0=> OKus.anthropic.claude-3-5-haiku-20241022-v2:0=> ERRORYet, not sure if it's a Semantic Kernel error or it's something on AWS's side.
rogerbarreto commentedon Jun 27, 2025
This by design from AWS Cross Region Inference profile.
When you have a model that is Cross Region, you need to specify the top-level region and the API will get your request to the closest sub-region from your originating request.
See: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html
.Net: scrub preceding cross region identifier in Amazon Bedrock model…