Ollama

Integrate with open source LLMs using Ollama. With an instance of Ollama running locally you can use this integration to have a conversation in an Incident, download models, and create new models.

Utilities · Ollama

Details

IDOllama
ProviderOpen Source
CategoryUtilities
From Version6.0.0
Docker Imagedemisto/python3:3.12.8.3296088
Supported ModulesAgentix XSIAM

README

Integrate with open source LLMs using Ollama. With an instance of Ollama running locally you can use this integration to have a conversation in an Incident, download models, and create new models.

Configure Ollama in Cortex

Parameter Description Required
Protocol HTTP or HTTPS False
Server hostname or IP Enter the Ollama IP or hostname True
Port The port Ollama is running on True
Path By default Ollama’s API path is /api, but you may be running it behind a proxy with a different path. True
Trust any certificate (not secure) Trust any certificate (not secure) False
Use system proxy settings Use system proxy settings False
Cloudflare Access Client Id If Ollama is running behind CLoudflare ZeroTrust, provide the Service Access ID here. False
Cloudflare Access Client Secret If Ollama is running behind CLoudflare ZeroTrust, provide the Service Access Secret here. False
Default Model Some commands allow you to specify a model. If no model is provided, this value will be used. False

Commands

You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.

ollama-list-models


Get a list of all available models

Base Command

ollama-list-models

Input

| Argument Name | Description | Required |
| — | — | — |

Context Output

Path Type Description
ollama.models unknown Output of the command

ollama-model-pull


Pull a model

Base Command

ollama-model-pull

Input

Argument Name Description Required
model Name of model to pull. See https://ollama.com/library for a list of options. Optional

Context Output

Path Type Description
ollama.pull unknown Output of the command

ollama-model-delete


Delete a model

Base Command

ollama-model-delete

Input

Argument Name Description Required
model The name of the model to delete. Optional

Context Output

Path Type Description
ollama.delete unknown Output of the command

ollama-conversation


General chat command that tracks the conversation history in the Incident.

Base Command

ollama-conversation

Input

Argument Name Description Required
model The model name. Optional
message The message to be sent. Required

Context Output

Path Type Description
ollama.history unknown Output of the command

ollama-model-info


Show information for a specific model.

Base Command

ollama-model-info

Input

Argument Name Description Required
model name of the model to show. Optional

Context Output

Path Type Description
ollama.show unknown Output of the command

ollama-model-create


Create a new model from a Modelfile.

Base Command

ollama-model-create

Input

Argument Name Description Required
model name of the model to create. Required
model_file contents of the Modelfile. Required

Context Output

Path Type Description
ollama.create unknown Output of the command

ollama-generate


Generate a response for a given prompt with a provided model. Conversation history IS NOT tracked.

Base Command

ollama-generate

Input

Argument Name Description Required
model The model name. Optional
message The message to be sent. Optional

Context Output

Path Type Description
ollama.generate unknown Output of the command

Configuration parameters

  • protocol — Protocol
  • host — Server hostname or IP (required)
  • port — Port (required)
  • path — Path (required)
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings
  • cf_id — Cloudflare Access Client Id
  • cf_secret — Cloudflare Access Client Secret
  • default_model — Default Model

Commands (7)

  • ollama-conversation

    General chat command that tracks the conversation history in the Incident.

  • ollama-generate

    Generate a response for a given prompt with a provided model. Conversation history IS NOT tracked.

  • ollama-list-models

    Get a list of all available models.

  • ollama-model-create

    Create a new model from a Modelfile.

  • ollama-model-delete

    Delete a model.

  • ollama-model-info

    Show information for a specific model.

  • ollama-model-pull

    Pull a model.


## Ollama
This section explains how to configure the instance of Ollama in Cortex XSOAR:
- **Name:** Name of the integration instance
- **Protocol:** HTTP or HTTPS
- **Server hostname or IP:** The domain or IP of the Ollama instance
- **Port:** Ollama's default port is `11434`
- **Path:** Ollama's default api path is `/api`
- **Cloudflare Access Client ID:** If Ollama is running behind Cloudflare's ZeroTrust, enter the service account client ID 
- **Cloudflare Access Client Secret:** If Ollama is running behind Cloudflare's ZeroTrust, enter the service account client secret key
- **Default Model:** Many commands allow you to specify what model to use. The value entered here will be used if no model is specified in the command

## Install Ollama
Get the latest version for MacOS, Windows, Linux or Docker from Ollama's [official website](https://ollama.com/).

## Model names
Model names follow a `model:tag` format, where `model` can have an optional namespace such as `example/model`. Some examples are `orca-mini:3b-q4_1` and `llama2:70b`. The tag is optional and, if not provided, will default to `latest`. The tag is used to identify a specific version.

See the list of available models [here](https://ollama.com/library).

---
[View Ollama's API Documentation](https://github.com/ollama/ollama/blob/main/docs/api.md)