Skip to main content

PromptOllama

Description

Sends a prompt to Ollama, writing the response either as a FlowFile attribute or to the contents of the incoming FlowFile. The prompt may consist of pure text interaction or may include images. In the case of images the contents of the FlowFile will be used. Since the Web Client Service will also be used to download models the Timeouts should be set high to allow for large model downloads.

Tags

ai, chat, image, ollama, prompt, text

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Service URL *Service URLThe URL to use to communicate with Ollama
Web Client Service *Web Client ServiceController Service:
WebClientServiceProvider

Implementations:
StandardWebClientServiceProvider
The Web Client Service to use for communicating with Ollama. Set timeouts greater than 5 mins for model downloads.
Prompt Type *Prompt TypeText
  • Text
  • Image
The type of prompt to send to Ollama
Text Model Name *Text Model Namellama3.1:8bThe name of the Ollama model for text

Supports Expression Language, using FlowFile attributes and Environment variables.

This property is only considered if:
  • the property Prompt Type has a value of Text
Image Model Name *Image Model Namellava:7bThe name of the Ollama model for images

Supports Expression Language, using FlowFile attributes and Environment variables.

This property is only considered if:
  • the property Prompt Type has a value of Image
System MessageSystem MessageThe system message to send to Ollama. FlowFile attributes may be referenced via Expression Language, and the contents of the FlowFile may be referenced via the flowfile_content variable. E.g., ${flowfile_content}

Supports Expression Language, using FlowFile attributes and Environment variables.
User Message *User MessageThe user message to send to Ollama. FlowFile attributes may be referenced via Expression Language, and the contents of the FlowFile may be referenced via the flowfile_content variable. E.g., ${flowfile_content}

Supports Expression Language, using FlowFile attributes and Environment variables.
Response Format *Response FormatPlain Text
  • JSON
  • Plain Text
The format of the response from Ollama
Output Strategy *Output StrategyFlowFile
  • FlowFile
  • Attribute
Determines response output destination
Results AttributeResults AttributeThe name of the attribute to write the response to.

This property is only considered if:
  • the property Output Strategy has a value of Attribute
Max File SizeMax File Size10 MBThe maximum size of a FlowFile that can be sent to Ollama as an image. If the FlowFile is larger than this, it will be routed to 'failure'.

This property is only considered if:
  • the property Prompt Type has a value of Image
TemperatureTemperatureThe temperature to use for generating the response.

Supports Expression Language, using FlowFile attributes and Environment variables.
Top PTop PThe top P value to use for generating the response

Supports Expression Language, using FlowFile attributes and Environment variables.
SeedSeedThe seed to use for generating the response

Supports Expression Language, using FlowFile attributes and Environment variables.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureIf unable to obtain a valid response from Ollama, the original FlowFile will be routed to this relationship
successThe response from Ollama is routed to this relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

This processor does not write attributes.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also