Skip to content

Ollama

Ollama connects your flows to the models installed on your own Ollama server. You can use it in two ways: as the model of an agent, by connecting its Model output to the agent’s Model input, or on its own, so that it answers the text that reaches its Input.

When to use it

  • Give an agent the model it uses to understand requests, decide which tools to use and answer.
  • Write, summarise or classify texts inside a flow, without an agent.
  • Work with models your company runs on its own machines.
  • Process a list of texts one by one with Batch Mode.

Configuration

In the Common tab:

FieldWhat it does
Base URLThe address of your Ollama server. NappAI must be able to reach it.
Model NameThe model that answers. After typing the server address, press the refresh button next to the field to load the models installed on it.
TemperatureHow varied the answers are: low values give steadier, more predictable answers; high values, more creative ones. Default: 0.2.
VerboseIt does not change the answer; you can leave it off. Default: off.
ConnectionWhat to connect
InputThe text the model must answer when it works on its own, for example the message of a Chat Input or the result of a Prompt.

Advanced options

In the Advanced tab:

FieldWhat it does
System MessageGeneral instructions for the model when it works on its own: its role, the tone, what to avoid. You can type them or connect them from another component.
StreamShows the answer in the chat while it is being written, instead of waiting until it is finished. It only has an effect in the chat. Default: off.
ReasoningHow much the model thinks before answering, for models that think. Default keeps the model’s own behaviour; off and on turn it off or on; low, medium and high set how much it thinks. Default: Default.
FormatType json so the answer arrives as structured data.
Context Window SizeHow much text the model can take into account at once, in tokens.
Top K and Top POther ways to control how varied the answer is. Temperature is usually enough.
Repeat PenaltyHow much repetition in the answer is penalised.
Stop TokensWords or symbols, separated by commas, at which the model stops writing.
TimeoutHow long to wait for the server’s answer.
Other optionsMirostat, Mirostat Eta, Mirostat Tau, Number of GPUs, Number of Threads, Repeat Last N, TFS Z, Min p, Metadata, Tags, System, Template: fine-tuning settings for advanced users. Leave them as they are if you don’t need them.

Batch processing

With the Batch Mode switch on, the component runs once for each item of the list you connect to Batch Input and returns all the results together as a list. Parallel Executions sets how many items are processed at the same time (1 to 5). Skip if Empty Batch Input skips the component when the list arrives empty, and Skip Branch if Empty Output stops the following components when the result is empty. More in Key concepts.

Output

OutputWhat it contains
ModelThe configured model. It sits at the top of the component. Connect it to the Model input of an agent or of any other component that asks for a model.
TextThe model’s answer to the text received in Input. Connect it, for example, to a Chat Output or to another component that works with text.

The two ways of using it exclude each other: when you connect the Model output, the component hides Input and Text, because the model now works inside the other component; and if you connect Input, Model is hidden.

Example

The Fiscal Sur consultancy has an Ollama server in its office so its clients’ data stays there. It types its address in Base URL, refreshes the Model Name list and chooses a model. Then it connects the Model output to an agent that sorts the incoming documents.

Good practices

  • Use a low Temperature when you need exact answers, such as classifying or extracting data, and raise it for more creative texts.
  • If you use the model with an agent, configure only the model here: the instructions and the tools are set in the agent.