Skip to content

Commit

Permalink
feat: add LangFlow FastAPI example
Browse files Browse the repository at this point in the history
This commit adds a FastAPI example that starts up a LangFlow instance. The
example includes a README.md file with instructions on how to use the example,
a main.py file, a pyproject.toml file with dependencies, a railway.json file
with deployment configuration, and a requirements.txt file with the LangFlow
dependency.
  • Loading branch information
ogabrielluiz committed May 16, 2023
0 parents commit a887073
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: LangFlow
description: A LangFlow instance.
tags:
- langflow
- python
---

# FastAPI Example

This example starts up a [LangFlow](https://github.com/logspace-ai/langflow.git) instance.

<!-- [![Deploy on Railway](https://railway.app/button.svg)]() -->
## ✨ Features

- LangFlow
- Python 3

## 💁‍♀️ How to use

- Deploy using the button 👆
- Clone locally and install packages with Pip using `pip install -r requirements.txt` or Poetry using `poetry install`
- Connect to your project using `railway link`
- Run locally using `langflow`
Empty file added main.py
Empty file.
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.poetry]
name = "railway-langflow-template"
version = "0.1.0"
description = "This example starts up LangFlow"
authors = ["Gabriel Almeida <[email protected]>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.10"
langflow = "*"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
11 changes: 11 additions & 0 deletions railway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "pyhton -m langflow --host 0.0.0.0 --port $PORT",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
langflow

0 comments on commit a887073

Please sign in to comment.