LangFlow For LangChain

LangFlow is a GUI for LangChain enabling easy experimentation and prototyping of LLM Apps and Prompt Chaining.

Cobus Greyling
4 min readMay 5, 2023

--

LangFlow is a native LLM Graphic Development Interface based on LangChain. If you are familiar with LangChain in any way, in terms of Chains, Agents and Prompt Engineering, this development interface will feel very intuitive.

In the image below, is a list of all the available Component groupings. Expanded, the list of development affordances for Chains, Prompts, Agents & LLMs are visible. This list is sure to grow as interest increases.

Below is a short tutorial on how to build a very simple LLM Chaining application and how to chat with the application.

To build the simplest of LLM Applications, three components are selected and dragged onto the design canvas:

  • PromptTemplate
  • OpenAI
  • LLMChain

In the OpenAI component, only the OpenAI API Key needs to be entered and the model selected. Within the PromptTemplate component the following prompt is added:

What is the weather like in general in {City}?

Add the prompt into the prompt template component in the following way:

Once the components are connected, the OpenAI API Key entered and the prompt added, the application is ready. Below a city name is entered and the weather description in general is given for that city.

Below is an example of a slightly more complex prompt which adds more variation to the application.

If {City} is a valid world city name, return what the weather is  like in that city.  If a no valid city name is entered, ask the user to enter a valid city name.

LangFlow is also available via HuggingFace, as seen below. The components and development affordances seem to be more. The interface is very reactive and also easy to use.

However, your application cannot be interacting via the chat widget. At the time of writing this, the web socket was not available at wss://logspace-langflow.hf.space.

You can install LangFlow from pip:

pip install langflow

And run LangFlow:

python -m langflow

⭐️ Please follow me on LinkedIn for updates on Conversational AI ⭐️

I’m currently the Chief Evangelist @ HumanFirst. I explore and write about all things at the intersection of AI and language; ranging from LLMs, Chatbots, Voicebots, Development Frameworks, Data-Centric latent spaces and more.

https://www.linkedin.com/in/cobusgreyling
https://www.linkedin.com/in/cobusgreyling

--

--

Cobus Greyling
Cobus Greyling

Written by Cobus Greyling

I’m passionate about exploring the intersection of AI & language. www.cobusgreyling.com

Responses (2)