Langflow is a powerful tool for building and deploying AI-powered agents and workflows. http://www.langflow.org
Find a file
Daniel Gines ca008a1346
fix: update PYTHON_REQUIRED extraction to correctly capture Python version (#3199)
* Updates and changes to the Makefile:

1. Added removal of `frontend` directory inside `src/backend/base/langflow/` and `build` directory inside `src/frontend/` to the `clean_npm_cache` target.
2. Added descriptive comments for the `build_and_install`, `build_and_run`, `fix_codespell`, `setup_poetry`, `unit_tests`, `integration_tests`, and `tests_frontend` targets.

Looking forward to your feedback.

* Improvements: Structure and Functionality Improvements

- Reorganized commands to facilitate understanding of the structure
- Enhanced check_tools to detect the Python version
- Added a multi-environment script to support check_tools
- make init now builds the frontend and runs the application
- Aesthetic improvements in output messages

TO-DO:
- Reorganize container-related commands
- Reorganize other miscellaneous utilities
- Document usage in the application docs
- Prepare the dev environment following the maintainers' recommended practices

* Removed pre-commit as it is no longer used.

* Restored 'patch' command in Makefile, it updates the 'pyproject.toml' with the new project version.

* fix: update PYTHON_REQUIRED extraction to correctly capture Python version

Changed the method of extracting the required Python version from `pyproject.toml`:

- Old method:
  `PYTHON_REQUIRED=$(shell grep "^python" pyproject.toml | sed -n 's/.*"\(.*\)"$$/\1/p')`

- New method:
  `PYTHON_REQUIRED=$(shell grep '^python[[:space:]]*=' pyproject.toml | sed -n 's/.*"\([^"]*\)".*/\1/p')`

The old method of capturing the Python version was too broad and could inadvertently match other dependencies starting with "python" (e.g., `python-socketio`, `python-dotenv`). This could lead to incorrect extraction of the required Python version, potentially causing version mismatches and failures in environment setup.

* fix: update PYTHON_REQUIRED extraction to correctly capture Python version

Changed the method of extracting the required Python version from `pyproject.toml`:

- Old method:
  `PYTHON_REQUIRED=$(shell grep "^python" pyproject.toml | sed -n 's/.*"\(.*\)"$$/\1/p')`

- New method:
  `PYTHON_REQUIRED=$(shell grep '^python[[:space:]]*=' pyproject.toml | sed -n 's/.*"\([^"]*\)".*/\1/p')`

The old method of capturing the Python version was too broad and could inadvertently match other dependencies starting with "python" (e.g., `python-socketio`, `python-dotenv`). This could lead to incorrect extraction of the required Python version, potentially causing version mismatches and failures in environment setup.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-08 15:15:41 +00:00
.devcontainer Update Python base image to version 3.10 in devcontainer.json 2024-04-17 11:21:05 -03:00
.github ci: refactor release workflow and Docker build process (#3245) 2024-08-08 08:04:50 -07:00
.vscode feat: import Graph without position information (#3203) 2024-08-07 07:04:48 -07:00
deploy fix: fix docker compose and add instructions (#2654) 2024-07-12 09:27:13 -07:00
docker fix: frontend image should forward /health_check to backend (#2887) 2024-07-23 15:08:43 +02:00
docker_example chore: simplify docker (#2526) 2024-07-04 11:14:52 -03:00
docs docs: update readme banner (#3174) 2024-08-05 14:40:20 +02:00
scripts chore: update makefile structure and functionality (#3000) 2024-07-30 06:43:13 -07:00
src feat: add Spider Web Scraper & Crawler (#2439) 2024-08-08 05:53:05 -07:00
.env.example fixing ThreadingInMemoryCache usage (#2604) 2024-07-10 04:52:37 -07:00
.eslintrc.json 🔧 (.pre-commit-config.yaml): Add eslint@9.1.1 as a dependency and enable autofix for pretty-format-json hook 2024-05-02 19:27:40 -03:00
.gitattributes Merge cz/mergeAll to two_edges 2024-06-10 11:31:02 -03:00
.gitignore fixing ThreadingInMemoryCache usage (#2604) 2024-07-10 04:52:37 -07:00
.pre-commit-config.yaml Update linting workflows for frontend and Python code (#2171) 2024-06-14 06:27:48 -07:00
CODE_OF_CONDUCT.md run codespell 2024-06-04 09:26:13 -03:00
CONTRIBUTING.md chore: improve contributors guidelines (#2784) 2024-07-18 12:31:58 -07:00
eslint.config.js 🔧 (.pre-commit-config.yaml): Add eslint@9.1.1 as a dependency and enable autofix for pretty-format-json hook 2024-05-02 19:27:40 -03:00
LICENSE Update organization name and URLs in configuration files 2024-04-18 11:58:19 -03:00
Makefile fix: update PYTHON_REQUIRED extraction to correctly capture Python version (#3199) 2024-08-08 15:15:41 +00:00
poetry.lock feat: add Spider Web Scraper & Crawler (#2439) 2024-08-08 05:53:05 -07:00
pyproject.toml feat: add Spider Web Scraper & Crawler (#2439) 2024-08-08 05:53:05 -07:00
README.ja.md docs: add Korean README (#2883) 2024-07-24 23:27:39 +00:00
README.KR.md docs: update korean readme (#2970) 2024-07-26 05:56:15 -03:00
README.md docs(readme): fix toc (#3152) 2024-08-01 19:56:54 +00:00
README.PT.md docs: add Korean README (#2883) 2024-07-24 23:27:39 +00:00
README.zh_CN.md docs: add Korean README (#2883) 2024-07-24 23:27:39 +00:00
render.yaml fix: update render.yaml to being compatible with langflow 1.0 (#3071) 2024-07-30 15:22:03 +02:00

Langflow 1.0 is OUT! 🎉

Read all about it here!

Langflow

A visual framework for building multi-agent and RAG applications

Open-source, Python-powered, fully customizable, LLM and vector store agnostic

Docs - Join our Discord - Follow us on X - Live demo

README in English README in Portuguese README in Simplified Chinese README in Japanese README in KOREAN

Your GIF

📝 Content

📦 Get Started

You can install Langflow with pip:

# Make sure you have >=Python 3.10 installed on your system.
python -m pip install langflow -U

Then, run Langflow with:

python -m langflow run

Running Langflow from a Cloned Repository

If you prefer to run Langflow from a cloned repository rather than installing it via pip, follow these steps:

  1. Clone the Repository

First, clone the Langflow repository from GitHub:

git clone https://github.com/langflow-ai/langflow.git

Navigate into the cloned directory:

cd langflow
  1. Build and Install Dependencies

To build and install Langflows frontend and backend, use the following commands:

make install_frontend && make build_frontend && make install_backend
  1. Run Langflow

Once the installation is complete, you can run Langflow with:

poetry run python -m langflow run

🎨 Create Flows

Creating flows with Langflow is easy. Simply drag components from the sidebar onto the workspace and connect them to start building your application.

Explore by editing prompt parameters, grouping components into a single high-level component, and building your own Custom Components.

Once youre done, you can export your flow as a JSON file.

Load the flow with:

from langflow.load import run_flow_from_json

results = run_flow_from_json("path/to/flow.json", input_value="Hello, World!")

Deploy

DataStax Langflow

DataStax Langflow is a hosted version of Langflow integrated with AstraDB. Be up and running in minutes with no installation or setup required. Sign up for free.

Deploy Langflow on Hugging Face Spaces

You can also preview Langflow in HuggingFace Spaces. Clone the space using this link to create your own Langflow workspace in minutes.

Deploy Langflow on Google Cloud Platform

Follow our step-by-step guide to deploy Langflow on Google Cloud Platform (GCP) using Google Cloud Shell. The guide is available in the Langflow in Google Cloud Platform document.

Alternatively, click the "Open in Cloud Shell" button below to launch Google Cloud Shell, clone the Langflow repository, and start an interactive tutorial that will guide you through the process of setting up the necessary resources and deploying Langflow on your GCP project.

Open in Cloud Shell

Deploy on Railway

Use this template to deploy Langflow 1.0 on Railway:

Deploy on Railway

Deploy on Render

Deploy to Render

Deploy on Kubernetes

Follow our step-by-step guide to deploy Langflow on Kubernetes.

🖥️ Command Line Interface (CLI)

Langflow provides a command-line interface (CLI) for easy management and configuration.

Usage

You can run the Langflow using the following command:

langflow run [OPTIONS]

Each option is detailed below:

  • --help: Displays all available options.
  • --host: Defines the host to bind the server to. Can be set using the LANGFLOW_HOST environment variable. The default is 127.0.0.1.
  • --workers: Sets the number of worker processes. Can be set using the LANGFLOW_WORKERS environment variable. The default is 1.
  • --timeout: Sets the worker timeout in seconds. The default is 60.
  • --port: Sets the port to listen on. Can be set using the LANGFLOW_PORT environment variable. The default is 7860.
  • --env-file: Specifies the path to the .env file containing environment variables. The default is .env.
  • --log-level: Defines the logging level. Can be set using the LANGFLOW_LOG_LEVEL environment variable. The default is critical.
  • --components-path: Specifies the path to the directory containing custom components. Can be set using the LANGFLOW_COMPONENTS_PATH environment variable. The default is langflow/components.
  • --log-file: Specifies the path to the log file. Can be set using the LANGFLOW_LOG_FILE environment variable. The default is logs/langflow.log.
  • --cache: Selects the type of cache to use. Options are InMemoryCache and SQLiteCache. Can be set using the LANGFLOW_LANGCHAIN_CACHE environment variable. The default is SQLiteCache.
  • --dev/--no-dev: Toggles the development mode. The default is no-dev.
  • --path: Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the LANGFLOW_FRONTEND_PATH environment variable.
  • --open-browser/--no-open-browser: Toggles the option to open the browser after starting the server. Can be set using the LANGFLOW_OPEN_BROWSER environment variable. The default is open-browser.
  • --remove-api-keys/--no-remove-api-keys: Toggles the option to remove API keys from the projects saved in the database. Can be set using the LANGFLOW_REMOVE_API_KEYS environment variable. The default is no-remove-api-keys.
  • --install-completion [bash|zsh|fish|powershell|pwsh]: Installs completion for the specified shell.
  • --show-completion [bash|zsh|fish|powershell|pwsh]: Shows completion for the specified shell, allowing you to copy it or customize the installation.
  • --backend-only: This parameter, with a default value of False, allows running only the backend server without the frontend. It can also be set using the LANGFLOW_BACKEND_ONLY environment variable.
  • --store: This parameter, with a default value of True, enables the store features, use --no-store to deactivate it. It can be configured using the LANGFLOW_STORE environment variable.

These parameters are important for users who need to customize the behavior of Langflow, especially in development or specialized deployment scenarios.

Environment Variables

You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a .env file and loaded using the --env-file option.

A sample .env file named .env.example is included with the project. Copy this file to a new file named .env and replace the example values with your actual settings. If you're setting values in both your OS and the .env file, the .env settings will take precedence.

👋 Contribute

We welcome contributions from developers of all levels to our open-source project on GitHub. If you'd like to contribute, please check our contributing guidelines and help make Langflow more accessible.


Star History Chart

🌟 Contributors

langflow contributors

📄 License

Langflow is released under the MIT License. See the LICENSE file for details.