TheAILearner
TheAILearner
  • Видео 42
  • Просмотров 73 352
How-to: Cache Model Responses | Langchain | Implementation
In this video, I explain how to efficiently cache LLM (Large Language Model) responses using Langchain in Python. We dive into both in-memory caching and persistent caching, ensuring faster responses and reduced computational costs when working with LLMs. Watch as I demonstrate how to implement these caching strategies step-by-step in chains and agents to optimize your workflows.
Notebook: github.com/TheAILearner/Langchain-How-to-Guides/blob/main/how_to_cache_llm_responses.ipynb
#llm #caching #langchain #gpt #inmemorycaching #persistentcaching #llmresponse #python #generativeai #artificialintelligence #machinelearning #deeplearning #openai
Просмотров: 138

Видео

How-to: Return structured output from LLMs | Langchain | Strategies & Code Implementation
Просмотров 5492 месяца назад
In this video, I walk you through four powerful strategies to return structured output from large language models (LLMs) using OpenAI. Whether you're building a chatbot, a data extraction tool, or any other application requiring structured responses, these methods will help you achieve consistent and reliable results. Notebook : github.com/TheAILearner/Langchain-How-to-Guides/blob/main/How to r...
Signature Matching with Multimodal LLM | MiniCPM-V 2.6
Просмотров 3472 месяца назад
Welcome to this tutorial where we explore the power of MiniCPM-V 2.6, a cutting-edge open-source multimodal LLM, for signature matching. In this video, you'll learn how to harness the capabilities of this model, which is built on SigLip-400M and Qwen2-7B, with a combined total of 8 billion parameters. MiniCPM-V 2.6 is a versatile model designed for tasks such as image and video understanding, i...
Improving OCR on Low-Quality Documents with AuraSR-v2 and MiniCPM-V 2.6
Просмотров 6892 месяца назад
Welcome, fellow learners! In this video, we'll explore how to combine two newly released open-source models to achieve better OCR results on low-quality scanned documents. The first model, AuraSR, is a GAN-based super-resolution model that enhances the quality of scanned document images. The second model is MiniCPM-V 2.6, a recently released multimodal LLM, which we'll use to extract text from ...
LLM Quantization with llama.cpp on Free Google Colab | Llama 3.1 | GGUF
Просмотров 7592 месяца назад
In this video, I walk you through the process of quantizing a open source LLM (Llama 3.1) using the powerful llama.cpp library, all on a free Google Colab environment. The purpose of this type of quantization is to be able to run the quantized model on both CPU and GPU. Notebook : colab.research.google.com/drive/1GmXoZ997XHsd1WTYcB_pPiOvYsfY8nl0?usp=sharing #llama3.1 #llama3 #llamacpp #gguf #Hu...
Fully Local Custom SQL Agent with Llama 3.1 | Langchain | Ollama
Просмотров 3,7 тыс.2 месяца назад
This video teaches you how to implement an end-to-end custom SQL agent which consist of dynamic few shot prompting with the recently released open-source LLM, Llama 3.1 on a local system. Additionally, we will learn how to incorporate persistent memory management through multiple session chat histories by utilizing a local SQL database. Code - github.com/TheAILearner/Langchain-Agents/blob/main/...
Function Calling with Llama 3.1 and Ollama | Langchain
Просмотров 2,7 тыс.2 месяца назад
In this video, we will explore how to implement function (or tool) calling with LLama 3.1 and Ollama locally. Code : github.com/TheAILearner/GenAI-with-Open-Source-LLMs/blob/main/Function Calling with Llama 3.1 and Ollama.ipynb Setting up Ollama : ruclips.net/video/GlyvykfIPJI/видео.html #llama3.1 #functioncalling #ollama #llama3 #llm #langchain #opensource #nlp #machinlearning #coding #python ...
Implementing Codestral Mamba on Free Google Colab
Просмотров 1793 месяца назад
In this video, we'll be setting up and running Codestral Mamba, an open code model based on the Mamba2 architecture in Google Colab free tier. You'll learn: 1. An introduction to the Codestral Mamba model. 2. Loading and configuring the Codestral Mamba. 3. Evaluating the performance and results of Codestral Mamba model. Code Link - colab.research.google.com/drive/1oYOJ3CI9nXBc1xp9Yka91qh3oe3Tob...
Getting Started with LangSmith | LangChain | OpenAI | Ollama
Просмотров 3623 месяца назад
This video is your one-stop guide to getting started with LangSmith! We'll walk you through the entire process, from installation and local setup to building a SQL agent using LangChain. Finally, we'll dive into LangSmith to analyze the agent's output and gain valuable insights. LangSmith - www.langchain.com/langsmith Ollama Github - github.com/ollama/ollama SQL Agent with Llama 3(With Ollama I...
Memory Management for Chatbots using Langchain | OpenAI | Gradio
Просмотров 6743 месяца назад
In this video tutorial, I will guide you through the process of efficiently managing memory for chatbots using Langchain in Python. We will implement it for custom agent. We'll cover each step in detail, from importing the OpenAI LLM to showcasing the final product in a Gradio UI. By the end of this tutorial, you'll have a solid understanding of how to manage chatbot memory effectively, ensurin...
Dynamic Few-shot Prompting with Llama 3 on local Environment | Ollama | Langchain | SQL Agent
Просмотров 2,3 тыс.3 месяца назад
This video teaches you how to implement dynamic few-shot prompting with open-source LLMs like Llama 3 using Langchain on local environment. In this tutorial, we will follow these steps: 1. Import Llama3 : Begin by importing the necessary Llama3 library using Ollama. 2. Fetch SQL Data : Connect to your SQL database and fetch the data you need. This involves establishing a connection to sqlite da...
Implementing DeepSeek-Coder-V2 on Free Google Colab using Ollama
Просмотров 8603 месяца назад
In this video, we'll be setting up and running DeepSeek-Coder-V2, a code language model in Google Colab using Ollama. We will first set up Ollama in Google Colab and then import DeepSeek-Coder-V2 model from Ollama and test it out. #deepseekcoderv2 #googlecolab #deepseek #Ollama #llm #ai #machinlearning #python #tutorial #deeplearning #nlp
OCR Using Microsoft's Florence-2 Vision Model on Free Google Colab
Просмотров 5 тыс.4 месяца назад
In this video, I demonstrate how to implement Microsoft's recently released Florence-2 novel Foundational Vision Model on a free Google Colab workspace using a T4 GPU. I use Optical Character Recognition (OCR) as the primary use case to showcase the model's capabilities. You'll learn: 1. An introduction to the Florence-2 Vision Model 2. Loading and configuring the Florence-2 3. Implementing OCR...
Function Calling With Llama 3 | Ollama | Langchain
Просмотров 1,4 тыс.4 месяца назад
Function Calling With Llama 3 | Ollama | Langchain
Making Llama 3 Up-to-date on Your Local Computer | LangGraph | Ollama | Langchain
Просмотров 7174 месяца назад
Making Llama 3 Up-to-date on Your Local Computer | LangGraph | Ollama | Langchain
Build an SQL Agent with Llama 3 | Langchain | Ollama
Просмотров 11 тыс.4 месяца назад
Build an SQL Agent with Llama 3 | Langchain | Ollama
Summarize YouTube Videos for Free Using Google's Gemini API
Просмотров 9044 месяца назад
Summarize RUclips Videos for Free Using Google's Gemini API
Automate filling of Job Applications | LaVague Web Agent & Microsoft Phi-3 Vision | Free Gemini API
Просмотров 8354 месяца назад
Automate filling of Job Applications | LaVague Web Agent & Microsoft Phi-3 Vision | Free Gemini API
Deep Dive into Text Splitters in Langchain: Character vs Recursive Character Text Splitter
Просмотров 3754 месяца назад
Deep Dive into Text Splitters in Langchain: Character vs Recursive Character Text Splitter
OCR Using Microsoft's Phi-3 Vision Model on Free Google Colab
Просмотров 5 тыс.4 месяца назад
OCR Using Microsoft's Phi-3 Vision Model on Free Google Colab
Langchain Agents | EP04 | Custom Agent with Memory | Langchain | LLM
Просмотров 1,4 тыс.5 месяцев назад
Langchain Agents | EP04 | Custom Agent with Memory | Langchain | LLM
Langchain Agents | EP03 | Custom Agent | Langchain | LLM
Просмотров 6005 месяцев назад
Langchain Agents | EP03 | Custom Agent | Langchain | LLM
Langchain Agents | EP02 | Dynamic Few-Shot prompting | Langchain | LLM
Просмотров 8965 месяцев назад
Langchain Agents | EP02 | Dynamic Few-Shot prompting | Langchain | LLM
Langchain Agents | EP01 | SQL Chain vs Agent | Langchain | LLM
Просмотров 2,6 тыс.5 месяцев назад
Langchain Agents | EP01 | SQL Chain vs Agent | Langchain | LLM
AI Super Agent | EP02 | Implementation | Octopus v2 | Nexa AI
Просмотров 2355 месяцев назад
AI Super Agent | EP02 | Implementation | Octopus v2 | Nexa AI
AI Super Agent | EP01 | Introduction | Octopus v2 | Nexa AI
Просмотров 3955 месяцев назад
AI Super Agent | EP01 | Introduction | Octopus v2 | Nexa AI
Chat with Data | EP06 | Speech Inclusion in SQL Database Chain | Langchain | LLM
Просмотров 1255 месяцев назад
Chat with Data | EP06 | Speech Inclusion in SQL Database Chain | Langchain | LLM
Chat with Data | EP05 | SQL Database Chain with Gradio UI | Langchain | LLM
Просмотров 2305 месяцев назад
Chat with Data | EP05 | SQL Database Chain with Gradio UI | Langchain | LLM
Chat with Data | EP04 | Demystifying individual components of SQL Database Chain | Langchain | LLM
Просмотров 1536 месяцев назад
Chat with Data | EP04 | Demystifying individual components of SQL Database Chain | Langchain | LLM
Chat with Data | EP03 | Custom Prompting in SQL Database Chain | Langchain | LLM
Просмотров 2736 месяцев назад
Chat with Data | EP03 | Custom Prompting in SQL Database Chain | Langchain | LLM

