# Cog

{% hint style="info" %}
See the changelog of this Action type [here](/actions/cog.md).
{% endhint %}

## Overview <a href="#overview" id="overview"></a>

The **Cog** Action evaluates any AI model built with the [Cog library](https://pypi.org/project/cog/) and deployed as an endpoint anywhere (SageMaker, HuggingFace, Replicate…) and adds new values.

This Action integrates with models deployed on any platform, including the client's infrastructure. It enables the utilization of state-of-the-art machine learning models and the execution of code specific to a client's unique use case.

<figure><picture><source srcset="/files/lwETLhmssyQhDCRA8NDB" media="(prefers-color-scheme: dark)"><img src="/files/DxZbddezrAtUqqXMeu76" alt=""></picture><figcaption></figcaption></figure>

{% hint style="warning" %}
In order to configure this action, you must first link it to a Listener. Go to [Building a Pipeline ](/the-workspace/pipelines/building-a-pipeline.md)to learn how this works.
{% endhint %}

## Ports

These are the input and output ports of this Action:

<details>

<summary>Input ports</summary>

* **Default port** - All the events to be processed by this Action enter through this port.

</details>

<details>

<summary>Output ports</summary>

* **Default port** - Events are sent through this port if no error occurs while processing them.
* **Error port** - Events are sent through this port if an error occurs while processing them.

</details>

## Configuration

{% stepper %}
{% step %}
Find **Cog** in the **Actions** tab (under the **AI** group) and drag it onto the canvas.
{% endstep %}

{% step %}
To open the configuration, click the Action in the canvas and select **Configuration**.
{% endstep %}

{% step %}
Enter the required parameters:

<table><thead><tr><th width="231">Parameter</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Endpoint</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Enter the endpoint used to establish a connection to the model.</td><td></td></tr><tr><td><strong>Token</strong></td><td>If the model has a token for API connection, enter it here.</td><td></td></tr><tr><td><strong>Version</strong></td><td>Optionally, enter the version model here.</td><td></td></tr><tr><td><strong>Input</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Enter the JSON with the input parameters required by the model.</td><td></td></tr><tr><td><strong>Output</strong><mark style="color:red;"><strong>*</strong></mark></td><td>Enter a name for the output model evaluation.</td><td></td></tr></tbody></table>
{% endstep %}

{% step %}
Click **Save** to complete.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/pipelines/actions/ai/cog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
