Member-only story

Turn Your Langflow Prototype into a Streamlit Chatbot Application

Learn how to turn your Langflow flow into a fully-functional Streamlit-based conversational chatbot application

--

Introduction

According to its creator, LogSpace, a software company that provides customized Machine Learning services, Langflow is a web-based UI for LangChain, designed with react-flow to provide an effortless way to experiment and prototype flows. LangChain, created by Harrison Chase, is a wildly popular framework for developing applications powered by large language models (LLMs).

Langflow allows users to quickly develop simple to complex LangChain prototypes without any required coding, truly democratizing LLMs access. According to the README, “Creating flows with Langflow is easy. Simply drag sidebar components onto the canvas and connect them to create your pipeline. Langflow provides a range of LangChain components, including LLMs, prompt serializers, agents, and chains.”

Typical Langflow flow using a range of LangChain components

Flowise

Flowise, created by FlowiseAI, is an alternative to Langflow. Each offers nearly identical features. Flowise, according to the website, is an open-source UI visual tool to build your customized LLM flow using LangchainJS, written in Node Typescript/Javascript and also created by Harrison Chase. As of July 2023, both projects have nearly identical stars on GitHub, ~11k. However, Flowise does have over 2.5x the number of forks as Langflow, 3.9k to 1.4k. You can find many articles and YouTube videos comparing the two tools.

Turning Flows into Applications

Although it excels at no-code experimentation and prototyping, Langflow’s documentation lacks details on turning a LangChain prototype (aka flow) into a standalone application, such as a Chatbot. The documentation simply states, “Once you’re done, you can export your flow as a JSON file to use with LangChain. To do so, click the Export button in the top right corner of the canvas; then, in Python, you can load the flow with”:

from langflow import load_flow_from_json

flow = load_flow_from_json("path/to/flow.json")
# Now you can use it like any chain
flow("Hey, have you heard of Langflow?")

--

--

Gary A. Stafford
Gary A. Stafford

Written by Gary A. Stafford

Area Principal Solutions Architect @ AWS | 10x AWS Certified Pro | Polyglot Developer | DataOps | GenAI | Technology consultant, writer, and speaker

No responses yet

Write a response