- Newest
- Most votes
- Most comments
You're encountering a known limitation with the Amazon Titan Multimodal Embeddings G1 model (amazon.titan-embed-image-v1). The inputTextTokenCount field in the response does not accurately reflect the actual number of tokens processed for longer text inputs.
The Amazon Titan Multimodal Embeddings G1 model has a maximum input text token limit of 256 tokens. However, the inputTextTokenCount value returned in the response appears to cap at 100 regardless of the actual length of your input text. This is not a configuration issue on your end but rather a limitation in how the model reports token usage.
It's important to note that even though the reported count may be inaccurate, the model will still process up to the maximum 256 tokens.
For accurate token counting, you might need to implement your own token counting mechanism. As a rough guideline, English text averages about 4.7 characters per token, which can help you estimate token counts on the client side before sending requests to the model.
If precise token counting is critical for your use case (such as for cost management or usage tracking), you may want to consider monitoring your usage through CloudWatch metrics instead of relying on the inputTextTokenCount value in the response.
Sources
Amazon Titan Multimodal Embeddings G1 model - Token Usage (bedrock) | AWS re:Post
Amazon Titan Multimodal Embeddings G1 model - Amazon Bedrock
How to use Titan embeddings model without going over token limit? | AWS re:Post
Amazon Titan Multimodal Embeddings G1 - Amazon Bedrock
Relevant content
asked a year ago
