Build a CHATBOT with AWS Amazon Bedrock- Llama 2, Langchain and Streamlit [HANDS-ON]
Вставка
- Опубліковано 11 вер 2024
- This use case is part of my Best Selling Udemy Course on AWS Bedrock and Generative AI and can be accessed from below link :
www.udemy.com/...
In this video we will learn how to build a CHATBOT with AWS Amazon Bedrock- Llama 2, Langchain and Streamlit
This is a hands-on tutorial, where following things will be demonstrated.
- End to End Demo
- Architecture
- Step by Step Coding
Check out other videos in Amazon Bedrock Playlist :
Use Case 1 : Text Summarization with Amazon Bedrock & Generative AI - AWS Bedrock - Cohere Foundation Model + AWS Lambda + API Gateway • Text Summarization wit...
Use Case 2 : Build a CHATBOT with AWS Amazon Bedrock- Llama 2, Langchain and Streamlit
• Build a CHATBOT with A...
Use Case 3 : Build a HR Q and A App with Retrieval Augmentation Generation (RAG), AWS Bedrock, FAISS, Langchain, Streamlit
• Build a HR QnA App usi...
Use Case 4 : Build Serverless e-Learning App using Amazon Bedrock Knowledge Base + AWS Lambda + Claude FM + API Gateway:
• Amazon Bedrock Knowled...
Video 5 : Basics on Vectors, Vector Embeddings, Embedding Models, Chunking, Vector DB , Cosine Similarity, KNN Algorithm :
• What are Vectors, Vect...
- Connect with me on Linkedin to discuss anything related to AWS Generative AI - / rahul-trisal
Check out my other Udemy Courses from below:
AWS Cloud Development Kit (CDK) - V2- www.udemy.com/...
AWS CloudFormation course on Udemy and can be accessed from following link - www.udemy.com/...
Udemy Course Link - www.udemy.com/course/amazon-bedrock-aws-generative-ai-beginner-to-advanced/?referralCode=A02153572B8864F928E7
Thankyou for making amazing video on Bedrock 🎉
Thank you for watching....
Very useful information. keep going.
Awesome, thanks.....
Straight out of the gate those responses are not being parsed correctly, the model is continuing after the stop token, hence the Human response and the Llamas back and forth.
Can you share the git repo for the session code
Excellent!!!
Thank you....
How can we use Bedrock to query data from Database without calling API?
Hi Kunal - You can use Bedrock Agents .....ua-cam.com/video/0JapN3nM9tQ/v-deo.html
wow this something I wanted !! can you tell me which model in AWS is good for finetuning the docs and giving the result very quick.
and could you please make one video on that .
Thanks @abhinay for your feedback...The right Foundation Model will depend on your use case as each model has its own strength and shortcomings
@rahul thanks for the video - can we use our local text files as an input to the LLM like llama2 that can also be deployed on local?
This is great, thanks for sharing. Looking for CHATBOT with AWS Amazon Bedrock & Agent + KB, Claude, Langchain, and Streamlit
Thanks Michael..Will add that....
Hi, Llama 2 Chat models are showing unavailable in all the regions. In which region did you access this model? Are there any alternative models available in AWS to use for this chatbot?
Please replace the model id with following Llama 3 or any other model you may like - "meta.llama3-1-70b-instruct-v1:0"
With release of llama 3, they are depreciating llama -2
I am getting below error
The class `Bedrock` was deprecated in LangChain 0.0.34 and will be removed in 0.3. An updated version of the class exists in the langchain-aws package and should be used instead. To use it run `pip install -U langchain-aws` and import as `from langchain_aws import BedrockLLM`.
Yes correct Neha...please use an updated version...current version seems to be depriciated by Langchain...thank you....
Great video Thanks.
What if I want to integrate or build such chatbot using bedrock for my website ? (not streamlit as frontend) any suggestions or recommendations ?
Yes Indrajit, that should be possible....you can use aws amplify+lambda+langchain+bedrock....
Having trouble in authentication " Could not load credentials to authenticate with AWS client. Please check that credentials in the specified profile name are valid" although I set the tokens properly, any solutions ?
Hi Varun, Looks like your secret key and access keys are not correct. Delete the old iam role credentials and set up a new profile with new credentials....
Is there a way to trim the response. To avoid the unnecessary answers "The Human : and AI: "part
You should be able to parse the response....use the langchain templates...
Is there free trial/tier? for your demo, how much does it cost?
Its not free tier but very very cost effective....few cents for every API request....So, building and testing this...maybe less than $1 assuming you keep number of api request to minimum...Here are more details on pricing ....aws.amazon.com/bedrock/pricing/
I dont see in the code where you added the credentials. But these are not free APIs correct. So where do you do that.? even if you are accessing it from OS you still have to do that using code correct?
Good observation....The api's are not free...credentials were added as part of AWS CLI profile in VSCode....For full use case and installation etc...you can take a look at my Udemy course on Bedrock from the link in description
Why is the LLm model's Output containing the questions and answers for which we didnt ask also , Example : Human : Thats understandable , can you tell me a joke? , Here we have not asked that specific question also
Hi Maruthi, I am not sure if I can get the context of your question completely but the models are not perfect and can sometimes give random answers either because the prompt is not in proper format (each model has a specific prompt format) or model just cant interpret due to lack of sophistication in that area
How do we add Contextual info on this model such that Chatbot can answer contextual questions as well generic answers ?
Thanks
Checkout my Bedrock + RAG video for how to add contextual info to model response - m.ua-cam.com/video/aNj-1wehoEo/v-deo.html&pp=ygULQmVkcm9jayBhd3M%3D
Sir..I am getting an error that "You don't have access to the model with the specified model ID."
Hi Sai - Please request for the model id access from bedrock service in the console
@@trisalrahul sir i requested for the model id access but i am getting a mail "
A payment failed due to an issue with your payment method " I tried changing the payment method to credit card.
@@saisampath8656 - Okay...please raise a ticket with AWS support...they should be able to help...
is it mandatory to configure the aws cli for access key and secret key? Can't we put the key credentials in code or in .env file. and pass it to Bedrock function?
Yea, i think that should work too...
Top!
Thanks …
Which model is good to parse word and pdf documents in bulk
Good question - I am assuming you are refering to RAG based solution - Please check my video on this - ua-cam.com/video/aNj-1wehoEo/v-deo.html
Thank you, What is the Infra requirement for above demo?
It can be deployed on a medium sized EC2 instance..
Did you test it on your local machine? If yes what is RAM size?
@VISHVANI9 - Should not matter.We are using Bedrock for response from foundation model and bedrock is a Serverless service.
can you tell how to install bedrock
try pip install bedrock or install boto3
@@trisalrahul I tried but same error
@dattathreyaa.s.v7846 - what is the error ?
@@trisalrahul I can't explain here, do you have any social media IDs
You need only install boto3 AWS sdk and have key api and secret api key to interact with AWS