Contribute to Langflow
This guide is intended to help you start contributing to Langflow. As an open-source project in a rapidly developing field, Langflow welcomes contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
To contribute code or documentation to this project, follow the fork and pull request workflow.
Install Langflow from source
Install Langflow from source by forking the repository, and then set up your development environment using Make.
Prerequisites
For Windows installations, you don't need need Make, and you can find Windows scripts in the Langflow repository.
Clone the Langflow repository
-
Fork the Langflow GitHub repository.
-
Add the new remote to your local repository on your local machine:
_10git remote add FORK_NAME https://github.com/GIT_USERNAME/langflow.git
Replace the following:
FORK_NAME
: A name for your fork of the repositoryGIT_USERNAME
: Your Git username
Run Langflow from source
If you're not developing, but want to run Langflow from source after cloning the repo, run the following commands.
- macOS/Linux
- Windows
- To run Langflow from source, run the following command:
_10make run_cli
This command does the following:
- Installs frontend and backend dependencies
- Builds the frontend static files
- Starts the application with default settings
The Langflow frontend is available at http://localhost:7860/
.
To run Langflow from source on Windows, you can use the Langflow project's included scripts, or run the commands in the terminal.
-
To run Langflow with the included scripts, navigate to the
scripts/windows
directory. Two scripts are available to install and start Langflow. -
Run Langflow with one of the scripts.
- Windows CMD
- Powershell
To install and start Langflow with a Windows Batch file, double-click build_and_run.bat
.
To install and start Langflow with the Powershell script, run:
_10.\build_and_run.ps1
Alternatively, to run Langflow from source with the Windows Command Line or Powershell, do the following.
- Windows CMD
- Powershell
- Run the following commands to build the Langflow frontend.
_10cd src/frontend && npm install && npm run build && npm run start
-
Copy the contents of the built
src/frontend/build
directory tosrc/backend/base/langflow/frontend
. -
To start Langflow, run the following command.
_10uv run langflow run
The frontend is served at http://localhost:7860.
- Run the following commands to build the Langflow frontend.
_10cd src/frontend_10npm install_10npm run build_10npm run start
-
Copy the contents of the built
src/frontend/build
directory tosrc/backend/base/langflow/frontend
. -
To start Langflow, run the following command.
_10uv run langflow run
The frontend is served at http://localhost:7860.
Set up your Langflow development environment
- macOS/Linux
- Windows
-
To set up the Langflow development environment, run the following command:
_10make initThis command sets up the development environment by doing the following:
- Checking for uv and npm.
- Installing backend and frontend dependencies.
- Installing pre-commit hooks.
-
Run the backend and frontend in separate terminals for development:
_10# Run backend in development mode (includes hot reload)_10make backend_10_10# In another terminal, run frontend in development mode (includes hot reload)_10make frontendThe frontend is served at
http://localhost:7860
.The
make backend
andmake frontend
commands automatically install dependencies, so you don't need to run install commands separately. -
Optional: Install pre-commit hooks to help keep your changes clean and well-formatted.
make init
installs pre-commit hooks automatically._10uv sync_10uv run pre-commit installnoteWith pre-commit hooks installed, you need to use
uv run git commit
instead ofgit commit
directly. -
To test your changes, run
make lint
,make format
, andmake unit_tests
before pushing to the repository. To run all tests, including unit tests, integration tests, and coverage, runmake tests
.
Since Windows does not include make
, building and running Langflow from source uses npm
and uv
.
To set up the Langflow development environment, run the frontend and backend in separate terminals.
-
To run the frontend, run the following commands.
_10cd src/frontend_10npm install_10npm run start -
To run the backend, run the following command.
_10uv run langflow run --backend-only
The frontend is served at http://localhost:7860
.
Debug
The repo includes a .vscode/launch.json
file for debugging the backend in VSCode, which is faster than debugging with Docker Compose. To debug Langflow with the launch.json
file in VSCode:
For more information, see the VSCode documentation.
Additional contribution guides
Contribute documentation
The documentation is built using Docusaurus and written in Markdown. Contributions should follow the Google Developer Documentation Style Guide.
Prerequisites
Clone the Langflow repository
-
Fork the Langflow GitHub repository.
-
Add the new remote to your local repository on your local machine:
_10git remote add FORK_NAME https://github.com/GIT_USERNAME/langflow.git
Replace the following:
FORK_NAME
: A name for your fork of the repositoryGIT_USERNAME
: Your Git username
- From your Langflow fork's root, change directory to the
langflow/docs
folder with the following command:
_10cd docs
- To install dependencies and start a local Docusaurus static site with hot reloading, run:
_10yarn install_10yarn start
The documentation is available at localhost:3000
.
The Markdown content files are located in the langflow/docs/docs
folder.
- Optional: Run
yarn build
to build the site locally and ensure there are no broken links.
Open a pull request
To submit a pull request, do the following:
- Open a new GitHub pull request with your patch against the
main
branch. - Ensure the PR title follows semantic commit conventions. For example, features are
feat: add new feature
and fixes arefix: correct issue with X
.
Some additional guidance on pull request titles:
- Ensure the pull request description clearly describes the problem and solution. If the PR fixes an issue, include a link to the fixed issue in the PR description with
Fixes #1234
. - Pull request titles appear in Langflow's release notes, so they should explain what the PR does as explicitly as possible.
- Pull requests should strive to fix one thing only, and should contain a good description of what is being fixed.
- A Langflow maintainer will review your pull request and may request changes, so ensure you pay attention to your PRs. Thanks for your contribution!
For more information, see the Python Developer's Guide.