Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add langflow runtime chart #24

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions ragstack/charts/langflow-runtime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# LangFlow runtime chart

Deploy LangFlow flows to Kubernetes with this Helm chart.

## Import a flow

There are two ways to import a flow:

1. **From a remote location**: You can reference a flow stored in a remote location, such as a URL or a Git repository by customizing the `values.yaml` file in the section `downloadFlows`:

```yaml
downloadFlows:
flows:
- url: https://raw.githubusercontent.com/langflow-ai/langflow/dev/tests/data/BasicChatwithPromptandHistory.json
# basicAuth: "myuser:mypassword"
# headers:
# Authorization: "Bearer my-key"
```

2. **Packaging the flow as docker image**: You can add a flow from to a docker image based on Langflow runtime and refer to it in the chart.
See an example in the `apps` directory.

## Deploy the flow

```
helm install langflow ./langflow-runtime \
--set "downloadFlows.flows[0].uuid=4ca07770-c0e4-487c-ad42-77c6039ce02e" \
--set "downloadFlows.flows[0].url=https://raw.githubusercontent.com/nicoloboschi/langflow-flows/main/openai.json" \
--set replicaCount=1

kubectl port-forward svc/langflow-langflow-runtime 7860:7860

curl -X POST \
"http://localhost:7860/api/v1/run/4ca07770-c0e4-487c-ad42-77c6039ce02e?stream=false" \
-H 'Content-Type: application/json'\
-d '{"input_value": "message",
"output_type": "chat",
"input_type": "chat",
"tweaks": {
"ChatInput-1BPcY": {},
"ChatOutput-J1bsS": {}
}}'

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ghcr.io/datastax/ragstack-ai-langflow-backend:0.0.8
RUN mkdir /app/flows
COPY ./*json /app/flows/.
ENV LANGFLOW_LOAD_FLOWS_PATH=/app/flows
15 changes: 15 additions & 0 deletions ragstack/charts/langflow-runtime/examples/just-chat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Package the flow as docker image

You can package the flow as a docker image and refer to it in the chart.

```
docker build -t langflow-just-chat .
```

Then refer to this image in the `values.yaml`:

```yaml
image:
repository: langflow-just-chat
tag: latest
```
Loading