package
0.40.0-beta
Repository: https://github.com/instill-ai/pipeline-backend.git
Documentation: pkg.go.dev

# README


title: "Instill Model" lang: "en-US" draft: false description: "Learn about how to set up a VDP Instill Model component https://github.com/instill-ai/instill-core"

The Instill Model component is an AI component that allows users to connect the AI models served on the Instill Model Platform. It can carry out the following tasks:

Release Stage

Alpha

Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

Supported Tasks

Classification

Classify images into predefined categories.

InputIDTypeDescription
Task ID (required)taskstringTASK_CLASSIFICATION
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
CategorycategorystringThe predicted category of the input.
ScorescorenumberThe confidence score of the predicted category of the input.

Instance Segmentation

Detect, localize and delineate multiple objects in images.

InputIDTypeDescription
Task ID (required)taskstringTASK_INSTANCE_SEGMENTATION
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
Objectsobjectsarray[object]A list of detected instance bounding boxes.
Output Objects in Instance Segmentation

Objects

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
CategorycategorystringThe predicted category of the bounding box.
RLErlestringRun Length Encoding (RLE) of instance mask within the bounding box.
ScorescorenumberThe confidence score of the predicted instance object.

Bounding Box

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value

Keypoint

Detect and localize multiple keypoints of objects in images.

InputIDTypeDescription
Task ID (required)taskstringTASK_KEYPOINT
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
Objectsobjectsarray[object]A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object.
Output Objects in Keypoint

Objects

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
KeypointskeypointsarrayA keypoint group is composed of a list of pre-defined keypoints of a detected object.
ScorescorenumberThe confidence score of the predicted object.

Keypoints

FieldField IDTypeNote
Visibility Scorevnumbervisibility score of the keypoint.
X Coordinatexnumberx coordinate of the keypoint.
Y Coordinateynumbery coordinate of the keypoint.

Bounding Box

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value

Detection

Detect and localize multiple objects in images.

InputIDTypeDescription
Task ID (required)taskstringTASK_DETECTION
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
Objectsobjectsarray[object]A list of detected objects.
Output Objects in Detection

Objects

FieldField IDTypeNote
Bounding boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
CategorycategorystringThe predicted category of the bounding box.
ScorescorenumberThe confidence score of the predicted category of the bounding box.

Bounding Box

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value

OCR

Detect and recognize text in images.

InputIDTypeDescription
Task ID (required)taskstringTASK_OCR
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
Objectsobjectsarray[object]A list of detected bounding boxes.
Output Objects in OCR

Objects

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
ScorescorenumberThe confidence score of the predicted object.
TexttextstringText string recognised per bounding box.

Bounding Box

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value

Semantic Segmentation

Classify image pixels into predefined categories.

InputIDTypeDescription
Task ID (required)taskstringTASK_SEMANTIC_SEGMENTATION
Model Name (required)model-namestringThe Instill Model model to be used.
Image (required)image-base64stringImage base64
OutputIDTypeDescription
Stuffsstuffsarray[object]A list of RLE binary masks.
Output Objects in Semantic Segmentation

Stuffs

FieldField IDTypeNote
CategorycategorystringCategory text string corresponding to each stuff mask.
RLErlestringRun Length Encoding (RLE) of each stuff mask within the image.

Text Generation

Generate texts from input text prompts.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_GENERATION
Model Name (required)model-namestringThe Instill Model model to be used.
Prompt (required)promptstringThe prompt text
System Messagesystem-messagestringThe system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant."
SeedseedintegerThe seed
TemperaturetemperaturenumberThe temperature for sampling
Max New Tokensmax-new-tokensintegerThe maximum number of tokens for model to generate
OutputIDTypeDescription
TexttextstringText

Text Generation Chat

Generate texts from input text prompts and chat history.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_GENERATION_CHAT
Model Name (required)model-namestringThe Instill Model model to be used.
Prompt (required)promptstringThe prompt text
System Messagesystem-messagestringThe system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant."
Prompt Imagesprompt-imagesarray[string]The prompt images
Chat historychat-historyarray[object]Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.
SeedseedintegerThe seed
TemperaturetemperaturenumberThe temperature for sampling
Max New Tokensmax-new-tokensintegerThe maximum number of tokens for model to generate
Input Objects in Text Generation Chat

