# Ollama

> Run open models such as Llama, Qwen, Gemma and Mistral on your own Ollama server or on ollama.com: chat, generate text, create embeddings and see which models it has.

App · 6 actions. Web page: https://docs.lodol.com/docs/integrations/ollama

## Actions

### Chat with a model

Send a message to a model and get its answer, with an optional system prompt and earlier turns of the conversation.

**Inputs**

- Model (`model`, text, required): The model to answer, as the server names it, such as llama3.2 or qwen3:8b. It must be downloaded on the server.
- Prompt (`prompt`, text, required): What to ask or tell the model.
- System prompt (`system`, text): Instructions the model follows for the whole answer, such as its role or the format to answer in.
- Earlier messages (`messages`, list): Earlier turns of the conversation, oldest first, each like {"role": "user", "content": "Hi"}. Roles are user, assistant and system.
- Temperature (`temperature`, number): How varied the answer is, from 0 (the same answer every time) to 2. Leave empty for the model's own setting. From 0 to 2.0.
- Max tokens (`max_tokens`, number): Stop the answer after this many tokens (about three quarters of a word each). Leave empty to let the model finish. From 1 to 131072.
- JSON output (`json_output`, true/false): Make the answer a JSON object a later step can read. Say in the prompt which fields you want.
- Think (`think`, true/false): For thinking models such as qwen3 and deepseek-r1: true to reason before answering, false to answer straight away. Other models refuse true. Leave empty for the model's own setting.

**Outputs**

- `done_reason` (text): Why the model stopped: stop when it finished, length when it hit the maximum tokens.
- `duration_seconds` (number): How long the server took, loading the model included.
- `model` (text): The model that answered.
- `prompt_tokens` (number): How many tokens the prompt took.
- `response_tokens` (number): How many tokens the answer took.
- `text` (text): The model's answer.
- `thinking` (text): The model's reasoning before it answered, from a thinking model; empty for other models.

**Example output**

```json
{
  "done_reason": "stop",
  "duration_seconds": 1.42,
  "model": "llama3.2",
  "prompt_tokens": 26,
  "response_tokens": 14,
  "text": "The sky looks blue because air scatters blue light more.",
  "thinking": ""
}
```

### Create embeddings

Turn text into embeddings: lists of numbers that place similar meanings close together, for search and matching. Takes one text or up to 100.

**Inputs**

- Model (`model`, text, required): An embedding model on the server, such as nomic-embed-text or embeddinggemma. A chat model can't make embeddings.
- Text (`input`, text, required): The text to embed, or a list of up to 100 texts, each embedded separately.

**Outputs**

- `count` (number): How many embeddings came back.
- `dimensions` (number): How many numbers each embedding has.
- `embeddings` (list): One embedding per text, in the order given; each is a list of numbers.
- `model` (text): The model that made them.

**Example output**

```json
{
  "count": 1,
  "dimensions": 3,
  "embeddings": [
    [
      0.010071029,
      -0.0017594862,
      0.05007221
    ]
  ],
  "model": "nomic-embed-text"
}
```

### Generate a completion

Send one prompt to a model and get the text it writes, with no conversation around it.

**Inputs**

- Model (`model`, text, required): The model to write the text, as the server names it, such as llama3.2. It must be downloaded on the server.
- Prompt (`prompt`, text, required): What to ask or tell the model.
- System prompt (`system`, text): Instructions the model follows for the whole answer, such as its role or the format to answer in.
- Temperature (`temperature`, number): How varied the answer is, from 0 (the same answer every time) to 2. Leave empty for the model's own setting. From 0 to 2.0.
- Max tokens (`max_tokens`, number): Stop the answer after this many tokens (about three quarters of a word each). Leave empty to let the model finish. From 1 to 131072.
- JSON output (`json_output`, true/false): Make the answer a JSON object a later step can read. Say in the prompt which fields you want.
- Think (`think`, true/false): For thinking models such as qwen3 and deepseek-r1: true to reason before answering, false to answer straight away. Other models refuse true. Leave empty for the model's own setting.

**Outputs**

- `done_reason` (text): Why the model stopped: stop when it finished, length when it hit the maximum tokens.
- `duration_seconds` (number): How long the server took, loading the model included.
- `model` (text): The model that answered.
- `prompt_tokens` (number): How many tokens the prompt took.
- `response_tokens` (number): How many tokens the answer took.
- `text` (text): The model's answer.
- `thinking` (text): The model's reasoning before it answered, from a thinking model; empty for other models.

**Example output**

```json
{
  "done_reason": "stop",
  "duration_seconds": 0.87,
  "model": "llama3.2",
  "prompt_tokens": 12,
  "response_tokens": 9,
  "text": "Lodol runs your workflows, step by step.",
  "thinking": ""
}
```

### Get model details

Get a model's details and what it can do, such as tools, vision, thinking or embeddings.

**Inputs**

- Model (`model`, text, required): The model to describe, as the server names it, such as llama3.2.

**Outputs**

- `capabilities` (list): What it can do: completion (writes text), tools, vision, thinking, embedding and others.
- `context_length` (number): The most tokens it can read at once, or null when the server does not say.
- `family` (text): The model family, such as llama.
- `format` (text): The file format, such as gguf.
- `model` (text): The model asked about.
- `modified_at` (text): When it was last downloaded or changed.
- `parameter_size` (text): How many parameters it has.
- `parameters` (text): Its default settings, one per line, as Ollama shows them.
- `quantization_level` (text): How its weights are compressed, such as Q4_0.

**Example output**

```json
{
  "capabilities": [
    "completion",
    "tools"
  ],
  "context_length": 131072,
  "family": "llama",
  "format": "gguf",
  "model": "llama3.2",
  "modified_at": "2025-05-04T17:37:44.706015396-07:00",
  "parameter_size": "3.2B",
  "parameters": "stop                           \"<|eot_id|>\"",
  "quantization_level": "Q4_K_M"
}
```

### List models

List the models downloaded on the Ollama server.

**Inputs**: None.

**Outputs**

- `count` (number): How many models there are.
- `models` (list): The models, most recently changed first.

**Example output**

```json
{
  "count": 2,
  "models": [
    {
      "family": "llama",
      "modified_at": "2025-05-04T17:37:44.706015396-07:00",
      "name": "llama3.2:latest",
      "parameter_size": "3.2B",
      "quantization_level": "Q4_K_M",
      "size": 2019393189
    },
    {
      "family": "nomic-bert",
      "modified_at": "2025-05-02T09:12:03.120511284-07:00",
      "name": "nomic-embed-text:latest",
      "parameter_size": "137M",
      "quantization_level": "F16",
      "size": 274302450
    }
  ]
}
```

### List running models

List the models loaded in the server's memory right now, and until when each stays loaded.

**Inputs**: None.

**Outputs**

- `count` (number): How many models are loaded.
- `models` (list): The loaded models.

**Example output**

```json
{
  "count": 1,
  "models": [
    {
      "expires_at": "2024-06-04T14:38:31.83753-07:00",
      "family": "llama",
      "name": "mistral:latest",
      "parameter_size": "7.2B",
      "quantization_level": "Q4_0",
      "size": 5137025024,
      "size_vram": 5137025024
    }
  ]
}
```
