🦜🔗Langchain without code -> LangFlow
Tags: langchain, langflow, nocode, tutorial
Published: 2023-09-10 18:10:40

---
title: "🦜🔗Langchain without code -> LangFlow"
description: "A guide for setting up and using Langflow on windows and mac."
tags: langchain, Langflow, nocode, tutorial
series: Langchain without coding
published: true
---

Langflow is also an excellent option for using Lngchain without code. It uses Python under the hood.

A feature I particularly love about Lanflow is support for custom actions within your flows. Let's get started.

## First-time set up

On Windows. I got Langflow to work by installing Python 3.10.11 ([download here](https://www.python.org/downloads/release/python-31011/ ) ), as well as install C++ build tools, which you can [download here](https://visualstudio.microsoft.com/downloads/?q=build+tools) 


With those prerequisites ready, run the following commands inside the folder where you want to install LangFlow

1. **Windows**: shift + right click > Open in terminal
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46zvq65htv2i4i8828im.png)
**Mac**: In Finder, activate the path bar by clicking View > Show path bar.
In the path bar, right-click your target folder and click Open in terminal

2. **Windows & MacOS:** Type `python -m venv langflow`.
&nbsp;
**Windows**:Type  `.\langflow\Scripts\activate`.
&nbsp;
**MacOS**: Type `source ./langflow/bin/activate`.
&nbsp;
3. You might need to restart your terminal at this point
Back in your terminal, type:
&nbsp;
**Windows & MacOS**: `pip install langflow` this will take a few minutes; when done
&nbsp;
**Windows & MacOS:** `python -m langflow`

4. In your web browser, go to [http://127.0.0.1:7860](http://127.0.0.1:7860)

## Welcome to langflow

You'll notice by the options at the center top that LangFlow has two main sections, Your Flows (Collections) and Flows shared by the community.

### Create your first Langchain application without code.

> You'll create an LLM app that helps users improve prompts for generating images in Midjourney. For example:
> A simple "_image of a house_" becomes a _"beautiful house from fairy tales, sunny spring morning, vibrant colors, award-winning composition"_  which should help the app user generate better images.

**Note**: At the time of writing this article, the chat-bison model and VextexAI embeddings are not supported out-of-the-box by Langflow. Limiting options substantially.

1. In Langflow, head over to **Community examples** > **MidJourney Prompt Chain**.
You'll see a flow similar to the screenshot below.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ekpxaps6naiynjxpdwjl.png)
&nbsp;
2. Click the OpenAI LLM box and then **delete**.
In the left-hand side panel, expand the LLM section and drag and drop the VertexAI element onto the canvas.
&nbsp;
3. Introduce the Following Parameters
**Credentials:** Browse and select your Service Account JSON file. Follow this guide to generate one.
**Location: **us-central1
Model Name: text-bison
**Project:** Your Google Cloud Project ID is available here.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gid48n0o6ulk9k8vf6i2.png)
&nbsp;
4. Connect the VertexAI node to the LLM model node in 
**ConversationalSummaryMemory**, as well as to the LLM node in **MidJourneyPromtChain**. Like this:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rguf0qj7ty5v8wkddeb2.png)
&nbsp;
5. Click the lightning icon and then the chat icon at the bottom right of Langflow.


## Using your LLM app
Interacting with LLM apps in Langflow is very similar to using other chatbots. In my case, I sent:
>macro picture of a dog
and got back
>A close-up of a dog's face, with its tongue hanging out and its eyes half-closed in contentment. The dog's fur is a light brown, and its ears are perked up. The background is a blurry green, with a few blades of grass in focus.


### The difference it makes.
I currently don't have Midjourney access, but the same principle should apply to Google's Imagen text-to-image technology.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/23soobb6cubtou0c3vg7.png)
The prompt generated by my app
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezcfz1uk479qy3fb0fuj.png)
You can definitely tell that the images generated with the improved prompt are more vibrant and visually appealing, although the results using the plain prompt are pretty good as well.

Congratulations!!! You've created your first LLM app.