Dify添加ollama模型失败:NewConnectionError: Failed to establish a new connection

问题描述

Dify 配置 ollama 模型时返回以下报错,无法连接到 ollama 服务:

An error occurred during credentials validation: HTTPConnectionPool(host=‘xxx ip’, port=11434): Max retries exceeded with url: /api/chat (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x7ff6c00d4440>: Failed to establish a new connection: [Errno 111] Connection refused’))

添加 ollama 模型时的报错截图:

在这里插入图片描述

问题排查

该问题主要是无法外部访问 ollama 服务引起。

以下排查命令主要基于 ubuntu 系统,Dify 和 ollama 都配置在 ubuntu 服务器上,Ollama 以 systemd 服务的形式运行。

第一步、检查ollama服务是否运行

首先在ollama部署的服务器上,用命令行验证 ollama 服务是否运行:

curl http://localhost:11434

结果显示:Ollama is running 证明ollama服务在运行状态。

如果 ollam

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值