Document size limitations

0

Hi all, I am using AWS's sdk to interact with AWS bedrock. I am making a conversecommand call and providing a text, and two document objects as parameters to the converse command api. From what I am reading in your documentation (here), the max document size is 4.5MB per document. However when I make this call, I am seeing the following error. I have verified that the byteArray is less than the stated 4.5MB limit size. Any suggestions or reasons why this error is occurring?

I had referred to another thread: https://repost.aws/questions/QU-Dq5zDLJQrW1MoW3oogPvQ/amazon-bedrock-converse-api-actual-maximum-file-size-limit but the sizes I am working with are less than 4MB. One document is sized 3.11MB, and the other is 3.8MB

 const exception = new ValidationException({
                    ^

ValidationException: The model returned the following errors: Input is too long for requested model.
1 Answer
0

The error you're encountering suggests that while your individual document sizes are within the stated 4.5MB limit, there may be other factors contributing to the issue:

  1. Combined size: Although each document is under 4.5MB, the total size of both documents (3.11MB + 3.8MB = 6.91MB) exceeds the limit. The Converse API allows up to five documents, but each must be no more than 4.5MB individually.

  2. Encoding overhead: When sending documents through the API, there might be additional encoding (such as base64) applied, which can increase the effective size of the data being transmitted.

  3. Token limit: Even if the file size is within limits, the model may have a maximum token count it can process. Your documents, while under the byte size limit, may exceed the token limit for the model you're using.

  4. Text content: Remember that in addition to the documents, you're also sending text. The combined size of all content (text + documents) might be pushing you over a limit.

To resolve this issue, you could try:

  1. Reducing the size of your documents further, aiming for a combined size well under 4.5MB.
  2. Splitting your content across multiple API calls if possible.
  3. Checking if your text content can be reduced.
  4. Verifying that you're not exceeding any token limits for your chosen model.

If the issue persists even after these adjustments, it would be advisable to contact AWS support for more specific guidance on your use case.
Sources
Amazon Bedrock Converse API: Actual maximum file size limit | AWS re:Post
Message - Amazon Bedrock
Using the Converse API - Amazon Bedrock

profile picture
answered 10 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions