Resources · n8n integration

n8n Ollama Model nodeConfigure Ollama Model in n8n.

The n8n Ollama Model node is how a workflow talks to a language model running on your own machine. It is a sub-node, meaning it has no main input and never runs on its own, so you attach it to the Model port of a root node. One picker, 21 parameters, and the text never leaves your network.

Verified Trustpilot reviews · AI, automation & growth agency

Why automate

What does the n8n Ollama Model node actually do?

The node hands a prompt to an Ollama instance you host and returns the completion to whichever root node asked for it. It does not sit in the main flow of a workflow. In n8n's AI nodes, a root node receives the workflow items and sub-nodes attach to its ports, one type of sub-node per port. This one occupies the ai_languageModel port, and it stays idle until a root node calls it.

The first scenario is the private assistant. A Basic LLM Chain takes a question, the Ollama Model node answers it with a model you pulled onto your own server, and the reply goes back into the workflow. Nothing is sent to a hosted provider, which is the whole point when the prompt carries customer data or an internal document. Post the answer to Slack and the loop is closed.

The second one is verification. A dedicated checking model reads a claim and the source text, and says whether the claim holds. Two Ollama Model nodes can sit in the same workflow on two different chains, each with its own value in Model, one generating and one checking. Sampling Temperature low on the checker keeps its verdict stable.

The third is on-premises retrieval. Documents get split, embedded and stored in a vector store, and a summarization chain or a question-answer chain uses this node to write the final answer from the retrieved passages. Feed the pipeline from Google Sheets or an inbox and the whole chain, from source to answer, runs behind your own firewall.

When should you pick something else? The official node documentation is explicit: this node lacks tools support, so it will not work with the AI Agent node, and you should connect it to a Basic LLM Chain instead. An agent that has to call tools, or an AI Agent Tool nested inside another agent, needs a chat model that supports them, which is where the OpenAI or Anthropic nodes come in. Those providers bill their own API calls; n8n adds nothing on top.

Two limits are worth knowing before you build. Expressions behave differently in a sub-node: where a normal node resolves {{ $json.field }} once per item, here the expression always resolves to the first item, so a list of five prompts will not fan out from this node. And Ollama does not support custom HTTP agents in its configuration, which makes it awkward to run behind a custom proxy even with the usual environment variables set. Both are quirks of the sub-node model rather than bugs, and both are easier to design around than to debug later.

Connect

What do you need to connect it?

  1. 01

    Run Ollama and pull a model

    Ollama has to be reachable from n8n before the node shows anything useful. Install it on the host or start the official container, publishing the port: docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama. Port 11434 is the default Ollama listens on. Then download at least one model from the Ollama Models Library, because the Model picker in the node offers what your instance can serve.

  2. 02

    Create the Ollama credential in n8n

    Open the Credentials menu in n8n and add an Ollama credential. The important field is the base URL, the address n8n calls: http://localhost:11434 when both pieces sit on the same machine. If your Ollama instance is remote and sits behind an authenticated proxy such as Open WebUI, the node supports Bearer token authentication, so fill in both the remote URL and the API key. The credential is created once and reused across every workflow.

  3. 03

    Attach the node to a root node

    Add the Ollama Model node to the canvas and drag its connector onto the Model port of a root node, a Basic LLM Chain to start with. A port is simply the labelled socket under a root node where one type of sub-node plugs in. Select your credential and pick a value in Model. Leave everything else alone on the first run; the node has no main input, so no wire comes into it from the left.

Connections

Where does this sub-node plug in?

n8n's AI nodes work as a cluster: one root node holds the logic and receives the workflow items, and sub-nodes like this one extend it through its ports. A sub-node never executes on its own, so the only question that matters is which socket it belongs in.

Output (what it plugs into)

  • Modelai_languageModel
01ModelThis node exposes a single output of type ai_languageModel, and it goes on the Model port of a root node. That connection is what makes the node run at all.

This node exposes a single output of type ai_languageModel, and it goes on the Model port of a root node. That connection is what makes the node run at all.

