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/...

КОМЕНТАРІ • 58

  • @trisalrahul
    @trisalrahul  7 місяців тому +3

    Udemy Course Link - www.udemy.com/course/amazon-bedrock-aws-generative-ai-beginner-to-advanced/?referralCode=A02153572B8864F928E7

  • @shashipal3589
    @shashipal3589 7 місяців тому +3

    Thankyou for making amazing video on Bedrock 🎉

    • @trisalrahul
      @trisalrahul  6 місяців тому

      Thank you for watching....

  • @naveenkumar-ik8bx
    @naveenkumar-ik8bx 5 місяців тому +1

    Very useful information. keep going.

  • @theh1ve
    @theh1ve 4 місяці тому +1

    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.

  • @khandetanvikram
    @khandetanvikram 5 місяців тому +3

    Can you share the git repo for the session code

  • @abhigrd1234
    @abhigrd1234 7 місяців тому +1

    Excellent!!!

  • @kunalpinyani860
    @kunalpinyani860 2 місяці тому +1

    How can we use Bedrock to query data from Database without calling API?

    • @trisalrahul
      @trisalrahul  2 місяці тому

      Hi Kunal - You can use Bedrock Agents .....ua-cam.com/video/0JapN3nM9tQ/v-deo.html

  • @tech4tomorrow
    @tech4tomorrow 6 місяців тому +1

    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 .

    • @trisalrahul
      @trisalrahul  6 місяців тому

      Thanks @abhinay for your feedback...The right Foundation Model will depend on your use case as each model has its own strength and shortcomings

  • @rachitsharma6647
    @rachitsharma6647 3 місяці тому +1

    @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?

  • @michaelwahl313
    @michaelwahl313 6 місяців тому +1

    This is great, thanks for sharing. Looking for CHATBOT with AWS Amazon Bedrock & Agent + KB, Claude, Langchain, and Streamlit

    • @trisalrahul
      @trisalrahul  6 місяців тому +1

      Thanks Michael..Will add that....

  • @onestopzz6446
    @onestopzz6446 Місяць тому +1

    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?

    • @trisalrahul
      @trisalrahul  Місяць тому

      Please replace the model id with following Llama 3 or any other model you may like - "meta.llama3-1-70b-instruct-v1:0"

    • @trisalrahul
      @trisalrahul  Місяць тому

      With release of llama 3, they are depreciating llama -2

  • @nehajaju1071
    @nehajaju1071 4 місяці тому +1

    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`.

    • @trisalrahul
      @trisalrahul  4 місяці тому +1

      Yes correct Neha...please use an updated version...current version seems to be depriciated by Langchain...thank you....

  • @indrajitg4729
    @indrajitg4729 6 місяців тому +1

    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 ?

    • @trisalrahul
      @trisalrahul  6 місяців тому

      Yes Indrajit, that should be possible....you can use aws amplify+lambda+langchain+bedrock....

  • @varun_tech7
    @varun_tech7 6 місяців тому +1

    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 ?

    • @trisalrahul
      @trisalrahul  6 місяців тому

      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....

  • @varun_tech7
    @varun_tech7 6 місяців тому +1

    Is there a way to trim the response. To avoid the unnecessary answers "The Human : and AI: "part

    • @trisalrahul
      @trisalrahul  6 місяців тому +1

      You should be able to parse the response....use the langchain templates...

  • @dangollayan8151
    @dangollayan8151 6 місяців тому +1

    Is there free trial/tier? for your demo, how much does it cost?

    • @trisalrahul
      @trisalrahul  6 місяців тому

      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/

  • @cosmicfluke3718
    @cosmicfluke3718 5 місяців тому +1

    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?

    • @trisalrahul
      @trisalrahul  5 місяців тому

      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

  • @maruthisrinivas2294
    @maruthisrinivas2294 7 місяців тому +1

    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

    • @trisalrahul
      @trisalrahul  7 місяців тому +1

      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

  • @iterator
    @iterator 6 місяців тому +1

    How do we add Contextual info on this model such that Chatbot can answer contextual questions as well generic answers ?
    Thanks

    • @trisalrahul
      @trisalrahul  6 місяців тому

      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

  • @saisampath8656
    @saisampath8656 3 місяці тому +1

    Sir..I am getting an error that "You don't have access to the model with the specified model ID."

    • @trisalrahul
      @trisalrahul  3 місяці тому

      Hi Sai - Please request for the model id access from bedrock service in the console

    • @saisampath8656
      @saisampath8656 3 місяці тому +1

      @@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.

    • @trisalrahul
      @trisalrahul  3 місяці тому

      @@saisampath8656 - Okay...please raise a ticket with AWS support...they should be able to help...

  • @draaken0
    @draaken0 6 місяців тому +1

    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?

    • @trisalrahul
      @trisalrahul  6 місяців тому +1

      Yea, i think that should work too...

  • @marcosallanluz
    @marcosallanluz 5 місяців тому +1

    Top!

  • @user-pr8em3ym2n
    @user-pr8em3ym2n 6 місяців тому +1

    Which model is good to parse word and pdf documents in bulk

    • @trisalrahul
      @trisalrahul  6 місяців тому

      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

  • @VISHVANI9
    @VISHVANI9 7 місяців тому +1

    Thank you, What is the Infra requirement for above demo?

    • @trisalrahul
      @trisalrahul  7 місяців тому

      It can be deployed on a medium sized EC2 instance..

    • @VISHVANI9
      @VISHVANI9 7 місяців тому +1

      Did you test it on your local machine? If yes what is RAM size?

    • @trisalrahul
      @trisalrahul  7 місяців тому

      @VISHVANI9 - Should not matter.We are using Bedrock for response from foundation model and bedrock is a Serverless service.

  • @dattathreyaa.s.v7846
    @dattathreyaa.s.v7846 6 місяців тому +3

    can you tell how to install bedrock

    • @trisalrahul
      @trisalrahul  6 місяців тому +1

      try pip install bedrock or install boto3

    • @dattathreyaa.s.v7846
      @dattathreyaa.s.v7846 6 місяців тому +1

      @@trisalrahul I tried but same error

    • @trisalrahul
      @trisalrahul  6 місяців тому

      @dattathreyaa.s.v7846 - what is the error ?

    • @dattathreyaa.s.v7846
      @dattathreyaa.s.v7846 6 місяців тому

      @@trisalrahul I can't explain here, do you have any social media IDs

    • @01943888
      @01943888 5 місяців тому +1

      You need only install boto3 AWS sdk and have key api and secret api key to interact with AWS