Skip to content

hassantahhan/gen-ai-engineering

Repository files navigation

Generative Artificial Intelligence Engineering Notebooks

This repository provides a collection of Generative AI engineering notebooks that demonstrate how to use Amazon SageMaker JumpStart SDK to customize Large Language Models (LLMs). The notebooks show using the Falcon and other model variants how to apply basic levels of inference customization such as: decoding strategies, prompting techniques, and Retrieval-Augmented Generation. The notebooks are designed to be easy to deploy and follow, making them a good resource for learning about LLM inference customization.

The following Amazon SageMaker Studio notebooks are available in this repository:

  • LLM-Custom-Decoding-Falcon.ipynb demonstrates how to generate text using different decoding strategies with Amazon SageMaker JumpStart SDK and Falcon-7B-Instruct model.

  • LLM-Custom-Prompting-Falcon.ipynb demonstrates how to generate text using prompting engineering techniques with Amazon SageMaker JumpStart SDK and Falcon-7B model.

  • LLM-Custom-RAG-Kendra-Llama2.ipynb demonstrates how to use SageMaker and boto3 SDKs to generate text using the Retrieval-Augmented Generation (RAG) pattern. The notebook implements semantic search using Amazon Kendra enterprise search service. The language model used for text generation is Llama-2-70b-chat.

  • LLM-Custom-RAG-Kendra-Falcon.ipynb demonstrates how to use SageMaker and boto3 SDKs to generate text using the Retrieval-Augmented Generation (RAG) pattern. The notebook implements semantic search using Amazon Kendra enterprise search service. The language model used for text generation is Falcon-40B-Instruct.

  • LLM-Custom-RAG-FlanUL2-GPTJ-Faiss.ipynb demonstrates how to use SageMaker and LangChain python libraries to generate text following the Retrieval-Augmented Generation (RAG) pattern. The notebook implements semantic search using Faiss similarity search library and GPT-J 6B embeddings model. The language model used for text generation is Flan-UL2.

To open a Jupyter Notebook using Amazon SageMaker, consider the two steps below:

  1. Create or Open an Amazon SageMaker Studio Notebook.
  2. Clone this Git Repository in Amazon SageMaker Studio.

The following training courses will help build your knowledge and practical skills with Amazon’s generative AI services:

  1. Coursera: Generative AI with Large Language Models.
  2. Deep Dive: Generative AI Foundations on AWS.