Repository navigation
ValidationException on the model ID — what does it actually mean? #59
|
I get this on a model that is definitely enabled in the console: Model access shows as granted, the region is right, and the same code works for a colleague. What am I missing? |
Replies: 1 comment
|
Your colleague is passing an inference profile ID; you are passing the bare model ID. The error says so, but the wording buries it. What is going on. Many models are not served on-demand under their plain model ID. They are invoked through a cross-Region inference profile, whose ID carries a geography prefix — Find what your region offers: aws bedrock list-inference-profiles --region us-east-1 \
--query 'inferenceProfileSummaries[].[inferenceProfileId,status]' --output tableUse that value as The part that catches people next. A geographic profile routes across several regions, and you need model access in every region it routes to — not just the one you are calling from. A profile fanning out to IAM. If you scope Bedrock permissions, grant both ARNs — the profile and the underlying foundation models: "Resource": [
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-*",
"arn:aws:bedrock:us-east-1:123456789012:inference-profile/us.anthropic.claude-*"
]Granting only the profile is a common cause of a confusing denial. Related. Troubleshooting covers the other errors this curriculum produces; IAM for agents has the full policy shapes. |
Your colleague is passing an inference profile ID; you are passing the bare model ID. The error says so, but the wording buries it.
What is going on. Many models are not served on-demand under their plain model ID. They are invoked through a cross-Region inference profile, whose ID carries a geography prefix —
us.,eu.and others depending on the geography.Find what your region offers:
aws bedrock list-inference-profiles --region us-east-1 \ --query 'inferenceProfileSummaries[].[inferenceProfileId,status]' --output tableUse that value as
modelId