Duaer

AI 配方

在 Duaer 里用 Ollama 跑本地大模型

自托管的 Duaer 可以连本机或内网的 Ollama,把 Llama、Qwen 这类开源模型接到 AI Agent 和 RAG 上,数据不出你的服务器。

在 Duaer 里接 Ollama

  1. 在服务器上装好 Ollama,拉一个模型,例如 ollama pull qwen2.5 或 ollama pull llama3.2。
  2. 在 Duaer 凭证里新建 Ollama,Base URL 按部署方式填:同一台机器直接运行 Duaer 填 http://localhost:11434;Duaer 在 Docker 里填 http://host.docker.internal:11434;同一个 docker compose 里填 http://ollama:11434。见 Duaer 里的 Ollama 凭证。
  3. 在 AI Agent 或 Basic LLM Chain 的 Chat Model 上挂 Ollama Chat Model,从 Model 列表里选拉好的模型。
  4. 点执行此步骤确认能回答。

全本地的 RAG

向量也想留在本地时,用 Embeddings Ollama 代替 Embeddings OpenAI,先 ollama pull nomic-embed-text。其余步骤同 Google Drive 文档问答。

连不上时

  • Ollama 默认只听 127.0.0.1。Duaer 在别的机器或容器里时,启动 Ollama 前设 OLLAMA_HOST=0.0.0.0。
  • AI Agent 要调用工具时,选支持工具调用的模型,例如 qwen2.5、llama3.1 及以上。
  • Duaer 云连不到你电脑上的 localhost。要在云上用,把 Ollama 放到有 HTTPS 的反向代理后面,并在凭证里填 API Key。

常见问题

Duaer 云能直接用我电脑上的 Ollama 吗?

不能。Duaer 云访问不到你的 localhost。用自托管的 Duaer,或把 Ollama 放到公网 HTTPS 地址并设 API Key。

Duaer 里用 Ollama 要扣积分吗?

不扣 Duaer AI 积分。Ollama 跑在你自己的机器上,Duaer 只调用它。

同组