Комментарии

  • @ravindarmadishetty736
    @ravindarmadishetty736 Час назад

    Can it extract written text or tables from paper?

  • @1978nathaniel
    @1978nathaniel 15 часов назад

    Poderia criar mais conteúdos como esse, voltado para integração com grandes bancos de dados, além de ter um frontend mais simples para interação.

  • @1978nathaniel
    @1978nathaniel 15 часов назад

    Parabéns pelo tutorial, um diferencial, pois todos que encontrei eram com o llamaindex e key openIA, que não é grátis, foi uma forma simples de mostrar a conexão com banco usando soluções grátis

  • @neloy.9782
    @neloy.9782 2 дня назад

    A great in depth comparison video....🖤🖤

  • @harish-wj6xr
    @harish-wj6xr 9 дней назад

    thanks

  • @hotrodoanzz
    @hotrodoanzz 16 дней назад

    you so smart😍😍😍

  • @debarghyadasgupta1931
    @debarghyadasgupta1931 23 дня назад

    Fantastic as always. In non persistent caching how can we restrict the number of cache and keep rotating the cache? Say want to restrict it to 100 entries

    • @theailearner1857
      @theailearner1857 20 дней назад

      You can set 'maxsize' argument to 100, which will restrict maximum number of entries to 100. If the cache exceeds the maximum size, the oldest items will be removed. cache = InMemoryCache(maxsize=100)

  • @brunocarvalho3229
    @brunocarvalho3229 Месяц назад

    Your're life savior my guy, thank you so much for this!

  • @simplepuppy
    @simplepuppy Месяц назад

    is minicpm better than florence-2?

  • @evanrsl
    @evanrsl Месяц назад

    Agent stopped due to iteration limit or time limit. even though im only querying "how many total artist are there?". It seems the agent went on a endless loop The langsmith logs: <|start_header_id|>assistant<|end_header_id|> Thought: To answer this question, I need to count the total number of artists in the database. Action: sql_db_query_checker Action Input: "SELECT COUNT(*) FROM Artist Observation: SELECT COUNT(*) FROM Artist Thought: <|start_header_id|>assistant<|end_header_id|> Thought: To answer this question, I need to count the total number of artists in the database. Action: sql_db_query_checker Action Input: "SELECT COUNT(DISTINCT ArtistName) FROM Artist Observation: SELECT COUNT(DISTINCT ArtistName) FROM Artist Thought: <|start_header_id|>assistant<|end_header_id|> Thought: To answer this question, I need to count the total number of artists in the database. Action: sql_db_query_checker Action Input: "SELECT COUNT(*) FROM Artist Observation: SELECT COUNT(*) FROM Artist repeated 15 times

  • @RaedChrif
    @RaedChrif Месяц назад

    thanks man, great job

  • @shamirshakir
    @shamirshakir Месяц назад

    Wonderful tutorial. Thanks!

  • @vagnerbelfort
    @vagnerbelfort Месяц назад

    Have other languages? Thanks!!!

  • @cadc-pn1ir
    @cadc-pn1ir Месяц назад

    hey there can we do it without downloading video?

  • @jofjofjof
    @jofjofjof Месяц назад

    Great video. God bless you bro for kindly sharing your knowledge.

  • @mpicuser
    @mpicuser Месяц назад

    Hello, thank you for this video.

  • @Howard-rp3lq
    @Howard-rp3lq Месяц назад

    Hi there, nice video; can I ask where did you download this particular version of the model?

  • @MohitThehuman
    @MohitThehuman 2 месяца назад

    Hey Nice video thanks Can you please help the same dynamic retrieval for schema as well ?

  • @aryanjain5535
    @aryanjain5535 2 месяца назад

    Great, buddy!!!!!!

  • @aryanjain5535
    @aryanjain5535 2 месяца назад

    Good going

  • @anasydpy
    @anasydpy 2 месяца назад

    Can you explain how to show users their previous chats using the sql method

  • @rutvik-l7w
    @rutvik-l7w 2 месяца назад

    you are amazing sir

  • @minunata-rugaciune
    @minunata-rugaciune 2 месяца назад

    BRO YOU ARE THE BEST!

  • @mohamedfariq1588
    @mohamedfariq1588 2 месяца назад

    Here can we use minicpm from ollama?

    • @amandamate9117
      @amandamate9117 Месяц назад

      now yes. its uploaded in models. update ollama too then it works

  • @yossnour
    @yossnour 2 месяца назад

    Thank you so much for the videos!

  • @rutvik-l7w
    @rutvik-l7w 2 месяца назад

    thanks sir, you are superb🤗

  • @rutvik-l7w
    @rutvik-l7w 2 месяца назад

    thanks lot for this video but can we utilize this model on cpu. please answer me

    • @theailearner1857
      @theailearner1857 2 месяца назад

      Yes you can but you need to follow different steps: 1. Instead of installing AuraSR from pip, install it using git as: "pip install git+github.com/fal-ai/aura-sr.git" 2. While loading pretrained AuraSR model, pass device arugment as "cpu" like aura_sr = AuraSR.from_pretrained("fal/AuraSR-v2", device = "cpu") Now for the MiniCPM-V 2.6 model there are two thing you can do to run it in cpu: 1. Use any CPU intensive quantized model already available on HuggingFace 2. Quantize this model for CPU usage, using llama.cpp. For this part I have created a video for quantization. You can follow this link: ruclips.net/video/dcN2AIcgCAg/видео.html Note : Using it with a CPU will result in longer inference times.

    • @rutvik-l7w
      @rutvik-l7w 2 месяца назад

      @@theailearner1857 thanks sir

    • @rutvik-l7w
      @rutvik-l7w 2 месяца назад

      @@theailearner1857 sir i watched your video about quantized model but llama.cpp is not support for minicpm. is there any alternative solution for this?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      You can quantize MiniCPM-V 2.6 model using llama.cpp. Follow steps provided in the following link: github.com/OpenBMB/llama.cpp/blob/minicpmv-main/examples/llava/README-minicpmv2.6.md

    • @rutvik-l7w
      @rutvik-l7w 2 месяца назад

      @@theailearner1857 thanks sir but after quantization how can i use gguf model on my local machine. please sir explain me🙏

  • @andy111007
    @andy111007 2 месяца назад

    notebook?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      colab.research.google.com/drive/1uUQZiove1uuCe3eQCE7KZRfJfndXVaDj?usp=sharing

  • @phanikrishna8215
    @phanikrishna8215 2 месяца назад

    How do we get the bounding boxes of the OCR text using phi3 ?

  • @spoiltchild6517
    @spoiltchild6517 2 месяца назад

    instead of making new custom prompt just to make the limit to some X value. better use a config within the function, it will allow passing limit argument

  • @rajupresingu2805
    @rajupresingu2805 2 месяца назад

    It’s a good video. Can you make a video on connecting to MySQL and also how we can work with multiple schemas and tables for a query

  • @AliAlias
    @AliAlias 2 месяца назад

    Very helpful ❤✌️

  • @AbhinavKumar-tx5er
    @AbhinavKumar-tx5er 2 месяца назад

    what if the datasize is greater than 20gb? will it work?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      The size of the database won't cause any issues since we are only using the table schema in the prompt. However, keep in mind that as the database size increases, running SQL queries will take more time.

    • @AbhinavKumar-tx5er
      @AbhinavKumar-tx5er 2 месяца назад

      @@theailearner1857 oh okay .. let me try ..

  • @darkmatter9583
    @darkmatter9583 2 месяца назад

    how can i share the code to help me? i just did it until the end but at some point i dont know i got lost and keep the error

    • @theailearner1857
      @theailearner1857 2 месяца назад

      colab.research.google.com/drive/1GmXoZ997XHsd1WTYcB_pPiOvYsfY8nl0?usp=sharing

  • @darkmatter9583
    @darkmatter9583 2 месяца назад

    im trying following the code but not following you on min 7 doesnt quantize i dont see the folder

  • @darkmatter9583
    @darkmatter9583 2 месяца назад

    can you share code please?

  • @tkbwonderworld
    @tkbwonderworld 2 месяца назад

    Notebook link?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      I have shared the link in the description.

  • @debarghyadasgupta1931
    @debarghyadasgupta1931 2 месяца назад

    Agent stopped due to iteration limit or time limit. The custom agent is not consistent at all. Very unreliable. May be if you can use your approach what you did in Memory Management in Chatbots with the SQL agent.

  • @debarghyadasgupta1931
    @debarghyadasgupta1931 2 месяца назад

    Can you show how to do this with SQL agents?

  • @MrZadocH
    @MrZadocH 2 месяца назад

    how i can edit the prompt to allow write to tables?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      Usually its not advised to run DML statements through generative AI but if you want to customize the sql agent prompt, you can check out this video: ruclips.net/video/SSpeRcfp1z4/видео.html

  • @Jamie--
    @Jamie-- 2 месяца назад

    the react agent seems to be going in a infinite loop

    • @theailearner1857
      @theailearner1857 2 месяца назад

      Try to include additional few-shot examples such that llm can have enriched context about kind of sql queries it needs to generate.

    • @jayaram5127
      @jayaram5127 Месяц назад

      @@theailearner1857 , did not work for me as well.. goes into infinite loop with llama 3.1.. just provided the same user query as given in the example in few-shot and still went into loop

  • @Jamie--
    @Jamie-- 2 месяца назад

    Will this work getting data from a ms sql db?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      It should work. You can try by creating a connection with SQL server instead of local sqlite. Also make sure to provide few shot examples as per your dataset.

    • @JPBCDE
      @JPBCDE 2 месяца назад

      Ive tried this with MS SQL. It seems it goes into a loop and not getting out. One of the issues Im seeing is, that its not using the correct Dialect. For instance, ask for lists or top x . It uses MySQL dialect, ie for MS SQL you would do, SELECT TOP x *, for MySQL its SELECT * FROM ... LIMIT x . And then it just bombs out. Ive tried specifying this in the prompts, but to no success. Any suggestions would be appreciated.

    • @NillsBoher
      @NillsBoher 2 месяца назад

      @@JPBCDE Try to add the following to the end of the prompt: answer as a TSQL expert, I hope it will do

    • @JPBCDE
      @JPBCDE 2 месяца назад

      @@NillsBoher Thank you. Ive tried this and it results in the same issue. I gets to where the SELECT is with LIMIT and it just keeps on repeating the SQL query checker in a loop until it breaks

    • @Jamie--
      @Jamie-- 2 месяца назад

      @@JPBCDE I tried this with my local ms sql db and I also just keep getting the SQL query checker seemingly bein stuck in a loop

  • @siddheshphapale95
    @siddheshphapale95 2 месяца назад

    minimum system req??

  • @debarghyadasgupta1931
    @debarghyadasgupta1931 2 месяца назад

    Can you please create a video with Langgraph, most importantly agent based. Where agents can use specific tools and tasks and can also interact with each other. They can have their own state or memory to exchange information between each other.

    • @marguskokk4293
      @marguskokk4293 2 месяца назад

      I would love this also. Working on something similar right now.

  • @dummy-s3p
    @dummy-s3p 2 месяца назад

    nice tutorial !!! Please provide the notebook link.

    • @theailearner1857
      @theailearner1857 2 месяца назад

      github.com/TheAILearner/Langchain-Agents/blob/main/Memory%20Management%20in%20Chatbots.ipynb

  • @hegalzhang1457
    @hegalzhang1457 2 месяца назад

    Great work, very useful, did you release code?

    • @theailearner1857
      @theailearner1857 2 месяца назад

      Glad it helped, I have provided the code link in the description.

  • @siddhubhai2508
    @siddhubhai2508 3 месяца назад

    Cool bro I really wanted it, thank you so much! Please have a logo on your channel and be consistent with the same quality, your content is very nice! Actually I'm also building a revolutionary AI tool, please can you help me with that? I made the AI agent using ollama library and other libraries (including my package which is not available in public) which is very nice and became more cool due to your this tutorial, now the only last thing I want please make a video on how to implement unlimited memory (or you can say context) to the AI agent I made, I use ollama.generate so I can't use the LLM's built in context, and even if I could I won't because it's very short. I watched the AI austin's unlimited memory video but I wasn't able to implement it to my AI agent as he was implementing on his AI agent instead of telling how can we also do that on our project actually. Please can you do that for me today, because I need it today. ALSO MAIN THING - Please use local storage instead of any cloud vector database or any type of cloud database. Thank you hope you will do that for me today. It's emergency otherwise I won't say to do it instantly. Please I join my hands. Please bro! 🙏🙏😥😥

  • @siddhubhai2508
    @siddhubhai2508 3 месяца назад

    Cool bro I really wanted it, thank you so much! Please have a logo on your channel and be consistent with the same quality, your content is very nice! Actually I'm also building a revolutionary AI tool, please can you help me with that? I made the AI agent using ollama library and other libraries (including my package which is not available in public) which is very nice and became more cool due to your this tutorial, now the only last thing I want please make a video on how to implement unlimited memory (or you can say context) to the AI agent I made, I use ollama.generate so I can't use the LLM's built in context, and even if I could I won't because it's very short. I watched the AI austin's unlimited memory video but I wasn't able to implement it to my AI agent as he was implementing on his AI agent instead of telling how can we also do that on our project actually. Please can you do that for me today, because I need it today. ALSO MAIN THING - Please use local storage instead of any cloud vector database or any type of cloud database. Thank you hope you will do that for me today. It's emergency otherwise I won't say to do it instantly. Please I join my hands. Please bro! 🙏🙏😥😥

  • @mahraneabid
    @mahraneabid 3 месяца назад

    I don't know why the response returns as an SQL not as Natural human languages

  • @mahraneabid
    @mahraneabid 3 месяца назад

    can we do that on GPU is it more faster?