Skip to content

Ollama Model 节点#

Ollama Model 节点允许您使用本地 Llama 2 模型。

本页将介绍 Ollama Model 节点的参数配置,并提供更多资源链接。

该节点不支持工具功能,因此无法与 AI Agent 节点配合使用。请改为连接 Basic LLM Chain 节点。

凭据

您可以在此处查看该节点的认证信息。

/// 注意 | 子节点中的参数解析 子节点在使用表达式处理多个项目时的行为与其他节点不同。

大多数节点(包括根节点)会接收任意数量的输入项,处理这些项目,然后输出结果。您可以使用表达式来引用输入项,节点会依次为每个项目解析表达式。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 会依次解析为每个名称。

而在子节点中,表达式总是解析为第一个项目。例如,给定五个 name 值作为输入,表达式 {{ $json.name }} 总是解析为第一个名称。 ///

节点参数#

  • 模型:选择用于生成补全内容的模型。可选:
    • Llama2
    • Llama2 13B
    • Llama2 70B
    • Llama2 Uncensored

有关可用模型的更多信息,请参阅 Ollama 模型库文档

节点选项#

  • 采样温度:控制采样过程的随机性。较高的温度会产生更多样化的采样结果,但会增加幻觉风险。
  • Top K:设置模型用于生成下一个 token 的候选 token 数量。
  • Top P:设置补全内容应使用的概率阈值。较低的值会忽略概率较低的选项。

模板与示例#

Chat with local LLMs using n8n and Ollama

by Mihai Farcas

View template details
🔐🦙🤖 Private & Local Ollama Self-Hosted AI Assistant

by Joseph LePage

View template details
🐋DeepSeek V3 Chat & R1 Reasoning Quick Start

by Joseph LePage

View template details
Browse Ollama 模型 integration templates, or search all templates

相关资源#

有关该服务的更多信息,请参考 LangChains 的 Ollama 文档

查看 n8n 的高级 AI 文档。

常见问题#

关于常见问题及其解决方案,请参阅常见问题

AI glossary#

  • completion: Completions are the responses generated by a model like GPT.
  • hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
  • vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
  • vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.

自托管 AI 入门套件#

初次接触 AI 并使用自托管版 n8n?试试 n8n 的自托管 AI 入门套件,通过 Ollama、Qdrant 和 PostgreSQL 快速搭建概念验证或演示环境。