Samuel Chan
Samuel Chan
  • 107
  • 615 553
Build Chat AI apps w/ Streamlit + LangChain
Langchain's Agent is the powerhouse to LLM (large language models), as it "delegates" to specialized tools ("experts") like calculator, web browser, translators etc among a wide suite of tools, determining at each step the best specialized tool, or combination of tools, to use. All powered by #langchain tools and action agents.
Action agents: at each timestep, decide on the next action using the outputs of all previous actions
Plan-and-execute agents: decide on the full sequence of actions up front, then execute them all without updating the plan
We combine this with Streamlit, a python based web app framework popular among machine learning engineers to build an AI web application powered by langchain and feels interactive and blazing fast⚡!
Read about LangChain Agents:
python.langchain.com/docs/modules/agents/
Read about Streamlit:
docs.streamlit.io/
MRKL paper:
arxiv.org/pdf/2205.00445.pdf
- Watch PART 1 of the LangChain / LLM series:
Build a GPT Q&A on your own data
ua-cam.com/video/DYOU_Z0hAwo/v-deo.html
- Watch PART 2 of the LangChain / LLM series:
LangChain + OpenAI to chat w/ (query) own Database / CSV!
ua-cam.com/video/Fz0WJWzfNPI/v-deo.html
- Watch PART 3 of the LangChain / LLM series
LangChain + HuggingFace's Inference API (no OpenAI credits required!)
ua-cam.com/video/dD_xNmePdd0/v-deo.html
- Watch PART 4 of the LangChain / LLM series
Understanding Embeddings in LLMs (ft LlamadIndex + Chroma db)
ua-cam.com/video/6uyBc0jm1xQ/v-deo.html
- Watch PART 5 of the LangChain / LLM series
Query any website with GPT3 and LlamaIndex
ua-cam.com/video/6K1lyyzpxtk/v-deo.html
- Watch PART 6 of the LangChain / LLM series
Locally-hosted, offline LLM w/LlamaIndex + OPT (open source, instruction-tuning LLM)
ua-cam.com/video/qAvHs6UNb2k/v-deo.html
- Watch PART 7 of the LangChain / LLM series
Building an AI language tutor: Pinecone + LlamaIndex + GPT-3 + BeautifulSoup
ua-cam.com/video/k8G1EDZgF1E/v-deo.html
- Watch PART 8 of the LangChain / LLM series
Building a queryable journal 💬 w/ OpenAI, markdown & LlamaIndex 🦙
ua-cam.com/video/OzDhJOR5IfQ/v-deo.html
- Watch PART 9 of the LLM series
Making a Sci-Fi game w/ Cohere LLM + Stability.ai: Generative AI tutorial
ua-cam.com/video/uR93yTNGtP4/v-deo.html
- Watch PART 10 of the LLM series
GPT builds entire app from prompt (ft. SMOL Developer)
ua-cam.com/video/Ll_VIsIjuFg/v-deo.html
- Watch Part 11 (Prompt Engineering / Prompt Design)
A language for LLM Prompt Design: Guidance
ua-cam.com/video/k4Ejc3bLQiU/v-deo.html
- Watch Part 12: LangChain Caching
ua-cam.com/video/Uk_SJSnQRU8/v-deo.html
All the code for the LLM (large language models) series featuring GPT-3, ChatGPT, LangChain, LlamaIndex and more are on my github repository so go and ⭐ star or 🍴 fork it. Happy Coding!
github.com/onlyphantom/llm-python
Переглядів: 18 663

Відео

