GCRI キタ━━━━(゚∀゚)━━━━!!
今まで定められたリージョン間での推論だったのが、グローバルで推論できるようになりました。
推論方法は Inference Profile Id で Global が生えているのでそれを使うだけです。
$ aws bedrock list-inference-profiles | grep anthropic | grep inferenceProfileArn | grep global
"inferenceProfileArn": "arn:aws:bedrock:us-east-1:290000338583:inference-profile/global.anthropic.claude-sonnet-4-20250514-v1:0",
試すならこれがとても短くて良い。(しらんけど)
import boto3
boto3.client("bedrock-runtime").converse(modelId="arn:aws:bedrock:us-east-1:290000338583:inference-profile/global.anthropic.claude-sonnet-4-20250514-v1:0",messages=[{"role":"user","content":[{"text":"Hi"}]}])
response
{'ResponseMetadata': {'RequestId': '64a7b8c5-ec99-4fb3-ab6f-a7a66adc5695',
'HTTPStatusCode': 200,
'HTTPHeaders': {'date': 'Thu, 04 Sep 2025 01:48:18 GMT',
'content-type': 'application/json',
'content-length': '361',
'connection': 'keep-alive',
'x-amzn-requestid': '64a7b8c5-ec99-4fb3-ab6f-a7a66adc5695'},
'RetryAttempts': 0},
'output': {'message': {'role': 'assistant',
'content': [{'text': 'Hello! How are you doing today? Is there anything I can help you with?'}]}},
'stopReason': 'end_turn',
'usage': {'inputTokens': 8,
'outputTokens': 20,
'totalTokens': 28,
'cacheReadInputTokens': 0,
'cacheWriteInputTokens': 0},
'metrics': {'latencyMs': 1061}}