- Newest
- Most votes
- Most comments
I apologize, but I don't have specific information about getting the token count for the meta-llama3 70B Instruct model through Amazon Bedrock before sending the prompt.
However, I can provide some general guidance based on how token counting works with other models in Bedrock:
-
Bedrock doesn't provide a built-in method to count tokens before sending a request.
-
The exact tokenization method can vary between models, so an precise count would require using the same tokenizer as the specific model.
-
For many models, you can get an approximate token count from the API response after invoking the model. The response often includes metadata about input and output token counts.
-
If you need a precise count before sending, you may need to implement your own tokenizer that matches the one used by the meta-llama3 model, or use a third-party library designed for this purpose.
-
As an alternative, you could send a test request with a small max_tokens limit and examine the response metadata to get the input token count, without generating a full response.
For the most accurate information, I recommend checking the latest Amazon Bedrock documentation or contacting AWS support for guidance specific to the meta-llama3 70B Instruct model.
Sources
Integrate foundation models into your code with Amazon Bedrock | AWS Machine Learning Blog
PromptModelInferenceConfiguration - Amazon Bedrock
Not in Bedrock. But here is an external tool : https://lunary.ai/llama3-tokenizer
answered a year ago
Relevant content
asked 2 years ago
asked a year ago
asked 2 months ago
- AWS OFFICIALUpdated a year ago