Chat History

Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.

FieldField IDTypeNote
ContentcontentarrayThe message content
RolerolestringThe message role, i.e. 'system', 'user' or 'assistant'

Content

The message content

FieldField IDTypeNote
Image URLimage-urlobjectThe image URL
TexttextstringThe text content.
TypetypestringThe type of the content part.
Enum values
  • text
  • image-url

Image URL

The image URL

FieldField IDTypeNote
URLurlstringEither a URL of the image or the base64 encoded image data.
OutputIDTypeDescription
TexttextstringText

Text to Image

Generate images from input text prompts.

InputIDTypeDescription
Task ID (required)taskstringTASK_TEXT_TO_IMAGE
Model Name (required)model-namestringThe Instill Model model to be used.
Prompt (required)promptstringThe prompt text
SamplessamplesintegerThe number of generated samples, default is 1
SeedseedintegerThe seed, default is 0
Aspect rationegative-promptstringKeywords of what you do not wish to see in the output image.
Aspect ratioaspect-ratiostringControls the aspect ratio of the generated image. Defaults to 1:1.
OutputIDTypeDescription
Imagesimagesarray[string]Images

Visual Question Answering

Answer questions based on a prompt and an image.

InputIDTypeDescription
Task ID (required)taskstringTASK_VISUAL_QUESTION_ANSWERING
Model Name (required)model-namestringThe Instill Model model to be used.
Prompt (required)promptstringThe prompt text
System Messagesystem-messagestringThe system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant."
Prompt Imagesprompt-imagesarray[string]The prompt images
Chat historychat-historyarray[object]Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.
SeedseedintegerThe seed
TemperaturetemperaturenumberThe temperature for sampling
Max New Tokensmax-new-tokensintegerThe maximum number of tokens for model to generate
Input Objects in Visual Question Answering

Chat History

Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.

FieldField IDTypeNote
ContentcontentarrayThe message content
RolerolestringThe message role, i.e. 'system', 'user' or 'assistant'

Content

The message content

FieldField IDTypeNote
Image URLimage-urlobjectThe image URL
TexttextstringThe text content.
TypetypestringThe type of the content part.
Enum values
  • text
  • image-url

Image URL

The image URL

FieldField IDTypeNote
URLurlstringEither a URL of the image or the base64 encoded image data.
OutputIDTypeDescription
TexttextstringText

Chat

Generate texts from input text prompts and chat history.

InputIDTypeDescription
Task ID (required)taskstringTASK_CHAT
Model Name (required)model-namestringThe Instill Model model to be used.
Prompt (required)promptstringThe prompt text
System Messagesystem-messagestringThe system message helps set the behavior of the assistant. For example, you can modify the personality of the assistant or provide specific instructions about how it should behave throughout the conversation. By default, the model’s behavior is using a generic message as "You are a helpful assistant."
Prompt Imagesprompt-imagesarray[string]The prompt images
Chat historychat-historyarray[object]Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.
SeedseedintegerThe seed
TemperaturetemperaturenumberThe temperature for sampling
Max New Tokensmax-new-tokensintegerThe maximum number of tokens for model to generate
Input Objects in Chat

Chat History

Incorporate external chat history, specifically previous messages within the conversation. Please note that System Message will be ignored and will not have any effect when this field is populated. Each message should adhere to the format: : {"role": "The message role, i.e. 'system', 'user' or 'assistant'", "content": "message content"}.

FieldField IDTypeNote
ContentcontentarrayThe message content
RolerolestringThe message role, i.e. 'system', 'user' or 'assistant'

Content

The message content

FieldField IDTypeNote
Image URLimage-urlobjectThe image URL
TexttextstringThe text content.
TypetypestringThe type of the content part.
Enum values
  • text
  • image-url

Image URL

The image URL

FieldField IDTypeNote
URLurlstringEither a URL of the image or the base64 encoded image data.
OutputIDTypeDescription
TexttextstringText

# Functions

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author