Key parameters

  • Required : the node has no main input and never executes alone, so an unconnected Ollama Model node is dead weight on the canvas.
  • Basic LLM Chain and Question and Answer Chain are the two easiest root nodes to start with, since both take a prompt and return text.
  • Summarization Chain and Information Extractor accept the same port when the job is condensing a document or pulling fields out of it.
Use cases
a self-hosted assistant built on a Basic LLM Chain, or a Summarization Chain that boils long support threads down before anyone reads them.
Parameters

What can you tune on the n8n Ollama Model node?

The Ollama Model node has 21 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.

01

Model

model

What you see in n8n

Notes & use cases

Nothing runs until this dropdown has a value. It names the model that will generate the completion, and the choice decides everything downstream: quality, speed, and how much memory the machine gives up while the model is loaded.

Key parameters

  • Model : the model which will generate the completion. The official node documentation lists Llama2, Llama2 13B, Llama2 70B and Llama2 Uncensored; to download models, visit the Ollama Models Library.
Use cases
a small model for a classification chain that runs hundreds of times a day, a larger one for the chain that writes a customer-facing summary once an hour.
02

Enable Thinking

options.think

What you see in n8n

Notes & use cases

Reasoning models keep a scratchpad before they answer. This switch decides whether that scratchpad stays separate from the result, and it only means anything on models that support the mode.

Key parameters

  • Enable Thinking : whether to enable (default) thinking mode for supported models. Enabled, the model's thinking process is separated from the output; disabled, the model outputs content directly.
Use cases
turn it off when a chain feeds the raw text straight into another node and stray reasoning would pollute the field being written.
03

Sampling Temperature

options.temperature

What you see in n8n

Notes & use cases

Randomness has a dial, and this is it. The same prompt run twice can come back worded differently, and how far apart those two answers land is exactly what this number controls.

Key parameters

  • Sampling Temperature : controls the randomness of the generated text. Lower values make the output more focused and deterministic, while higher values make it more diverse and random.
Use cases
keep it low on a chain that extracts a status from a ticket, raise it on one that drafts three subject lines to choose from.
04

Top K

options.topK

What you see in n8n

Notes & use cases

At each step the model ranks its whole vocabulary, then picks from the top of that ranking. A token is a fragment of text, roughly a word or part of one. This option sets how deep into the ranking the sampler is allowed to look.

Key parameters

  • Top K : limits the number of highest probability vocabulary tokens to consider at each step. A higher value increases diversity but may reduce coherence. Set to -1 to disable.
Use cases
tighten it when a local model starts drifting mid-paragraph on a long summarization run.
05

Top P

options.topP

What you see in n8n

Notes & use cases

Instead of counting candidates, this one counts probability. It keeps adding tokens to the pool until their combined probability crosses the threshold you set, then stops.

Key parameters

  • Top P : chooses from the smallest possible set of tokens whose cumulative probability exceeds the probability top_p. Helps generate more human-like text by reducing repetitions.
Use cases
a lower value on a chain that answers from retrieved documents, where an unlikely word usually means the model is straying from the source.
06

Frequency Penalty

options.frequencyPenalty

What you see in n8n

Notes & use cases

Repetition creeps in when the same token keeps winning the ranking. This penalty leans against tokens in proportion to how often they have already been used in the answer being written.

Key parameters

  • Frequency Penalty : adjusts the penalty for tokens that have already appeared in the generated text. Higher values discourage repetition.
Use cases
raise it slightly when a weekly digest keeps opening every bullet with the same four words.
07

Keep Alive

options.keepAlive

What you see in n8n

Notes & use cases

Loading a local model into memory costs real seconds. This field says how long Ollama should hold it there once the call is done, so the next run starts warm instead of paying that cost again.

Key parameters

  • Keep Alive : specifies the duration to keep the loaded model in memory after use. Useful for frequently used models. Format: 1h30m for one hour and thirty minutes.
Use cases
a workflow triggered every few minutes stays responsive; a nightly batch can let the model unload and give the memory back.
08

Low VRAM Mode

options.lowVram

What you see in n8n

Notes & use cases

Small graphics cards choke on large models. Switching this on trades speed for room, which is often the difference between a chain that runs and one that fails on the machine you actually have.

Key parameters

  • Low VRAM Mode : whether to activate low VRAM mode, which reduces memory usage at the cost of slower generation speed. Useful for GPUs with limited memory.
