docs: added fetching from notion (#2670)

* Added new Docusaurus instance that fetches automatically from Notion

* Add Github workflow to fetch docs from Notion

* Added legacy peer deps to solve dependency problems

* Fix git ignore and added pages
This commit is contained in:
Lucas Oliveira 2024-07-12 17:59:52 -03:00 committed by GitHub
commit 3aa2513a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
354 changed files with 20640 additions and 23291 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 KiB

View file

@ -0,0 +1 @@
{"position":6, "label":"Deployment"}

View file

@ -0,0 +1,76 @@
---
title: Docker
sidebar_position: 2
slug: /deployment-docker
---
This guide will help you get LangFlow up and running using Docker and Docker Compose.
## Prerequisites {#856bb2d98156402bbd1980365b98110c}
- Docker
- Docker Compose
## Clone repo and build Docker container {#ba89773aa8b8425b985bfe7ba91c35cc}
1. Clone the LangFlow repository:
`git clone https://github.com/langflow-ai/langflow.git`
2. Navigate to the `docker_example` directory:
`cd langflow/docker_example`
3. Run the Docker Compose file:
`docker compose up`
LangFlow will now be accessible at [http://localhost:7860/](http://localhost:7860/).
## Docker Compose configuration {#02226209cad24185a6ec5b69bd820d0f}
The Docker Compose configuration spins up two services: `langflow` and `postgres`.
### LangFlow service {#d749848451ea43bd86f6f096dc77e6e6}
The `langflow` service uses the `langflowai/langflow:latest` Docker image and exposes port 7860. It depends on the `postgres` service.
Environment variables:
- `LANGFLOW_DATABASE_URL`: The connection string for the PostgreSQL database.
- `LANGFLOW_CONFIG_DIR`: The directory where LangFlow stores logs, file storage, monitor data, and secret keys.
Volumes:
- `langflow-data`: This volume is mapped to `/var/lib/langflow` in the container.
### PostgreSQL service {#121140decbfe4997b12213bdd2c4da7e}
The `postgres` service uses the `postgres:16` Docker image and exposes port 5432.
Environment variables:
- `POSTGRES_USER`: The username for the PostgreSQL database.
- `POSTGRES_PASSWORD`: The password for the PostgreSQL database.
- `POSTGRES_DB`: The name of the PostgreSQL database.
Volumes:
- `langflow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
## Switch to a specific LangFlow version {#2b3e191ea48f4feab89242433cf012d5}
If you want to use a specific version of LangFlow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.

View file

@ -0,0 +1,56 @@
---
title: GCP
sidebar_position: 3
slug: /deployment-gcp
---
# Deploy on Google Cloud Platform {#4ee01cda736c4f7396936409f23cdb52}
> Warning: This page may contain outdated information. It will be updated as soon as possible.
## Run Langflow from a New Google Cloud Project {#ce729796d7404ccdb627bee47d6a4399}
This guide will help you set up a Langflow development VM in a Google Cloud Platform project using Google Cloud Shell.
> Note: When Cloud Shell opens, be sure to select Trust repo. Some gcloud commands might not run in an ephemeral Cloud Shell environment.
## Standard VM {#245b47b450dd4159a5c56a5124bab84f}
[embed](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/langflow-ai/langflow&working_dir=scripts/gcp&shellonly=true&tutorial=walkthroughtutorial.md)
This script sets up a Debian-based VM with the Langflow package, Nginx, and the necessary configurations to run the Langflow Dev environment.
---
## Spot/Preemptible Instance {#de9b8f7c71284cbb98e8137a3c44553d}
When running as a [spot (preemptible) instance](https://cloud.google.com/compute/docs/instances/preemptible), the code and VM will behave the same way as in a regular instance, executing the startup script to configure the environment, install necessary dependencies, and run the Langflow application. However, **due to the nature of spot instances, the VM may be terminated at any time if Google Cloud needs to reclaim the resources**. This makes spot instances suitable for fault-tolerant, stateless, or interruptible workloads that can handle unexpected terminations and restarts.
---
## Pricing (approximate) {#2289f4ba9f544e6e9d4b915ef5aacd24}
> For a more accurate breakdown of costs, please use the GCP Pricing Calculator
| Component | Regular Cost (Hourly) | Regular Cost (Monthly) | Spot/Preemptible Cost (Hourly) | Spot/Preemptible Cost (Monthly) | Notes |
| ------------------ | --------------------- | ---------------------- | ------------------------------ | ------------------------------- | -------------------------------------------------------------------------- |
| 100 GB Disk | - | $10/month | - | $10/month | Disk cost remains the same for both regular and Spot/Preemptible VMs |
| VM (n1-standard-4) | $0.15/hr | ~$108/month | ~$0.04/hr | ~$29/month | The VM cost can be significantly reduced using a Spot/Preemptible instance |
| **Total** | **$0.15/hr** | **~$118/month** | **~$0.04/hr** | **~$39/month** | Total costs for running the VM and disk 24/7 for an entire month |

View file

@ -0,0 +1,26 @@
---
title: 🤗 Spaces
sidebar_position: 0
slug: /deployment-hugging-face-spaces
---
# HuggingFace Spaces {#00f5b3a6818d496dbb18e1a6a910e57d}
---
HuggingFace provides a great alternative for running Langflow in their Spaces environment. This means you can run Langflow in the cloud without any local installation required. Here's how you can get Langflow up and running on HuggingFace Spaces:
1. **Access Langflow Space**: Open a Chromium-based browser and navigate to the [Langflow Space](https://huggingface.co/spaces/Langflow/Langflow?duplicate=true). This link directs you to a pre-configured environment for Langflow.
2. **Duplicate the Space**: You'll encounter an option to duplicate the Langflow space. This step involves a few simple decisions:
- **Naming Your Space**: Assign a unique name to your new Space.
- **Visibility Settings**: Choose between Public or Private visibility for your Space.
- After setting these parameters, click on **Duplicate Space** to initiate the setup.
![](./257215214.png)
1. **Complete Installation**: The duplication and setup process begins immediately after you click **Duplicate Space**. Once completed, you will be automatically redirected to the main page of your new Space.
2. **Start Exploring Langflow**: With the setup complete, Langflow is now ready for use in your Space and you can start exploring its features and capabilities right away!

View file

@ -0,0 +1,361 @@
---
title: Kubernetes
sidebar_position: 1
slug: /deployment-kubernetes
---
This guide will help you get LangFlow up and running in Kubernetes cluster, including the following steps:
- Install [LangFlow as IDE](/deployment-kubernetes) in a Kubernetes cluster (for development)
- Install [LangFlow as a standalone application](/deployment-kubernetes) in a Kubernetes cluster (for production runtime workloads)
## LangFlow (IDE) {#cb60b2f34e70490faf231cb0fe1a4b42}
This solution is designed to provide a complete environment for developers to create, test, and debug their flows. It includes both the API and the UI.
### Prerequisites {#3efd3c63ff8849228c136f9252e504fd}
- Kubernetes server
- kubectl
- Helm
### Step 0. Prepare a Kubernetes cluster {#290b9624770a4c1ba2c889d384b7ef4c}
We use [Minikube](https://minikube.sigs.k8s.io/docs/start/) for this example, but you can use any Kubernetes cluster.
1. Create a Kubernetes cluster on Minikube.
```text
minikube start
```
2. Set `kubectl` to use Minikube.
```text
kubectl config use-context minikube
```
### Step 1. Install the LangFlow Helm chart {#b5c2a35144634a05a392f7e650929efe}
1. Add the repository to Helm.
```text
helm repo add langflow <https://langflow-ai.github.io/langflow-helm-charts>
helm repo update
```
2. Install LangFlow with the default options in the `langflow` namespace.
```text
helm install langflow-ide langflow/langflow-ide -n langflow --create-namespace
```
3. Check the status of the pods
```text
kubectl get pods -n langflow
```
```text
NAME READY STATUS RESTARTS AGE
langflow-0 1/1 Running 0 33s
langflow-frontend-5d9c558dbb-g7tc9 1/1 Running 0 38s
```
### Step 2. Access LangFlow {#34c71d04351949deb6c8ed7ffe30eafb}
Enable local port forwarding to access LangFlow from your local machine.
```text
kubectl port-forward -n langflow svc/langflow-langflow-runtime 7860:7860
```
Now you can access LangFlow at [http://localhost:7860/](http://localhost:7860/).
### LangFlow version {#645c6ef7984d4da0bcc4170bab0ff415}
To specify a different LangFlow version, you can set the `langflow.backend.image.tag` and `langflow.frontend.image.tag` values in the `values.yaml` file.
```yaml
langflow:
backend:
image:
tag: "1.0.0a59"
frontend:
image:
tag: "1.0.0a59"
```
### Storage {#6772c00af79147d293c821b4c6905d3b}
By default, the chart will use a SQLLite database stored in a local persistent disk.
If you want to use an external PostgreSQL database, you can set the `langflow.database` values in the `values.yaml` file.
```yaml
# Deploy postgresql. You can skip this section if you have an existing postgresql database.
postgresql:
enabled: true
fullnameOverride: "langflow-ide-postgresql-service"
auth:
username: "langflow"
password: "langflow-postgres"
database: "langflow-db"
langflow:
backend:
externalDatabase:
enabled: true
driver:
value: "postgresql"
host:
value: "langflow-ide-postgresql-service"
port:
value: "5432"
database:
value: "langflow-db"
user:
value: "langflow"
password:
valueFrom:
secretKeyRef:
key: "password"
name: "langflow-ide-postgresql-service"
sqlite:
enabled: false
```
### Scaling {#e1d95ba6551742aa86958dc03b26129e}
You can scale the number of replicas for the LangFlow backend and frontend services by changing the `replicaCount` value in the `values.yaml` file.
```yaml
langflow:
backend:
replicaCount: 3
frontend:
replicaCount: 3
```
You can scale frontend and backend services independently.
To scale vertically (increase the resources for the pods), you can set the `resources` values in the `values.yaml` file.
```yaml
langflow:
backend:
resources:
requests:
memory: "2Gi"
cpu: "1000m"
frontend:
resources:
requests:
memory: "1Gi"
cpu: "1000m"
```
### Deploy on AWS EKS, Google GKE, or Azure AKS and other examples {#a8c3d4dc4e4f42f49b21189df5e2b851}
Visit the [LangFlow Helm Charts repository](https://github.com/langflow-ai/langflow-helm-charts) for more information.
## LangFlow (Runtime) {#49f2813ad2d3460081ad26a286a65e73}
The runtime chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.
Using a dedicated deployment for a set of flows is fundamental in production environments to have granular resource control.
### Prerequisites {#3ad3a9389fff483ba8bd309189426a9d}
- Kubernetes server
- kubectl
- Helm
### Step 0. Prepare a Kubernetes cluster {#aaa764703ec44bd5ba64b5ef4599630b}
Follow the same steps as for the LangFlow IDE.
### Step 1. Install the LangFlow runtime Helm chart {#72a18aa8349c421186ba01d73a002531}
1. Add the repository to Helm.
```shell
helm repo add langflow <https://langflow-ai.github.io/langflow-helm-charts>
helm repo update
```
2. Install the LangFlow app with the default options in the `langflow` namespace.
If you bundled the flow in a docker image, you can specify the image name in the `values.yaml` file or with the `-set` flag:
If you want to download the flow from a remote location, you can specify the URL in the `values.yaml` file or with the `-set` flag:
```shell
helm install my-langflow-app langflow/langflow-runtime -n langflow --create-namespace --set image.repository=myuser/langflow-just-chat --set image.tag=1.0.0
```
```shell
helm install my-langflow-app langflow/langflow-runtime -n langflow --create-namespace --set downloadFlows.flows[0].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/src/backend/base/langflow/initial_setup/starter_projects/Basic%20Prompting%20(Hello%2C%20world!).json
```
3. Check the status of the pods.
```text
kubectl get pods -n langflow
```
### Step 2. Access the LangFlow app API {#e13326fc07734e4aa86dfb75ccfa31f8}
Enable local port forwarding to access LangFlow from your local machine.
```text
kubectl port-forward -n langflow svc/langflow-my-langflow-app 7860:7860
```
Now you can access the API at [http://localhost:7860/api/v1/flows](http://localhost:7860/api/v1/flows) and execute the flow:
```shell
id=$(curl -s <http://localhost:7860/api/v1/flows> | jq -r '.flows[0].id')
curl -X POST \\
"<http://localhost:7860/api/v1/run/$id?stream=false>" \\
-H 'Content-Type: application/json'\\
-d '{
"input_value": "Hello!",
"output_type": "chat",
"input_type": "chat"
}'
```
### Storage {#09514d2b59064d37b685c7c0acecb861}
In this case, storage is not needed as our deployment is stateless.
### Log level and LangFlow configurations {#ecd97f0be96d4d1cabcc5b77a2d00980}
You can set the log level and other LangFlow configurations in the `values.yaml` file.
```yaml
env:
- name: LANGFLOW_LOG_LEVEL
value: "INFO"
```
### Configure secrets and variables {#b91929e92acf47c183ea4c9ba9d19514}
To inject secrets and LangFlow global variables, you can use the `secrets` and `env` sections in the `values.yaml` file.
Let's say your flow uses a global variable which is a secret; when you export the flow as JSON, it's recommended to not include it.
When importing the flow in the LangFlow runtime, you can set the global variable using the `env` section in the `values.yaml` file.
Assuming you have a global variable called `openai_key_var`, you can read it directly from a secret:
```yaml
env:
- name: openai_key_var
valueFrom:
secretKeyRef:
name: openai-key
key: openai-key
```
or directly from the values file (not recommended for secret values!):
```yaml
env:
- name: openai_key_var
value: "sk-...."
```
### Scaling {#359b9ea5302147ebbed3ab8aa49dae8d}
You can scale the number of replicas for the LangFlow app by changing the `replicaCount` value in the `values.yaml` file.
```yaml
replicaCount: 3
```
To scale vertically (increase the resources for the pods), you can set the `resources` values in the `values.yaml` file.
```yaml
resources:
requests:
memory: "2Gi"
cpu: "1000m"
```
### Other examples {#8522b4276b51448e9f8f0c6efc731a7c}
Visit the LangFlow Helm Charts repository for more examples and configurations.
Use the default values file as reference for all the options available.
Visit the examples directory to learn more about different deployment options.

View file

@ -0,0 +1,27 @@
---
title: Railway
sidebar_position: 5
slug: /deployment-railway
---
# Deploy on Railway {#a9a1ce4d39e74cc29aef4d30c6172d10}
Railway is a cloud infrastructure platform that enables developers to deploy and manage applications effortlessly. It provides an intuitive interface, seamless integrations, and powerful features like auto-deploy from GitHub, managed databases, and automatic scaling.
Deploying Langflow to Railway involves a few simple steps:
1. **Click the Button Below**: Start by clicking the deployment button provided below. This will redirect you to the Railway platform.
[https://railway.app/template/JMXEWp?referralCode=MnPSdg](https://railway.app/template/JMXEWp?referralCode=MnPSdg)
2. **Deploy**: Proceed to deploy your Langflow instance. Click Deploy Now to deploy the instance. Railway will handle the rest, including setting up the infrastructure, deploying the Langflow instance, and starting the application.
![](./1098199232.png)
By following these steps, your Langflow instance will be successfully deployed on Railway.

View file

@ -0,0 +1,31 @@
---
title: Render
sidebar_position: 4
slug: /deployment-render
---
# Deploy on Render {#20a959b7047e44e490cc129fd21895c0}
[Render.com](http://render.com/) is a unified cloud platform designed to make deploying web applications, APIs, and static sites easy. It provides a streamlined experience with powerful features like automatic SSL, managed databases, and auto-deploy from Git, making it a popular choice for developers looking to simplify their deployment workflows.
Deploying Langflow to Render is a straightforward process that can be completed in just a few steps:
1. **Click the Button Below**: Start by clicking the deployment button provided below. This will redirect you to the Render platform.
[https://render.com/deploy?repo=https://github.com/langflow-ai/langflow/tree/dev](https://render.com/deploy?repo=https%3A%2F%2Fgithub.com%2Flangflow-ai%2Flangflow%2Ftree%2Fdev)
2. **Select the Default Configuration**: Once on the Render platform, you will be prompted to provide a blueprint name and to select the default configuration for Langflow. This configuration includes all the necessary settings and resources to run Langflow efficiently. You can change the branch of the repo to “main” or “dev” based on your preference. Click “Create New Resources” to proceed.
![](./1861599636.png)
3. **Deploy**: After selecting the configuration, proceed to deploy your Langflow instance. You can keep the default Starter instance, or change it to another instance based on your specific needs. Click Apply to deploy the instance. Render will handle the rest, including setting up the database, deploying the Langflow instance, and starting the application.
![](./1929176153.png)
By following these steps, your Langflow instance will be successfully deployed on Render. Remember to review the pricing details on the Render platform to understand any costs involved.