- Newest
- Most votes
- Most comments
The error you're encountering suggests that you're trying to use the Claude 3 model with an API that doesn't support it. The Claude 3 models, including Claude 3 Sonnet, require the use of the Messages API rather than the older Text Completion API.
For batch inference with Claude 3 models, you need to adjust your input format to match the Messages API structure. Instead of using the "prompt" field, you should structure your input as a list of messages. Here's an example of how your input .jsonl file should look:
{"recordId": "0000001XYZ", "modelInput": {"anthropic_version": "bedrock-2023-05-31", "max_tokens": 100, "messages": [{"role": "user", "content": "Sample prompt 1"}]}}
Make sure to update all entries in your input file to follow this format. The "anthropic_version" field is required for Claude 3 models.
Additionally, ensure that you have the necessary permissions and have been granted access to use the Claude 3 model in your region. If you continue to face issues, you may need to check your IAM permissions, verify your model access in the AWS Bedrock console, or contact AWS support for further assistance.
Remember that the Bedrock batch inference feature might still be in preview, which could lead to some inconsistencies or limitations across different regions and models. If you encounter persistent issues, consider using the real-time inference API as an alternative until batch inference is fully supported for your specific use case.
Sources
Accessing Amazon Bedrock Claude-3-Haiku and Claude-3-Sonnet models via Lambda Functions | AWS re:Post
problem with anthropic claude haiku | AWS re:Post
Bedrock API invocation error - on demand throughput isn's supported | AWS re:Post
Relevant content
- AWS OFFICIALUpdated a year ago
