1. 概述
基于LangChain实现的零代码平台,可以通过拖拽的方式轻松实现LLM Apps.
FlowiseAI/Flowise: Drag & drop UI to build your customized LLM flow
Getting Started - FlowiseAI
2. LLM Apps
2.1. 基于本地LLM的翻译应用
2.2. 基于本地LLM的聊天机器人
2.3. RAG应用
存在一个问题尚未解决:
https://github.com/lm-sys/FastChat/issues/2336
3. 如何部署
3.1. FastChat
3.2 Milvus
Install Milvus Standalone with Docker Compose Milvus documentation
- docker-compose.yml
version: '3.5'
services:
etcd:
container_name: milvus-etcd
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 30s
timeout: 20s
retries: 3
minio:
container_name: milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
ports:
- "9001:9001"
- "9000:9000"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
command: minio server /minio_data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
standalone:
container_name: milvus-standalone
image: milvusdb/milvus:v2.3.10
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
ports:
- "19530:19530"
- "9091:9091"
depends_on:
- "etcd"
- "minio"
networks:
default:
name: milvus
3.3. Flowise
- docker-compose.yaml
version: '3.4'
services:
mysql:
container_name: mysql
restart: always
image: mysql:8.0
environment:
- "MYSQL_ROOT_PASSWORD=1234" # 数据库密码,建议修改,如果修改需要同步修改bisheng/congfig/config.yaml配置
- "MYSQL_DATABASE=flowise"
- "TZ=Asia/Shanghai"
ports:
- "3306:3306"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/mysql/my.cnf:/etc/mysql/my.cnf
- ${DOCKER_VOLUME_DIRECTORY:-.}/data/mysql:/var/lib/mysql
flowise:
container_name: flowise
image: flowiseai/flowise
restart: always
environment:
- PORT=3000
- FLOWISE_USERNAME=admin
- FLOWISE_PASSWORD=1234
- DEBUG=true
- DATABASE_PATH=/data
- DATABASE_TYPE=mysql
- DATABASE_PORT=3306
- DATABASE_HOST=mysql
- DATABASE_NAME=flowise
- DATABASE_USER=root
- DATABASE_PASSWORD=1234
- APIKEY_PATH=/data
- SECRETKEY_PATH=/data
- FLOWISE_SECRETKEY_OVERWRITE=myencryptionkey
- LOG_LEVEL=debug
- LOG_PATH=/data/log
ports:
- '3000:3000'
volumes:
- ./data/flowise:/data
command: /bin/sh -c "sleep 3; flowise start"
depends_on:
- "mysql"
- my.cnf
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
# 解决 node 的兼容问题
default_authentication_plugin=mysql_native_password
init_connect='SET collation_connection = utf8mb4_unicode_ci, NAMES utf8mb4'
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
# skip-character-set-client-handshake
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
4. 后续
Flowise和LangChain是两个基于LLM(大型语言模型)的应用构建工具。本文主要介绍了如何利用Flowise和LangChain快速构建LLM应用。
通过结合Flowise和LangChain,开发者可以快速构建基于LLM的自然语言处理应用,实现文本分析、问答、文本生成等功能。
- Flowise提供了易用的界面和丰富的API接口,帮助开发者快速将自然语言处理任务集成到应用中。
- LangChain提供了多语言支持和统一的平台,帮助开发者在多个语言和领域中实现自然语言处理应用。
结合Flowise和LangChain,开发者可以更加高效地构建基于LLM的自然语言处理应用,为用户提供更加智能和便捷的服务。
Flowise|无代码 ChatBot 构建平台|LangChain - 知乎 (zhihu.com)
flowise-docker-compose: flowise-docker-compose (gitee.com)