Use cases
running a self-hosted assistant on a modest office workstation rather than a dedicated inference server.
09

Main GPU ID

options.mainGpu

What you see in n8n

Notes & use cases

A machine with several graphics cards has to be told which one leads the computation. Left alone, this field is a non-event; on a multi-card server it decides where the load lands.

Key parameters

  • Main GPU ID : specifies the ID of the GPU to use for the main computation. Only change this if you have multiple GPUs.
Use cases
pinning a chatty internal assistant to one card so a second card stays free for a nightly embedding job.
10

Context Batch Size

options.numBatch

What you see in n8n

Notes & use cases

Before generating anything, the model has to read the prompt, and it reads it in batches. Widening the batch moves that reading phase along faster, at a cost you pay in memory.

Key parameters

  • Context Batch Size : sets the batch size for prompt processing. Larger batch sizes may improve generation speed but increase memory usage.
Use cases
a question-answer chain that stuffs several retrieved passages into every prompt spends most of its time here.
11

Context Length

options.numCtx

What you see in n8n

Notes & use cases

Context is a budget. Everything the model is allowed to look at while writing the next token, the prompt and what it has produced so far, has to fit inside this number.

Key parameters

  • Context Length : the maximum number of tokens to use as context for generating the next token. Smaller values reduce memory usage, while larger values provide more context to the model.
Use cases
raise it when a summarization chain keeps losing the beginning of a long email thread; lower it when memory is the binding constraint.
12

Number of GPUs

options.numGpu

What you see in n8n

Notes & use cases

Spreading the work over several cards is something you ask for explicitly here. The field counts the cards, where Main GPU ID names the one in charge.

Key parameters

  • Number of GPUs : specifies the number of GPUs to use for parallel processing. Set to -1 for auto-detection.
Use cases
a larger model on a two-card server, where letting auto-detection handle it is usually the right first move.
13

Max Tokens to Generate

options.numPredict

What you see in n8n

Notes & use cases

Answers can run away. This ceiling stops the model mid-flight, which protects both the execution time of the workflow and whatever node is waiting downstream for a field of reasonable size.

Key parameters

  • Max Tokens to Generate : the maximum number of tokens to generate. Set to -1 for no limit. Be cautious with a large value, as it can lead to very long outputs.
Use cases
cap it hard on a chain whose answer becomes the body of a Gmail reply.
14

Number of CPU Threads

options.numThread

What you see in n8n

Notes & use cases

Part of the work always lands on the processor, and on a machine without a usable graphics card all of it does. This field decides how many threads Ollama is allowed to claim.

Key parameters

  • Number of CPU Threads : specifies the number of CPU threads to use for processing. Set to 0 for auto-detection.
Use cases
capping threads on a server that also runs n8n itself, so the editor stays usable while a chain is generating.
15

Penalize Newlines

options.penalizeNewline

What you see in n8n

Notes & use cases

Line breaks are tokens too, and a model that reaches for them often produces answers chopped into fragments. This switch pushes it the other way.

Key parameters

  • Penalize Newlines : whether the model will be less likely to generate newline characters, encouraging longer continuous sequences of text.
Use cases
a chain that writes a paragraph destined for a spreadsheet cell, where stray line breaks make the column unreadable.
16

Presence Penalty

options.presencePenalty

What you see in n8n

Notes & use cases

Presence and frequency sound alike but count differently. This one cares only that a token has shown up at all, not how many times, and it nudges the model toward vocabulary it has not touched yet.

Key parameters

  • Presence Penalty : adjusts the penalty for tokens based on their presence in the generated text so far. Positive values penalize tokens that have already appeared, encouraging diversity.
Use cases
brainstorming chains, where five ideas that reuse the same noun are really one idea.
17

Repetition Penalty

options.repeatPenalty

What you see in n8n

Notes & use cases

A third repetition control sits beside the other two, and this is the blunt one: a single factor applied to tokens that come back around.

Key parameters

  • Repetition Penalty : adjusts the penalty factor for repeated tokens. Higher values more strongly discourage repetition. Set to 1.0 to disable repetition penalty.
Use cases
the fix when a small local model gets stuck in a loop and repeats the same sentence until the token limit cuts it off.
18

