jupyter-ai icon indicating copy to clipboard operation
jupyter-ai copied to clipboard

Add Llama 3.2 models to Amazon Bedrock Chat

Open srdas opened this issue 1 year ago • 0 comments
trafficstars

Meta released Llama 3.2 models : https://aws.amazon.com/bedrock/llama/ These are included in Bedrock : https://aws.amazon.com/blogs/aws/introducing-llama-3-2-models-from-meta-in-amazon-bedrock-a-new-generation-of-multimodal-vision-and-lightweight-models/

These models are added:

Meta Llama 3.2 1B Instruct 1.x meta.llama3-2-1b-instruct-v1:0 Meta Llama 3.2 3B Instruct 1.x meta.llama3-2-3b-instruct-v1:0 Meta Llama 3.2 11B Instruct 1.x meta.llama3-2-11b-instruct-v1:0 Meta Llama 3.2 90B Instruct 1.x meta.llama3-2-90b-instruct-v1:0

Note: These models need "cross region inference" and tests are needed to see if additional changes are needed for access. https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html

This PR is a work in progress. we have to investigate whether the new handling of cross-region inference which requires passing an "inference profile" when calling the model. This means adding the new models may need updates to langchain and/or langchain-aws to handle these models.

It turns out that we can use this in Jupyter AI by prefixing the model id with region as shown here where the model is is prefixed by .us: image And then we can ask: image The fix would be to take the prefix from the region name field and apply it to the model id, though it seems like a lot of special handling for one model. A second approach is to add model ids for all regions.

srdas avatar Sep 25 '24 20:09 srdas