尝试从 Azure 虚拟机 (ubuntu) 中的 ollama 设置获取 API 响应

问题描述 投票:0回答:1

我在运行 ubuntu 的 Azure 虚拟机上安装并配置了 ollama,并尝试从另一台计算机进行 API 调用,有点像我尝试设置自己的 ollama 服务器并面临 API 连接问题。

我尝试运行本地主机 API,例如:

curl http://localhost:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?",
  "response": "The",
  "done": false
}'

这次成功了,

我为虚拟机端口 11434 设置了入站规则,并尝试使用虚拟机的公共 IP 进行 API 调用,但连接失败:连接被拒绝

我应该使用密码或身份验证吗?比如我错过了什么?

curl http://<public ip>:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?",
  "response": "The",
  "done": false
}'
azure networking artificial-intelligence ollama
1个回答
0
投票

此链接中的解决方案,我们需要配置 ollamaserve here

© www.soinside.com 2019 - 2024. All rights reserved.