AI
Langflow
What is Langflow?
Langflow is a new, visual framework for building multi-agent and RAG applications. It is open-source, Python-powered, fully customizable, and LLM and vector store agnostic.
Install
- Install UV
> curl -LsSf https://astral.sh/uv/install.sh | sh
#or
> pip install uv
- Install Langflow
> conda create -n langflow python=3.12
> conda activate langflow
> uv pip install langflow
- Upgrading Langflow
> pip install --upgrade langflow
Getting Started
Prerequisites
- Get Langflow API Key here
- An Astra DB vector database with:
- AstraDB application token
- API endpoint
- A collection in Astra
> uv run langflow run
To make Langflow publicly accessible, execute the following command in place of the previous one:
> uv run langflow run --host 0.0.0.0 --port 7860
System Service
To make Langflow start automatically when it is installed in a Conda virtual environment, you can create a systemd service.
Here’s how to do it:
- Locate the Langflow Executable
> conda activate langflow
> which langflow
It returns result like this:
/home/ubuntu/miniconda3/envs/langflow/bin/langflow
- Create a Systemd Service
> sudo nano /etc/systemd/system/langflow.service
[Unit]
Description=Langflow Service
After=network.target
[Service]
Type=simple
User=ubuntu
ExecStart=/home/ubuntu/miniconda3/envs/langflow/bin/uv run langflow run
Restart=always
Environment="PATH=/home/ubuntu/miniconda3/envs/langflow/bin/:$PATH"
Environment="DO_NOT_TRACK=true"
[Install]
WantedBy=multi-user.target
- Enable the Service
> sudo systemctl daemon-reload
> sudo systemctl enable langflow
> sudo systemctl start langflow
- Verify the Service
> sudo systemctl status langflow
- Check processes for Langflow
> ps aux | grep langflow
Ngrok
- Create or edit the Ngrok config file:
> nano ~/.config/ngrok/ngrok.yml
#or
> ngrok config edit
- Place the configurations into the config file:
version: 3
agent:
authtoken: 2kn*********
tunnels:
langflow:
proto: http
addr: 7860