微信扫码
与创始人交个朋友
我要投稿
本文详述了One-api + Dify 本地Docker部署全流程,普通CPU笔记本电脑,win11环境实测
实操本文的必要(劝退)条件
|
1. 基本信息
1.1 One API 介绍
https://github.com/songquanpeng/one-api |
简而言之,One API是一套管理LLM大模型API Key的 “路由器”。 |
输出:一个标准的API接口,即所谓“令牌”
1.2 Dify 介绍
Dify Do it for yourself Dify是一个开源的LLM应用程序开发平台。Dify直观的界面结合了AI工作流、RAG管道、代理功能、模型管理、可观察等,让您快速从原型到生产。 https://dify.ai/zh |
2. 本机部署流程
我的笔记本事先装好了docker desktop,one api和dify最方便的方式也是docker部署,所以本着能省(力气)则省的原则,本文仅介绍docker部署流程。
git clone https://github.com/langgenius/dify.gitcd dify\dockerdocker compose up -d
git clone https://github.com/langgenius/dify.git Cloning into 'dify'...remote: Enumerating objects: 60539, done.remote: Counting objects: 100% (6168/6168), done.remote: Compressing objects: 100% (819/819), done.remote: Total 60539 (delta 5569), reused 5602 (delta 5324), pack-reused 54371Receiving objects: 100% (60539/60539), 36.13 MiB | 12.81 MiB/s, done.Resolving deltas: 100% (43500/43500), done.Updating files: 100% (4877/4877), done.
第三步 docker compose执行会有段时间,失败了就多搞几次。有梯子一般很快。容器创建成功后,docker desktop里可以看到如下:
http://localhost:80
依旧是Windows终端,选好路径,依次执行:
git clone https://github.com/songquanpeng/one-api.gitcd one-apidocker-compose up -d [+] Running 26/26✔ one-api 4 layers [⣿⣿⣿⣿]0B/0BPulled 82.6s ✔ d25f557d7f31 Already exists 0.0s ✔ 1b5b003f9dfb Pull complete9.3s ✔ 191451707000 Pull complete 69.7s ✔ a2827533ea71 Pull complete 10.9s✔ redis 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿]0B/0BPulled33.0s ✔ a3ed95caeb02 Pull complete0.7s ✔ 7059585c469e Pull complete4.2s ✔ 782c76bb9e67 Pull complete0.7s ✔ 706514fbad74 Pull complete0.9s ✔ 62f9861bf413 Pull complete 17.2s ✔ d9a5cf315f9b Pull complete1.2s ✔ 43310c2277ff Pull complete1.6s ✔ b3e03532a808 Pull complete1.9s ✔ 9c59e8378f86 Pull complete2.5s✔ db 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]0B/0BPulled244.6s ✔ 558b7d69a2e5 Pull complete120.0s ✔ 599b67b0dd6a Pull complete 15.3s ✔ 50314d46ce2b Pull complete 23.6s ✔ 494babc92263 Pull complete 57.4s ✔ 02548e6f2dbf Pull complete 61.6s ✔ a9e5e2637e0d Pull complete 64.5s ✔ 657b198fe6b7 Pull complete208.8s ✔ 215a2b0eabbf Pull complete 70.8s ✔ 377a4c7a89c5 Pull complete224.2s ✔ 4bfe599fe218 Pull complete121.4s[+] Running 3/4- Network one-api_defaultCreated2.6s✔ Container redisStarted1.9s✔ Container mysqlStarted1.9s✔ Container one-apiStarted1.9s
浏览器输入:http://localhost:3000/,注册用户,root用户默认密码 123456 ,记得修改。
sk-X*******************************************************9
进入设置
在Dify的工作室里创建一个空白应用,比如选聊天助手:
本文涉及软件版本:
One-API:v0.6.7-alpha.6
Dify:0.6.11
Docker desktop:Docker Engine v25.0.3
53AI,企业落地应用大模型首选服务商
产品:大模型应用平台+智能体定制开发+落地咨询服务
承诺:先做场景POC验证,看到效果再签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2024-03-30
2024-05-09
2024-07-07
2024-07-01
2024-06-24
2024-07-23
2024-06-08
2024-06-05
2024-06-21
2024-07-11
2024-11-12
2024-11-11
2024-10-29
2024-10-22
2024-10-18
2024-10-16
2024-10-15
2024-10-10