Use Memory Locking

options.useMLock

What you see in n8n

Notes & use cases

An operating system under pressure will swap a loaded model out to disk, and the next call crawls. Locking pins it in place so that cannot happen.

Key parameters

  • Use Memory Locking : whether to lock the model in memory to prevent swapping. This can improve performance but requires sufficient available memory.
Use cases
a shared server where other services compete for RAM and response times swing wildly between two runs of the same workflow.
19

Use Memory Mapping

options.useMMap

What you see in n8n

Notes & use cases

How the weights get read off disk is itself a choice. Memory mapping lets the system page them in as needed instead of pulling everything into RAM first.

Key parameters

  • Use Memory Mapping : whether to use memory mapping for loading the model. This can reduce memory usage but may impact performance. Recommended to keep enabled.
Use cases
leave it on, and treat turning it off as a deliberate experiment when a large model loads oddly on a specific host.
20

Load Vocabulary Only

options.vocabOnly

What you see in n8n

Notes & use cases

Sometimes the weights are beside the point. Loading only the vocabulary skips them entirely, which is fast and produces no real completion.

Key parameters

  • Load Vocabulary Only : whether to only load the model vocabulary without the weights. Useful for quickly testing tokenization.
Use cases
checking how a prompt gets split into tokens before committing to a Context Length value, not something to leave on in a production workflow.
21

Output Format

options.format

What you see in n8n

Notes & use cases

The shape of the API response is selectable, which matters when the next node expects structured data rather than prose it has to parse.

Key parameters

  • Output Format : specifies the format of the API response, either default (Default) or json (JSON).
Use cases
set it to json when an information extraction chain feeds its result into a node that writes named fields, and keep default for anything a human will read.
Need help

Need help automating Ollama Model with n8n?

A person reads every message.

FAQ

Questions about the Ollama Model node

01Is the n8n Ollama Model node included with n8n?
Yes. It belongs to n8n's AI package, shipped with n8n itself, on n8n Cloud as well as on a self-hosted instance under the Community Edition and its Sustainable Use licence. There is nothing to install and no extra cost on the n8n side. What you do need is an Ollama instance you run yourself, on the same machine as n8n or somewhere it can reach over the network, with at least one model downloaded. That part is your infrastructure, and it is also the reason people pick this node: the prompt and the answer stay on hardware you control.
02What credentials does it need?
An Ollama credential, created once in n8n's Credentials menu and reused in every workflow afterwards. The essential value is the base URL, the address n8n calls to reach Ollama, typically your host plus the default port 11434. There is no authentication selector on the node itself. If your instance is remote and sits behind an authenticated proxy such as Open WebUI, the node supports Bearer token authentication, so you set both the remote URL and the API key in the same credential. Unlike a hosted chat model, no provider account or billing setup is involved.
03What are the limits of this node?
Three matter in practice. First, it lacks tools support, so it will not work with the AI Agent node; the official documentation points you to the Basic LLM Chain instead. Second, it is a sub-node, and expressions behave differently there: given five input items, an expression like the usual field reference always resolves to the first one rather than running once per item. Third, Ollama does not support custom HTTP agents in its configuration, so a custom HTTP or HTTPS proxy may not work at all, even with the standard environment variables set. Version 1 is the node version documented here.
04What should you connect it to, and where do you start?
Connect it to the Model port of a root node, and start with a Basic LLM Chain. That pairing is the one the official documentation recommends for this node, and it is also the simplest thing that works: a prompt goes in, text comes out, and you can see immediately whether your Ollama instance is reachable. From there the same port is accepted by the Question and Answer Chain, the Summarization Chain and the Information Extractor, among others. Leave the options untouched on the first run and only open them once the connection is proven.
05n8n or Make for a local model?
It depends on where the model has to live. Make is a hosted automation platform with no self-hosting option, billed per operation, so a model running on your own hardware is not the scenario it is built around. n8n runs either on n8n Cloud or on your own infrastructure through Docker or npm, and a workflow is identical in both cases, which is what lets this node talk to an Ollama instance on the same network. Judge on four criteria: hosting, control over your data, the cost model, and how each platform's visual logic fits the way your team works.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.