一、OpenWebUI
1. 安装OpenWebUI
下面内容都是通过PiP部署的,非docker。
# 官方要求python3.11
pip3 install open-webui
2. 开启OpenWebUI服务
open-webui serve

开启后,在127.0.0.1:8080访问openwebui网页。

因为我的云服务只有2G,跑不了这么多服务,我把OpenWebUI部署在本地,通过Frp内网穿透实现外部访问。
二、Pipelines
官方文档:管道 | 开放式 WebUI --- ⚡ Pipelines | Open WebUI
1. 克隆 Pipelines 存储库:
git clone https://github.com/open-webui/pipelines.git
cd pipelines
2. 安装所需的依赖项:
pip install -r requirements.txt
3. 启动 Pipelines 服务器
sh ./start.sh
# 出现Linux 运行 sh 脚本有 \r 字符的问题
# 解决方法:sudo sed -i 's/\r//' test.shsudo sed -i 's/\r//' test.sh
4. 连接Pipelines 服务器
OpenWebUI 设置-外部连接,添加 URL 设置为 http://localhost:9099
,将 API 密钥(默认)设置为 0p3n-w3bu!
点击验证,弹出已验证服务器连接的提示,表面Pipelines启动成功。

三、Langgraph
上述步骤,连通OpenWebUI和Pipelines,现在需要在Pipelines中配置Langgraph。
langgraph pipeline案例路径在:pipelines/examples/pipelines/integrations/langgraph_pipeline
里面有两个文件:
- langgraph_example.py :langgraph的程序
- langgraph_stream_pipeline.py:提供与langgraph程序连接的数据管道,里面定义了langgraph的Pipeline类,这个文件不用改,使用的时候需要copy到pipelines/pipelines/目录下,重启pipelines服务即可加载langgraph_example模型。
1. langgraph_example.py
找到其中llm配置,改成自己的API。
llm = ChatOpenAI(
model="deepseek-r1-250120",
temperature=0.1,
base_url='https://ark.cn-beijing.volces.com/api/v3',
api_key='***********************************'
)
启动langgraph程序,steam里面默认是9000。
uvicorn langgraph_example:app --reload --port 9000 --host 127.0.0.1

启动成功。

2. langgraph_stream_pipeline.py
把pipelines/examples/pipelines/integrations/langgraph_pipeline/langgraph_stream_pipeline.py复制到pipelines/pipelines/下。

重启Pipelines,自动加载Pipelines/Pipelines/下的所有module,加载成功。

并产生一个新的文件夹langgraph_stream_pipeline

四、Frp
根据系统内核选择相应的frp
# linux查看内核 x86_64, AMD64, i386->AMD | aarch64, arm64, ARM->ARM
uname -m
# windows查看内核,cmd
echo %PROCESSOR_ARCHITECTURE%
1. 服务端
frps配置,还可以配置http服务等等

启动frps
./frps -c frps.toml

2. 客户端

启动frpc
frpc -c frpc.toml

在服务器端反向代理6000端口,就可以实现外部访问了。

五、效果
可以自定义langgraph实现更强的功能。

Comments NOTHING