Тёмный

Stream LLMs with LangChain + Streamlit | Tutorial 

Alejandro AO - Software & Ai
Подписаться 43 тыс.
Просмотров 27 тыс.
50% 1

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 94   
@ronikh4n
@ronikh4n 6 месяцев назад
Fantastic walkthrough! I was wondering if you could create a tutorial on how to build a custom Knowledge Retrieval service using Langchain. The idea behind this service is to allow users (multi tenancy) to chat with their uploaded documents in different formats like PDF, CSV, and Text, while ensuring that the data remains accessible only to the user/owner who uploaded the file.
@hakikitosunpasa335
@hakikitosunpasa335 7 месяцев назад
Amazing tutorial, I wonder how to use LCEL with RAG and streaming output in conversational setting...
@edsonrodas3954
@edsonrodas3954 6 месяцев назад
I'm recently learning python and for me this is amazing. You make it look so easy, thanks for share your knowledge
@alejandro_ao
@alejandro_ao 6 месяцев назад
this is beautiful to hear. thank you 😊 keep it up, you're on the right path!
@cindywu3265
@cindywu3265 6 месяцев назад
Very clear and great content to follow along! I am able to build a chat app with multiple pdfs with ConversationalRetrievalChain, but not sure how to implement streaming with that. Hope I will see one soon!
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey there. yeah, you can totally implement streaming with conversational retrieval chain. but you would probably need to use the latest version of it. i think that the class-based chains (like the one you mentioned) are not compatible with LCEL but I am not certain. try creating your chain like this: python.langchain.com/docs/expression_language/cookbook/retrieval
@cindywu3265
@cindywu3265 6 месяцев назад
@@alejandro_ao Awesome, thank you Alejandro! Look forward to your next video
@duanxn
@duanxn 6 месяцев назад
great tutorial, step by step and crystal clear
@alejandro_ao
@alejandro_ao 6 месяцев назад
it's my pleasure :)
@jamessebastian8912
@jamessebastian8912 6 месяцев назад
Thanks! Great Tutorial.
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey thanks for the tip
@amorotto
@amorotto 7 месяцев назад
Great video! would be great to create a similar one for conversational agents with tools using LCEL as well!
@alejandro_ao
@alejandro_ao 7 месяцев назад
i'm working on something like that :)
@julienduchesneau9747
@julienduchesneau9747 5 месяцев назад
yeah good video thank you, I will try to had a sidebar to ajust temp and token lenght with previous videos and see how it goes.
@Reality_Check_1984
@Reality_Check_1984 5 месяцев назад
This is an amazing video. Extremely helpful. How would you go about sequential chains with this? I have been picking up errors and not sure where to read into this more.
@shobhitagnihotri416
@shobhitagnihotri416 7 месяцев назад
How can we generate an assistant that can provide code after uploading documentation of frame work . Please make something related to this . Thank in advance
@alejandro_ao
@alejandro_ao 7 месяцев назад
that's a bit more tricky since we usually need a lot of context to write good code. gemini 1.5 is capable of doing this afaik. i'll make some videos about this!
@AageSundvor
@AageSundvor 4 месяца назад
Is it possible to add tools to this chatbot or must an agent be used? Maybe you could show how the best way to add search tool for the bot?
@mikachiche
@mikachiche 6 месяцев назад
Thanks you very useful tuto, you should explain a little more what and why you're doing something
@ralphanthony5198
@ralphanthony5198 7 месяцев назад
Great content, amigo! Awesome work!
@alejandro_ao
@alejandro_ao 7 месяцев назад
Thanks amigo!
@anuvratshukla7061
@anuvratshukla7061 6 месяцев назад
How can we do the same streaming with Mixtral LLM? I'm using Mixtral (huggining face inferecing) + Langchain + Streamlit. LLM is used as pandas agent and I want to stream the response.
@limjuroy7078
@limjuroy7078 6 месяцев назад
After watching this video, I am thinking of updating the code for your Multiple PDF Chat Tutorial that I have followed fw months ago. I am considering replacing the existing ConversationalRetrievalChain and BufferMemory with LCEL as demonstrated in the video.
@alejandro_ao
@alejandro_ao 6 месяцев назад
yes! i really need to update that video. the core remains relevant, but the code might need some brushing up
@limjuroy7078
@limjuroy7078 6 месяцев назад
@@alejandro_ao Hope you will do that and come out with a video asap.
@cheybrown2076
@cheybrown2076 2 месяца назад
Hey! Really awesome tutorial! Just a bit confused with how the template and the invoke method work together. The user question: {user question} in the template and then {user question: query} in the invoke method. How do they correlate please. Thanks
@alejandro_ao
@alejandro_ao 2 месяца назад
hey there, great question. the variables in the template are in between curly braces, like {user_question}. these values will be replaced later, when you "invoke" it. and when you run the invoke method on a prompt (or a chain that starts with a prompt), you pass an object that looks like this: { variable_to_replace: "my value" } this will replace all the {variable_to_replace} in your prompt with "my value". so if your prompt looks like this: prompt = PromptTemplate.from_template("this is the user question: {user_question}") and query = "what is love?" then when you run prompt.inovoke({ user_question: query }) will return this: "this is the user question: what is love?"
@cheybrown2076
@cheybrown2076 2 месяца назад
@@alejandro_ao thank you! So helpful. Can’t wait to start playing with langchain and crewai. Just finishing off a deep learning (tensorflow) course and some projects then I’ll get into it. I’m a data analyst trying to transition into data science/ML engineering btw 😊
@alejandro_ao
@alejandro_ao 2 месяца назад
​@@cheybrown2076 you are on the right path! actually, i am opening a cohort in a couple of weeks precisely about building AI apps. if you would like to join: course.alejandro-ao.com let me know if you're interested or have any questions!
@fatiga2426
@fatiga2426 4 месяца назад
Great video! I was wondering, why is it necessary to use a Str output parser? Why not getting the content string from de answer directly? Thanks!
@alejandro_ao
@alejandro_ao 4 месяца назад
hey! you can do that too. that was mostly to show how to use the output parsers. but usually you would use the output parser within a chain rather than at the end. inside a chain, if your next step in the chain requires a string input, using an output parser will make sure that it works regardless of what the intermediate step returns 👍
@ajay.kartheek
@ajay.kartheek 7 месяцев назад
Great Tutorials...... Can you tell me what I need to know to build an RAG application like webpage query bot without using streamlit (python based web developemnt will be very useful for me)... I am trying to build an project for my Placement drives. Plz help me through this!! Thank you!!
@dhmkkk
@dhmkkk 6 месяцев назад
is there any way to incorporate streamlit button inputs and llm to answer from that like i ask give menu options and it shows options as buttons and when i click one the llm knows what i selected
@softwareideology2033
@softwareideology2033 6 месяцев назад
Hi ! I impressed with your chat with MySQL solution Can you make a video about chat with api which has swagger docs ?
@user-yh1qt9tf4u
@user-yh1qt9tf4u 5 месяцев назад
I like your so helpful videos so much. Recently, with the help of your videos, I created a customized Rag chatbot with nice avatars and customized HTML. So with the langchain chat message function and the chat history. Text streaming using chat message instead simple langchain message as add on is not possible, is it?
@davidtindell950
@davidtindell950 Месяц назад
Another very useful "AO" vid that I must have missed somehow ! TUVM !!!
@jamalnuh8565
@jamalnuh8565 7 месяцев назад
We I reimplement your code I got errors I wonder, I almost clone three of your repo and fails although I try to use free API such as hugging face
@OwaisBinMushtaq
@OwaisBinMushtaq 7 месяцев назад
Can you please make a chatbot on an open source model. And Great Tutorial as always 🎉
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey there! sure, i will be including more open source models in the demos fron now on :)
@geekyprogrammer4831
@geekyprogrammer4831 7 месяцев назад
Thank you so much ❤❤
@alejandro_ao
@alejandro_ao 7 месяцев назад
it's my pleasure!
@chikosan99
@chikosan99 5 месяцев назад
Thanks a lot !! great
@alejandro_ao
@alejandro_ao 5 месяцев назад
Glad you liked it!
@ScottSummerill
@ScottSummerill 7 месяцев назад
Just stumbled across your channel. Looks pretty decent. Curious what the AO means.
@alejandro_ao
@alejandro_ao 7 месяцев назад
thanks! welcome to the community :) AO is just my initials btw
@Shakti18348
@Shakti18348 7 месяцев назад
How to stream responses of the previous chatbot you made where you used create_retrieval_chain I'm getting an error: return conversational_rag_chain.stream({ TypeError: 'generator' object is not subscriptable
@mirzatouqirbaig3920
@mirzatouqirbaig3920 7 месяцев назад
Great video. Can you make a video on LangGraph?
@alejandro_ao
@alejandro_ao 7 месяцев назад
hey there, sure! coming soon!
@sebastianalza4595
@sebastianalza4595 5 месяцев назад
what a voice men
@alejandro_ao
@alejandro_ao 5 месяцев назад
do not smoke
@sebastianalza4595
@sebastianalza4595 5 месяцев назад
@@alejandro_aohahahahahhaah
@KumR
@KumR 3 месяца назад
Sorry but how is this different from doing same thing in chatgpt
@alejandro_ao
@alejandro_ao 3 месяца назад
not very different. this tutorial is mostly for creating your own version of chatgpt or your own implementation of a LLM-chatbot for a "chat over your data" kind of application. arguably, you could also use this app instead of chatgpt if you wanted to have access to GPT-4 at a fraction of the price, but chatgpt has more features (like storing your conversations, voice-to-text, multimodal input) that you would have to code yourself. on the other hand, coding those features yourself might be a great learning experience!
@AIdevel
@AIdevel 7 месяцев назад
This is really excellent video It’s exactly what I have been looking for Would you please tell me how to use it with RAG applications please make video about that because it’s a game changer in python chat bots 🤖 I tried but failed I need your assistance 😊
@alejandro_ao
@alejandro_ao 7 месяцев назад
hey there! glad to hear this! sure thing. i have been covering RAG quite a bit. even though i have much more content about this coming :) - my most recent video about it is this one, which shows how to do RAG on a web page's contents: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-bupx08ZgSFg.htmlsi=A8fPDeepjKuPe2oP - this one is a more detailed and is about PDF files, but with a slightly older version of langchain: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dXxQ0LR-3Hg.htmlsi=FnULh8P7fn4Iq7df
@AIdevel
@AIdevel 7 месяцев назад
@@alejandro_ao Off course I am keen follower of yours I’ve seen them but I mean how to integrate the message streaming with RAG app ? In the retrieval chain ? and how exactly to achieve it ?
@alejandro_ao
@alejandro_ao 7 месяцев назад
@@AIdevel oh alright! i will incorporate streaming next time i make a RAG app! 🤓 thanks for following the channel!
@PapaioannouOrama
@PapaioannouOrama 5 месяцев назад
@@alejandro_ao pretty sure retriever objects don't support streaming, I know it's possible to have some elements in your chain that don't support streaming though
@parkeatshark4364
@parkeatshark4364 6 месяцев назад
Could it possible to do this with free account of openai
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey there, if you don't want to use openai, you can always use a free model. Groq has a free API (for now) and they allow you to try out Mistral, Gema and Llama2 for free. check them out and the just implement them like this: python.langchain.com/docs/integrations/chat/groq (it should be about a couple lines of code!)
@parkeatshark4364
@parkeatshark4364 6 месяцев назад
Thanks you, I will try this one btw your content is very helpful and easily understood@@alejandro_ao
@jamalnuh8565
@jamalnuh8565 7 месяцев назад
Can u use not openAI API s
@alejandro_ao
@alejandro_ao 6 месяцев назад
sure thing :)
@DavidChoqueluqueRoman
@DavidChoqueluqueRoman 22 часа назад
Your video es great, but very basic. What about stream for tool calling agents?
@gabrieljauregui654
@gabrieljauregui654 7 месяцев назад
Great tutorial to keep us practicing both LangChain and Streamlit! Greetings from Argentina 😊😊
@alejandro_ao
@alejandro_ao 7 месяцев назад
greetings!
@saqibullah-sm9pw
@saqibullah-sm9pw 5 дней назад
I think passing chat history like that is not optimized way ..what if we use langchainMeomryBuffer wo summarize previous chat and give back to llm so that I doesn't increase input token size as every llm has fixed input token size , moving beyond that token size can produce not desirable output because it will miss some parts from input
@TheEverydayAnalyst
@TheEverydayAnalyst Месяц назад
Many users end up clicking enter while they are still typing the query. In the chat GPT we have the stop button to cancel the request. How can this be achieved in langChain or Streamlit?
@divyagarh
@divyagarh 2 месяца назад
Is there a way to do streaming with CustomLLM class with Custom Finetuned model or SageMaker Endpoint (not chat gpt) and using langchain?
@chibuzoemelike6403
@chibuzoemelike6403 7 месяцев назад
This is very helpful, will be great to see something on Langraph and Agents. Thank you for all your support
@alejandro_ao
@alejandro_ao 5 месяцев назад
i have been planing to bring langgraph for a while. so many things to cover. i have started covering agents a bit more, though!
@AIdevel
@AIdevel 7 месяцев назад
Thanks for this great video I wonder how to integrate the streaming method in my RAG application, how to stream the response in RAG based app that uses Qdrant database would you explain it for me ❤❤
@Emmanuel-xe5bc
@Emmanuel-xe5bc 4 месяца назад
great job. I hope i can use part of your code for school assignments?
@alejandro_ao
@alejandro_ao 4 месяца назад
absolutely! and tell your friends about the channel in case they want to learn more about LLM apps :)
@ramkipalle6612
@ramkipalle6612 7 месяцев назад
How can we do the streaming if the backend chain logic is exposed as REST API? In this example, both backend and frontend logic is there in the same file.
@srikanthverpula6271
@srikanthverpula6271 6 месяцев назад
its good but if possible can you work on function calling (Realtime API multiple) in conversational way?
@ersaaatmeh9273
@ersaaatmeh9273 6 месяцев назад
Hi , could I ask you how I can do the same step if I try LLM from Hugging Face?
@ErwinWientjes
@ErwinWientjes 6 месяцев назад
where has your site gone
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey can you please check again? i think the dns is taking too long to propagate :S
@geekyprogrammer4831
@geekyprogrammer4831 6 месяцев назад
Can you create a tutorial on Langgraph?
@abhijitubale
@abhijitubale 6 месяцев назад
Hey Alejandro, Please do let us know which code completion extension/plugin are you using…it seems really “ahead” of you in the video…
@abhijitubale
@abhijitubale 6 месяцев назад
Does anyone know ??
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey there! i am using github copilot. it's great :)
@zeelthumar
@zeelthumar 7 месяцев назад
That write_stream function is cool.. thanks for sharing this buddy.
@alejandro_ao
@alejandro_ao 6 месяцев назад
i know, they released it a few days ago. those guys at Streamlit are building super cool things
@ayoolaadedeji9353
@ayoolaadedeji9353 6 месяцев назад
I can't get the write_stream attribute to be recognised :/@@alejandro_ao
@tojitojira858
@tojitojira858 6 месяцев назад
Thank, how should be process to add this functionality on your example "chat wit a website" ?
@alejandro_ao
@alejandro_ao 6 месяцев назад
hey there! all you got to do is use `stream` instead of `invoke` and yield the results using `st.write_stream`. did you manage to make it work?
@tojitojira858
@tojitojira858 6 месяцев назад
@@alejandro_ao I applied the changes mentioned in your video, but I didn't manage to get the same result as you.
@tojitojira858
@tojitojira858 6 месяцев назад
@@alejandro_ao the message is displayed but a very long json variable
@jamessebastian8912
@jamessebastian8912 6 месяцев назад
Thanks!
@alejandro_ao
@alejandro_ao 6 месяцев назад
*thanks to you!*
@cristianaguilar4253
@cristianaguilar4253 7 месяцев назад
nice. gracias alejandro
@alejandro_ao
@alejandro_ao 6 месяцев назад
un placer, cristian :)
Далее
Меня Забанили в Steam CS2 / PUBG
19:19
Просмотров 194 тыс.
How I Made AI Assistants Do My Work For Me: CrewAI
19:21
Build a Python Website in 15 Minutes With Streamlit
18:37
LangGraph 101: it's better than LangChain
32:26
Просмотров 75 тыс.