当前位置: 首页 > news >正文

Ubuntu+deepseek+Dify本地部署

1.deepseek本地部署

在Ollama官网下载

需要魔法下载

curl -fsSL https://ollama.com/install.sh | sh

在官网找到需要下载的deepseek模型版本

 复制命令到终端

ollama run deepseek-r1:7b

停止ollama服务

sudo systemctl stop ollama # sudo systemctl stop ollama.service

开启ollama服务

 sudo systemctl start ollama.service

查看ollama服务状态

sudo systemctl start ollama.service

2.Dify本地部署

安装好docker

git clone https://github.com/langgenius/dify.git
cd dify
cd docker
cp .env.example .env
#########
#在.env文件的最后添加
#启用自定义模型
CUSTOM_MODEL_ENABLED=true
#指定Ollama的API地址(根据部署环境调整IP)
OLLAMA_API_BASE_URL=host.docker.internal:11434OLLAMA_API_BASE_URL=host.docker.internal:11434
########
docker compose up -d

此处若报错

+] Running 9/9
 ✘ sandbox Error       Cannot connect to the Docker daemon at unix:///var...                3.8s 
 ✘ api Error           Cannot connect to the Docker daemon at unix:///var/run...            3.8s 
 ✘ worker Error        Cannot connect to the Docker daemon at unix:///var/...               3.8s 
 ✘ weaviate Error      Cannot connect to the Docker daemon at unix:///va...                 3.8s 
 ✘ web Error           Cannot connect to the Docker daemon at unix:///var/run...            3.8s 
 ✘ db Error            Cannot connect to the Docker daemon at unix:///var/run/...           3.8s 
 ✘ ssrf_proxy Error    Get "https://registry-1.docker.io/v2/": proxyco...                   3.8s 
 ✘ redis Error         Get "https://registry-1.docker.io/v2/": proxyconnect...              3.8s 
 ✘ plugin_daemon Error Cannot connect to the Docker daemon at unix:...                      3.8s 
Error response from daemon: Get "https://registry-1.docker.io/v2/": proxyconnect tcp: dial tcp 11.0.250.2:10023: connect: connection refused

配置代理下载

systemctl edit docker.service
[Service]
Environment="HTTP_PROXY=http://ip:port/"
Environment="HTTPS_PROXY=http://ip:port/"
Environment="NO_PROXY=localhost,127.0.0.0/8"

访问http://localhost/install 如果服务器没有界面可在另外浏览器访问http://服务器IP/install

登陆后进入界面点击右上角设置

点击模型供应商下滑找到Ollama

点击添加模型

服务器终端输入ollama list找到添加的模型名称拷贝输入

基础URL填入可能报错

2f0>: Failed to establish a new connection: [Errno 111] Connection refused'))

解决办法

systemctl edit ollama.service

对于每个环境变量,在 [Service] 部分下添加一行 Environment

[Service]
Environment="OLLAMA_HOST=0.0.0.0"
systemctl daemon-reload
systemctl restart ollama

参考链接

https://zhuanlan.zhihu.com/p/22000177368

相关文章:

  • Kubernetes 资源利用率翻倍?离在线混合部署深度解析
  • 进程间的通信(消息队列和共享信息)
  • Docker 部署 MinIO 对象存储服务
  • 核货宝订货系统助力东南亚国家批发贸易企业数字化转型升级
  • 【Java】Spring Boot全量YAML配置说明
  • Java在云计算平台中的应用研究
  • 扩增子测序|R包microeco妙用之零模型计算群落确定性和随机性过程(NST,pNST,βNTI,RCbray生态过程计算)
  • Springboot 自动化装配的原理
  • Oracle 12c Docker安装问题排查 sga_target 1536M is too small
  • Mysql基础-多表查询(详细版)
  • MySQL安装多版本与版本切换
  • C语言文件操作函数详解
  • Dify部署无法拉取镜像
  • Leaflet介绍及使用示例
  • MySQL 中如何查看 SQL 的执行计划?
  • 支持selenium的chrome driver更新到133.0.6943.141
  • Java 内存泄漏排查指南:工具与实战技巧
  • 【EB-06】SystemCreator dbc转arxml
  • 网络安全内参
  • Spring Boot启动过程?
  • 政府效率部效果不佳?马斯克有意寻求支持,含糊表态部门未来
  • 受天气等影响SC8041航班三次备降延误超12小时,山航致歉
  • 李强签署国务院令,公布修订后的《中华人民共和国植物新品种保护条例》
  • 国际油价重挫!美股道指连跌三月,啥情况?
  • 上海:以税务支持鼓励探索更多的创新,助力企业出海
  • 关于新冠疫情防控与病毒溯源的中方行动和立场