You should use LangChain's Caching!
Переглядів 7 тис.Рік тому
LangChain provides a caching mechanism for LLMs (large language models). The benefits of caching in your LLM development are: 1. Save you money by reducing the number of API calls you make to the LLM provider (like OpenAI, Cohere etc), if you're often requesting the same completion multiple times 2. Speeds up your application by reducing the number of API calls you make to the LLM provider. We ...
A language for LLM prompt design | Guidance
Переглядів 10 тис.Рік тому
Guidance calls itself "a guidance language for controlling large language models", and is an open source project by Microsoft that "enables [prompt designers] to control modern language models more effectively and efficiently than traditional prompting or chaining". This is a tutorial on Guidance to see whether it delivers on that promise and how it fits into the LLM (large language models, lik...
GPT builds entire app from prompt (ft. SMOL Developer)
Переглядів 2,3 тис.Рік тому
We leverage on SMOL AI Developer, (~150 lines of mostly prompt engineering code) to build a party invitation web application for us using just plain text prompting, powered by GPT-3.5 / GPT-4. Smol calls itself a "Coherent Whole Program Synthesis aka your own personal junior developer" and we give this a spin to see if it lives up to its promise. Smol-ai Developer: github.com/smol-ai/developer ...
Making a Sci-Fi game w/ Cohere LLM + Stability.ai: Generative AI tutorial
Переглядів 1,5 тис.Рік тому
We use Cohere, a large language model with a free tier, along with Stability AI's text to image models to help us create a game world ("world building") unlike any others, except the 729 SciFi-themed civilization games out there. Great for diving into Cohere LLM and text-to-image models from Stability AI (makers of Stable Diffusion) - Watch PART 1 of the LangChain / LLM series: Build a GPT Q&A ...
Copilot Chat Demo | Copilot X: best AI pair programmer!
Переглядів 1,2 тис.Рік тому
A demonstration of GitHub Copilot Chat, one of the latest addition to Copilot X. What's already the best AI code assistant just got better. Powered by OpenAI's Codex model and directly integrates into Visual Studio and VS Code, this extension takes your coding productivity up a few notches. Repository for the code demonstration: github.com/onlyphantom/llm-python
Building a queryable journal 💬 w/ OpenAI, markdown & LlamaIndex 🦙
Переглядів 2,6 тис.Рік тому
We incorporate OpenAI and LlamaIndex into a markdown-based notetaking system (like Obsidian) to build a daily journal system that is remarkably query-able and very very cheap (using local storage for our vectors). I use it daily, but I never got around to explaining the build process. Here it is now! This tutorial features GPT-3, LlamaIndex, OpenAI, argparse to turn it into a command line inter...
Building an AI language tutor: Pinecone + LlamaIndex + GPT-3 + BeautifulSoup
Переглядів 5 тис.Рік тому
We train GPT-3.5 on Nietzsche's writing to build the world's best GPT-based language translation and AI language tutor. Features Pinecone, LlamaIndex, GPT3, and BeautifulSoup for web scrapping. - Watch PART 1 of the LangChain / LLM series: Build a GPT Q&A on your own data ua-cam.com/video/DYOU_Z0hAwo/v-deo.html - Watch PART 2 of the LangChain / LLM series: LangChain OpenAI to chat w/ (query) ow...
OpenAI's python QuickStart (tutorial/first look)
Переглядів 3,5 тис.Рік тому
Taking a short detour to have a closer look at OpenAI's official python library, including GPT-3 for text completion and natural language Q&A , Dall-E 2 for generative art (AI image generation), and OpenAI's Whisper for speech to text and human level transcription. In the next video, we'll continue building on LangChain, LlamaIndex other amazing LLM libraries! - Watch PART 1 of the LangChain / ...
Locally-hosted, offline LLM w/LlamaIndex + OPT (open source, instruction-tuning LLM)
Переглядів 30 тис.Рік тому
Implementing an open source LLM that runs on your machine, that you can even access in offline mode! This uses Meta's OPT model, a 175-billion-parameter that rivals GPT-3 in performance. Also interestingly, we'll use the instruction-tuned version of it, known as the OPT-IML. Mentioned in the video: - OPT (Open Pre-trained Transformers): huggingface.co/docs/transformers/model_doc/opt - OPT Paper...
GPT scrapes + answers from any sites (ft. Chromadb, Trafilatura)
Переглядів 7 тис.Рік тому
Implementing a GPT-3-powered Natural language Question Answering bot for ANY websites, featuring LlamaIndex, Trafilatura and ChromaDB. You can pass in a list of websites, then directly ask questions on it, and GPT will build the index required to help retrieve and generate answers to your questions. LlamaIndex (GPT Index) is a project that provides a central interface to connect your LLM’s with...
Understanding Embeddings in LLMs (ft LlamaIndex + Chroma db)
Переглядів 38 тис.Рік тому
We do a deep dive into one of the most important pieces of LLMs (large language models, like GPT-4, Alpaca, Llama etc): EMBEDDINGS! :) In every langchain or llamaindex tutorial you'll come across this idea, but they can feel quite "rushed" or opaque, so this video presents a deeper look into what embeddings really are, and the role it plays in a world dominated by large language models like GPT...
LangChain + HuggingFace's Inference API (no OpenAI credits required!)
Переглядів 51 тис.Рік тому
We combine LangChain with GPT-2 and HuggingFace, a platform hosting cutting-edge LLM and other deep learning AI models. This has the added benefit of not incurring any charges since we're not using OpenAI (might as well, seeing we're in a recession right about now) but instead using the GPT-2 model hosted on HuggingFace.. LangChain is a fantastic tool for developers looking to build AI systems ...
LangChain + OpenAI to chat w/ (query) own Database / CSV!
Переглядів 42 тис.Рік тому
In part 2 of this series we use natural language (english) to query our database and CSV. LangChain integrates with GPT to convert natural language to the corresponding SQL statements, or pandas command, which is then executed to return a natural language response. LangChain is a fantastic tool for developers looking to build AI systems using the variety of LLMs (large language models, like GPT...
LangChain + OpenAI tutorial: Building a Q&A system w/ own text data
Переглядів 29 тис.Рік тому
LangChain is a fantastic tool for developers looking to build AI systems using the variety of LLMs (large language models, like GPT-4, Alpaca, Llama etc), as it helps unify and standardize the developer experience in text embeddings, vector stores / databases (like Chroma), and chaining it for downstream applications through agents. In this tutorial we're using our own custom text / data and tr...
TorchVision Quick Start: Image classifier in 10 mins
Переглядів 2,1 тис.Рік тому
TorchVision Quick Start: Image classifier in 10 mins
Python's 3.9 "@cache" (and lru_cache) is amazing!
Переглядів 714Рік тому
Python's 3.9 "@cache" (and lru_cache) is amazing!
Train a PyTorch neural network step-by-step | PyTorch deep learning (Feb 2023)
Переглядів 730Рік тому
Train a PyTorch neural network step-by-step | PyTorch deep learning (Feb 2023)
Use less for-loops, use more vectorization
Переглядів 4,5 тис.Рік тому
Use less for-loops, use more vectorization
Backpropagation algorithm & gradient descent, but explain it like I'm 5
Переглядів 826Рік тому
Backpropagation algorithm & gradient descent, but explain it like I'm 5
Use set intersections, not for loops!
Переглядів 242Рік тому
Use set intersections, not for loops!
PyTorch's Computational Graph + Torchviz | PyTorch (2023)
Переглядів 2,8 тис.Рік тому
PyTorch's Computational Graph Torchviz | PyTorch (2023)
Taskwarrior is THE task management system you need
Переглядів 9 тис.Рік тому
Taskwarrior is THE task management system you need
Building neural networks with PyTorch (PyTorch w/ GPU tutorial, part 4)
Переглядів 368Рік тому
Building neural networks with PyTorch (PyTorch w/ GPU tutorial, part 4)
PyTorch Datasets, DataLoaders and Transforms (PyTorch w/ GPU series, part 3)
Переглядів 788Рік тому
PyTorch Datasets, DataLoaders and Transforms (PyTorch w/ GPU series, part 3)
Introduction to Tensors (PyTorch with GPU series, part 2)
Переглядів 926Рік тому
Introduction to Tensors (PyTorch with GPU series, part 2)
GPU-based deep learning (2023) series 1: PyTorch & CUDA installation guide
Переглядів 4,5 тис.Рік тому
GPU-based deep learning (2023) series 1: PyTorch & CUDA installation guide
Hands on introduction to Docker Compose V2 (tutorial ft. wordpress, mysql, phpmyadmin)
Переглядів 968Рік тому
Hands on introduction to Docker Compose V2 (tutorial ft. wordpress, mysql, phpmyadmin)
Hands on Introduction to Docker & Data Persistence w/ Docker Volumes
Переглядів 628Рік тому
Hands on Introduction to Docker & Data Persistence w/ Docker Volumes
DuckDB: Hi-performance SQL queries on pandas dataframe (Python)
Переглядів 12 тис.Рік тому
DuckDB: Hi-performance SQL queries on pandas dataframe (Python)

КОМЕНТАРІ

  • @TheShreyas10
    @TheShreyas10 8 годин тому

    Hey can you please share the repo, I cant find it on your git

  • @pradip_patil292
    @pradip_patil292 16 днів тому

    IS this open key free ?

  • @mdaffailhami
    @mdaffailhami 24 дні тому

    Pendapatnya bang soal Polars vs Pandas?

  • @CanDoSo_org
    @CanDoSo_org 26 днів тому

    Thanks. But the page margin is too narrow. How to increase the page margin?

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

    What keyboard is that it sounds incredible

  • @minimin-wj8vp
    @minimin-wj8vp Місяць тому

    thanks 🌹

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

    comp sci sigh

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

    Please what VS Code theme are you using?

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

    u explained gradeint descent as back propagation. but theres a diffence i m trying to figure out why need back propagation when gradient descent does the job - finind the minima. the most appropriate parameters w.r.t to cost function. what role does backprogation play in adjusting the paramters. whats the intuition

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

    😅 the pens

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

    thank you man

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

    clean explanation. thx

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

    Thanks bro

  • @PujaKumari-ku6dg
    @PujaKumari-ku6dg 3 місяці тому

    How can i get the code of this video

  • @hello-lb3vf
    @hello-lb3vf 3 місяці тому

    I've been searching how to do this... I couldn't find a solution until I stumbled across this video. Thank you :)

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

    Hi, somehow after I'm applying the yearslider, the legend on the bottom (pop) can't fit the screen anymore at 1,200,000,000 (year 1995+). Is there something I can do about that? I have tried to change the font size (labelFontSize) but it's not working.

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

    Thanks for this video! Quick question, Is there any risk of PII leakage in this implementation ? Asking this because we cannot see the model getting downloaded locally.

  • @TJ-hs1qm
    @TJ-hs1qm 4 місяці тому

    to turn off security for local dev xpack.security.enabled=false xpack.security.enrollment.enabled=false

  • @Shifasiddiqui-ur1cm
    @Shifasiddiqui-ur1cm 4 місяці тому

    i did the exact same thing but "workon web3" command didnt work in my vs and also it created block0 only with the contract address etc no block 1

  • @johnini
    @johnini 4 місяці тому

    Would you share the code of the last version of the streamlit app with more tools that you showcase on the video? the one on github seems to be the simple one. Thanks! was a great series!

  • @rameshh3821
    @rameshh3821 4 місяці тому

    Is it possible to plot charts on top of sql data ?

  • @cheybrown2076
    @cheybrown2076 4 місяці тому

    One question though… the “project_dir” variable - how did you add the forward slash and projectname variable without putting in quotes. Was expecting it to throw and error cause it’s like you’re dividing the path by projectname

  • @cheybrown2076
    @cheybrown2076 4 місяці тому

    Brilliant vid!

  • @RoiDeMai
    @RoiDeMai 4 місяці тому

    Samuel, thank you for the hint with threshold filter. When applied, it is much easier for OCR to see the digits with such font.

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

    Hey how can we get tpoken usage with streaming = true

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

    Hi, could this type of chatbot be integrated with Messenger and own website for customer support like interactions, based on own Q&A files and text?

  • @RaushanKumar-ut2ke
    @RaushanKumar-ut2ke 5 місяців тому

    Because SQLDatabase from langchain support only one schema.

  • @RaushanKumar-ut2ke
    @RaushanKumar-ut2ke 5 місяців тому

    Hi Samuel, do we have any method to connect multiple schema for database chatting?

  • @MageDigest-c1z
    @MageDigest-c1z 5 місяців тому

    very good video for starters 🙂

  • @KrishPatel-cu6dg
    @KrishPatel-cu6dg 5 місяців тому

    Thank You Sir

  • @BassamAdel-wg3gr
    @BassamAdel-wg3gr 5 місяців тому

    How to return SQLQuery just wanna get that :(( any idea ?

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

    Excelente. A+1. Se puede conectar un base de datos de Foxpro + DuckDB con python

  • @AnthonyNehme-po3qk
    @AnthonyNehme-po3qk 5 місяців тому

    Why didnt u flip the kernel? Isnt it correlation? Even tho here its symmetric but students may misunderstand

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

    crazy how none of these are relevant anymore; i get all sorts of errors after installing llama_index (newest version as of today) - i see many deprecations - PromptHelper and others; but this has been a nice lesson though, i'm subscribed now

  • @tk-og4yk
    @tk-og4yk 6 місяців тому

    Hey Sam, your series has helped me immensely. I am trying to build on the work here and add some sort of cacheing so I can continue to ask questions. Any tips you can offer to do this?

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

    ImportError: cannot import name 'HuggingFace_Hub' from 'langchain' . how tf does it not exist anymore?

    • @KrishiCH-k9b
      @KrishiCH-k9b 3 місяці тому

      i think you should try "from langchain_community" instead?

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

    Hey man, im getting error on your: vecstore = Chroma.from_documents(texts, embeddings) qa = RetrievalQA.from_chain_type( llm=OpenAI(), chain_type = "stuff", retriver = vecstore.as_retriever() ) ValidationError: 2 validation errors for RetrievalQA retriever field required (type=value_error.missing) retriver extra fields not permitted (type=value_error.extra) Can u help me out?

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

    Its possible to combinate the pdf file with this one?

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

    Great work, thank you!

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

    Great video. I was wondering how can the openai deal when there is a typo in one of the sentences you wrote that doesn't match the entires in the database

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

    Mantap bg, auto subscribe

  • @JoEl-jx7dm
    @JoEl-jx7dm 7 місяців тому

    Hey man would it be cool of i use firebase as my database instead of SQL?

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

    at docker run " bootstrap checks failed"

  • @sachin-b8c4m
    @sachin-b8c4m 7 місяців тому

    dude sorry to say this its too confusing.

    • @linden-it-net
      @linden-it-net 6 місяців тому

      Dude, what's confusing or not depends on the level of understanding. Samuel is a better coder and data engineer as a teacher maybe but he's doing awesome; you can pick up loads here. What scares me most is that I'm pretty closed to his level =P

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

    Hello, does this method still work? I copied your code from GitHub and when I open the HTML file in browser it says "Loading runtime... Runtime created... Initializing components..." and then never stops loading. I checked the console and it gives me many errors that I don't understand. I've replied to this comment with the errors if you're interested.

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

      Uncaught (in promise) PythonError: Traceback (most recent call last): File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 234, in __step result = coro.throw(exc) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 183, in install transaction = await self.gather_requirements(requirements, ctx, keep_going) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 173, in gather_requirements await gather(*requirement_promises) File "/lib/python3.10/asyncio/futures.py", line 284, in __await__ yield self # This tells Task to wait for completion. File "/lib/python3.10/asyncio/tasks.py", line 304, in __wakeup future.result() File "/lib/python3.10/asyncio/futures.py", line 201, in result raise self._exception File "/lib/python3.10/asyncio/tasks.py", line 232, in __step result = coro.send(None) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 291, in add_requirement await self.add_wheel( File "/lib/python3.10/site-packages/micropip/_micropip.py", line 316, in add_wheel await self.add_requirement(recurs_req, ctx, transaction) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 291, in add_requirement await self.add_wheel( File "/lib/python3.10/site-packages/micropip/_micropip.py", line 316, in add_wheel await self.add_requirement(recurs_req, ctx, transaction) File "/lib/python3.10/site-packages/micropip/_micropip.py", line 286, in add_requirement raise ValueError( ValueError: Couldn't find a pure Python 3 wheel for 'tornado>=5.1'. You can use `micropip.install(..., keep_going=True)` to get a list of all packages with missing wheels. at new_error (pyodide.asm.js:14:238191) at pyodide.asm.wasm:0xedbcb at pyodide.asm.wasm:0xf1a0e at method_call_trampoline (pyodide.asm.js:14:238105) at pyodide.asm.wasm:0x134c2c at pyodide.asm.wasm:0x217a84 at pyodide.asm.wasm:0x174a14 at pyodide.asm.wasm:0x135149 at pyodide.asm.wasm:0x135243 at pyodide.asm.wasm:0x1352e6 at pyodide.asm.wasm:0x1fff83 at pyodide.asm.wasm:0x1f98b5 at pyodide.asm.wasm:0x135329 at pyodide.asm.wasm:0x201f1b at pyodide.asm.wasm:0x1ff9ff at pyodide.asm.wasm:0x1f98b5 at pyodide.asm.wasm:0x135329 at pyodide.asm.wasm:0xf16d8 at Module.callPyObjectKwargs (pyproxy.gen.ts:360:23) at Module.callPyObject (pyproxy.gen.ts:384:17) at wrapper (pyodide.asm.js:14:205222)

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

    Bro I am unable to connect them kindly help me

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

    I've been sloppily using Taskwarrior for a few years but hadn't delved this deeply. I've _also_ wanted to build a bridge to Remember the Milk, so I can interact with my tasks on my phone (or in a browser, but that's less necessary since I'm in the terminal a lot). So I'm looking forward to watching your video on building a Python app wrapping Taskwarrior. Cheerio!

  • @lingling12741
    @lingling12741 8 місяців тому

    gaussean filter

  • @sathyamkakodkar5957
    @sathyamkakodkar5957 8 місяців тому

    Hi how to export the results in csv file

  • @princessapellido7668
    @princessapellido7668 8 місяців тому

    Is there a way to delete a specific cache only in the database?