Langflow for LLM prototyping
Over the weekend, I was experimenting with Large Language Models and have come across Langflow. LangFlow is a GUI for LangChain, designed with react-flow to provide an effortless way to experiment and prototype flows with drag-and-drop components and a chat box.
If you have not heard of LangChain yet, LangChain is a Powerful framework for developing applications powered by Large Language models. Langchain connects language models to various sources of data like databases, APIs, etc, and allows LLMs to interact with its environment through agents. Learn more about Langchain here - https://python.langchain.com/en/latest/index.html.
I have developed a very simple LLM application using Langflow just by dragging and dropping the various components from LangFlows Repository.
My Learning Usecase was to build a very simple Football news Bot and the components I used are
1. WebBaseLoader which loads all the text from HTML pages into a document format. I have used news.google.com as an input
2. CharacterTextsplitter Most LLMs are constrained by the number of tokens that you can pass as input. You need to chunk your large text into multiple chunks so they can be passed to LLM
3. OpenAIEmbeddings - I have used OpenAI embeddings to convert the text to a Vector of numbers (OpenAI API KEY is required here)
4. Chroma - I have used Chroma as a VectorDB to store the vectors
5. VectorStoreInfo is a data structure that describes a vector store. A vector store is a collection of documents that have been embedded into a vector space.
6. I have used OpenAI text-davinci-0003 model as an LLM (( OpenAI API KEY is required here)
7. VectorStoreAgent - which will communicate with VectorstoreInfo and retrieve information
To use Langflow
pip install Langflow
To run Langflow
langflow
I had good fun building this
--
1 年usefully
Global CoC, Mainframe Modernization Service, IBM Consulting
1 年Rohini Banerjee
Global Service Line Leader, Cloud Transformation Services at IBM Consulting
1 年Indeed Langflow and Langchain are awesome
Cloud Microservice Architect
1 年Nice ??